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…
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…
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<…
D. Valid Sets Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/486/problem/D Description As you know, an undirected connected graph with n nodes and n - 1 edges is called a tree. You are given an integer d and a tree consist…
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集合…
D. Valid Sets time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output As you know, an undirected connected graph with n nodes and n - 1 edges is called a tree. You are given an integer d and a tree…
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…
D. Valid Sets   As you know, an undirected connected graph with n nodes and n - 1 edges is called a tree. You are given an integer d and a tree consisting of n nodes. Each node i has a value ai associated with it. We call a set S of tree nodes valid …
补题解: 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[…