本题使用贪心法.关键是考贪心策略.同一时候要求要细心,我提交的时候也WA了几次.大意题目就是怎样依照给定的规则排列一个01字符串,引用原题例如以下: C. Team time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Now it's time of Olympiads. Vanya and Egor decided to make his…
Codeforces 932E Team work You have a team of N people. For a particular task, you can pick any non-empty subset of people. The cost of having x people for the task is xk. Output the sum of costs over all non-empty subsets of people. Input Only line o…
C. Team time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Now it's time of Olympiads. Vanya and Egor decided to make his own team to take part in a programming Olympiad. They've been best fri…
大意: 求构造n个pair, 每个pair满足 对于每k组, 让$b_i$为$[1,k]$, $g_i$循环右移就好了 int n, k, cnt; int main() { scanf("%d%d", &n, &k); if (n>(ll)k*(k-1)) return puts("NO"),0; puts("YES"); int cnt = 0; REP(i,1,n) { int cur = i+1; REP(j,1,k…
D. Basketball Team time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output As a German University in Cairo (GUC) student and a basketball player, Herr Wafa was delighted once he heard the news. GU…
链接:http://codeforces.com/problemset/problem/757/F 正解:灭绝树. mdzz倍增lca的根节点深度必须是1..我因为这个错误调了好久. 我们考虑先求最短路,求完最短路以后,我们就能对原来的无向图构造一个DAG.当我们构造完DAG以后,我们要求的东西已经很明显.那就是删掉一个点以后,最多有多少个点与S不连通.那么,我们按照套路,将DAG跑一遍拓扑排序,建出灭绝树.然后求出除了S点以外的最大size就行了. //It is made by wfj_20…