A. Greg's Workout

  • 模3求和,算最大值。

B. Code Parsing

  • 最后左半部分为x,右半部分为y,那么从中间不断去掉xy,直到其中一种全部消去。

C. Almost Arithmetical Progression

  • 构成的序列为两种值交替出现。
  • 离散化后,用\(f(i,j)\)表示数值\(j\)与\(a_i\)构成的序列的最长长度。

D. Mr. Bender and Square

  • 二分时间,覆盖的格子数用总数扣除超过4条边界的个数,此时重复扣除了4个角落的格子数,所以还需要加上4个角落的个数。

E. Furlo and Rublo and Game

  • 在\(10^6\)范围内打表可以找出一定的规律,可以发现2点:
  1. \(sg\)值不大,在0~3之间;
  2. \(sg\)值分成了若干个区间,可肉眼识别。
  • 由于\(a_i\)开方后在\(10^6\)内,结合\(sg\)值不大,可以统计\(sum(i,j)\)(\(1\)~\(i\)内\(sg\)值为\(j\)的个数),那么可以\(O(1)\)算出对应\(sg\)值。

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

  1. Codeforces Round #156 (Div. 2)---A. Greg's Workout

    Greg's Workout time limit per test 2 seconds memory limit per test 256 megabytes input standard inpu ...

  2. 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 ...

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

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

  4. Codeforces Round #368 (Div. 2)

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

  5. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  6. Codeforces Round #279 (Div. 2) ABCDE

    Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/outpu ...

  7. Codeforces Round #262 (Div. 2) 1003

    Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 2 ...

  8. Codeforces Round #262 (Div. 2) 1004

    Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory lim ...

  9. Codeforces Round #371 (Div. 1)

    A: 题目大意: 在一个multiset中要求支持3种操作: 1.增加一个数 2.删去一个数 3.给出一个01序列,问multiset中有多少这样的数,把它的十进制表示中的奇数改成1,偶数改成0后和给 ...

随机推荐

  1. 深入浅出设计模式——备忘录模式(Memento Pattern)

    模式动机 为了使软件的使用更加人性化,对于误操作,我们需要提供一种类似“后悔药”的机制,让软件系统可以回到误操作前的状态,因此需要保存用户每一次操作时系统的状态,一旦出现误操作,可以把存储的历史状态取 ...

  2. centos BIND服务基础及域主服务器配置

    系统信息: Linux localhost.localdomain -.el6.i686 # SMP Tue Dec :: GMT i686 i686 i386 GNU/Linux 因为看的是linu ...

  3. vs2010 vc++ 统一修改所有工程的目录配置

    vs2005和vs2008中都是通过 工具-选项-项目和解决方案-VC++目录,设置 头文件include .库文件lib.可执行文件dll的路径,以便在引用dll动态链接库文件时,可以查找到该文件的 ...

  4. C语言中const的正确用法

    今天看<Linux内核编程>(Claudia Salzberg Podriguez等著)时,文中(p39)有一个错误,就是关于const的用法. 原文中举例说明:const int *x中 ...

  5. vs2012中VC连接mysql

    在MySQL的安装目录下你会找到include和lib文件夹(完全安装模式下),里面分别是C接口的头文件和库文件,库文件只用libmysql.lib就好了,即把libmysql.lib拷贝到了VC++ ...

  6. Yii 检查输入的数据是否已经存在

    只需要在对应的Model文件中的rules方法里面加入 array('username', 'unique', 'message'=>'{attribute}已存在'),//username是需 ...

  7. ssm(spring,springmvc,mybatis)

    1.配置web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version=&qu ...

  8. 读javascript高级程序设计06-面向对象之继承

    原型链是实现继承的主要方法,通过原型能让一个引用类型继承另一个引用类型. 1.原型链实现继承 function SuperType(){ this.superprop=1; } SuperType.p ...

  9. Material Design之TextInputLayout使用示例

    Google在2015的IO大会上,给我们带来了更加详细的Material Design设计规范,同时,也给我们带来了全新的Android Design Support Library,在这个supp ...

  10. canvas 利用canvas中的globalCompositeOperation 绘制刮奖 效果

    <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <t ...