A. Little Elephant and Rozdil

  • 求\(n\)个数中最小值的个数及下标。

B. Little Elephant and Sorting

  • \[\sum_{i=1}^{n-1}{max(0, a_i-a_{i+ 1})}\]

C. Little Elephant and Interval

  • 问题转化成求\([1,n]\)范围内满足题意的数的个数。
  • 假设\(n\)的位数为\(L\),当\(L \gt 2\)时,若\(x\)的位数小于\(L\),则除了首位和末位以外,其余位任意取值,即\(9\cdot 10^{i - 2}\)。
    若\(x\)的位数等于\(L\),那么考虑首位与\(n\)的首位大小关系,小于的情况下后面位任意取,相等情况下需要考虑\(n\)末位与首位的大小关系。

D. Little Elephant and Cards

  • 对颜色离散化后,统计每种颜色正面个数以及背面个数。
  • 注意正面颜色和背面颜色可能相同。

E. Little Elephant and Furik and Rubik

  • 假设\(a_i=b_j\),那么这对的贡献为\(min(i,j)*min(n-i+1, n-j+1)\)。
  • 如果固定住位置\(i\),将\(j\)分成小于\(i\)和大于等于\(i\)两部分,就可以统计出\(i\)的所有贡献。

Codeforces Round #129 (Div. 2)的更多相关文章

  1. 字符串(后缀自动机):Codeforces Round #129 (Div. 1) E.Little Elephant and Strings

    E. Little Elephant and Strings time limit per test 3 seconds memory limit per test 256 megabytes inp ...

  2. Codeforces Round #129 (Div. 1)E. Little Elephant and Strings

    题意:有n个串,询问每个串有多少子串在n个串中出现了至少k次. 题解:sam,每个节点开一个set维护该节点的字符串有哪几个串,启发式合并set,然后在sam上走一遍该串,对于每个可行的串,所有的fa ...

  3. Codeforces Round #129 (Div. 2) C

    Description The Little Elephant very much loves sums on intervals. This time he has a pair of intege ...

  4. Codeforces Round #129 (Div. 2) B

    Description The Little Elephant loves sortings. He has an array a consisting of n integers. Let's nu ...

  5. Codeforces Round #129 (Div. 2) A

    Description The Little Elephant loves Ukraine very much. Most of all he loves town Rozdol (ukr. &quo ...

  6. Educational Codeforces Round 129 (Rated for Div. 2) A-D

    Educational Codeforces Round 129 (Rated for Div. 2) A-D A 题目 https://codeforces.com/contest/1681/pro ...

  7. Codeforces Round #366 (Div. 2) ABC

    Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...

  8. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  9. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

随机推荐

  1. 数据结构-List

    Lis的实现: /////////////////////////////////////////////////////////////////////////////// // // FileNa ...

  2. 如何登录Google美国服务器

    Google访问须知: ① 先访问一次 https://www.google.com/ncr ,禁止“国家重定向(No country Redirect) ” ② 再点击右上角齿轮图标,选第一项“Se ...

  3. System.Web.HttpRequestBase转HttpWebRequest

    /// <summary> /// Copies all headers and content (except the URL) from an incoming to an outgo ...

  4. Javascript 的类型转换之减号

    专职写JS已经有一个月了(对,没错就是一个月),从2014年11月24实习开始到今的2月份,我做的工作一直都是切图,另外跟着老板学产品,现在我一听到切图两字,我就想吐...所以我找了一份专职写JS的工 ...

  5. php大力力 [009节]php在百度文库的几个基础教程

    2015-08-23 php大力力009. php在百度文库的几个基础教程 php大力力 [009节]php在百度文库的几个基础教程 PHP脚本中操作MySQL数据库3-猿代码平台 php基础教程-绝 ...

  6. iOS常用正则表达式验证(手机号、密码格式、身份证号等)

    #import @interfaceUtils : NSObject #pragma 正则匹配手机号 + (BOOL)checkTelNumber:(NSString*) telNumber; #pr ...

  7. Channel Allocation_四色定理

    Description When a radio station is broadcasting over a very large area, repeaters are used to retra ...

  8. 基于linux运用python开发知识点滴

    我是小白,希望我的文章能对小白们有点作用. A.Linux的开源,优势明显,如何使用,基本命令如下: 个人认为最基础的两种操作: 1.文件操作: ls 看文件夹下内容 ls -a 隐藏文件 -l非隐藏 ...

  9. mysql的ERROR:1042

    在虚拟机上测试数据库备份功能,需要连接外部机器上的mysql,pdo总是报超时错误! 起初认为是用的mysql账号的域不匹配!后来发现不是因为这个! 在终端中用mysql命令尝试连接,发现返回的错误是 ...

  10. qq红心头像[中国心]制作教程之Photoshop教程

    QQ红心头像[中国心]制作教程之Photoshop教程 中国最大的WEB开发资源网站及技术社区,阿里西西WEB开发 最近网络流传着很多qq红心头像,msn红心头像,中国心图标等等,最有些搞笑的是还有正 ...