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

CF469 Codeforces Round #268 (Div. 2) http://codeforces.com/contest/469 开学了,时间少,水题就不写题解了,不水的题也不写这么详细了. A 水题 //#pragma comment(linker, "/STACK:102400000,102400000") #include<cstdio> #include<cmath> #include<iostream> #include<…
B. Two Sets Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/468/problem/B Description Little X has n distinct integers: p1, p2, ..., pn. He wants to divide all of them into two sets A and B. The following two conditions must…
A. 24 Game Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/468/problem/A Description Little X used to play a card game called "24 Game", but recently he has found it too easy. So he invented a new game. Initially you ha…
http://codeforces.com/contest/469/problem/D 题目大意: 给你一个长度为n数组,给你两个集合A.B,再给你两个数字a和b.A集合中的每一个数字x都也能在a集合中找到x-a的数字.同理,b集合也一样.问,这个数组能否分成这两个集合?(然后坑点就是集合里面的元素可以为空) 思路一: 首先定义type函数,-1表示不在任何集合内,0表示A集合内,1表示B集合,2表示该元素是a的一半.(之所以要表示成2的原因是因为这个数值很特殊,a-x=x,所以他可以满足A集合…
补题解: E:只会第四种解法:也只看懂了这一种. PS:F[X+10^18]=F[X]+1;F[X]表示X的数字之和; 假设X,F[10^18+X]+F[10^18+X-1]+......F[10^18+1]=F[1]+.....+F[X]+X; 这个应该没问题所以有G[10^18+X]-G[10^18]=G[X]+X; G[X]表示:1-X的数字和的总和: 根据G[10^X]=45*X*10^(X-1);所以G[10^18]=45*18*10^17; 所以G[10^18+X]-G[X]=(G[…
c被fst了................ 然后掉到600+.... 然后...估计得绿名了.. sad A.I Wanna Be the Guy 题意:让你判断1-n个数哪个数没有出现.. sb题...开个数组即可.. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorith…
题目大意 给出一棵树,边上有权值,要求给出一个1到n的排列p,使得sigma d(i, pi)最大,且p的字典序尽量小. d(u, v)为树上两点u和v的距离 题解:一开始没看出来p需要每个数都不同,直接敲了个轻重边剖分orz,交上去才发现不对 #include <iostream> #include <cstdio> #include <cstring> #include <vector> #define fi first #define se secon…
8161957                 2014-10-10 06:12:37     njczy2010     D - Two Sets             GNU C++     Accepted                 171 ms                 7900 KB     8156137                 2014-10-09 17:26:01     njczy2010     D - Two Sets             GNU…
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…