http://codeforces.com/contest/373/problem/E E. Watching Fireworks is Fun time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output A festival will be held in a town's main street. There are n sectio…
C. Watching Fireworks is Fun time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output A festival will be held in a town's main street. There are n sections in the main street. The sections are numb…
题目传送门 /* 数学:这题一直WA在13组上,看了数据才知道是计算cost时超long long了 另外不足一个区间的直接计算个数就可以了 */ #include <cstdio> #include <cmath> #include <iostream> #include <algorithm> #include <cstring> using namespace std; typedef unsigned long long ull; int…
戳我看题目 A:给你n个数,要求尽可能多的找出匹配,如果两个数匹配,则ai*2 <= aj 排序,从中间切断,分成相等的两半后,对于较大的那一半,从大到小遍历,对于每个数在左边那组找到最大的满足条件的数配对 用一个变量移动一下就好了.这样的配对数量肯定就是最多的. 因为 1:如果左边那一半数量取少一点,比如取a1 a2 a3...ak (k < n/2) 那实际上ak+1 ak+2 .. a n/2 这些数就没啥用了,因为后面那一半数已经足够匹配当前的这些数了,不可能后面还有某些数不匹配而拿这…
B. Making Sequences is Fun time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output We'll define S(n) for positive integer n as follows: the number of the n's digits in the decimal base. For exampl…
D. Counting Rectangles is Fun time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output There is an n × m rectangular grid, each cell of the grid contains a single integer: zero or one. Let's call t…
D. Counting Rectangles is Fun time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output There is an n × m rectangular grid, each cell of the grid contains a single integer: zero or one. Let's call t…
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate it n = int(raw_input()) s = "" a = ["I hate that ","I love that ", "I hate it","I love it"] for i in ran…
Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/output 1 s, 256 MB    x3384 B Pyramid of Glasses standard input/output 1 s, 256 MB    x1462 C Vasya and String standard input/output 1 s, 256 MB    x1393…
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输出”#Color”,如果只有”G”,”B”,”W”就输出”#Black&White”. #include <cstdio> #include <cstring> using namespace std; const int maxn = 200; const int INF =…