题目链接:http://codeforces.com/contest/519/problem/C 题目意思:给出 n 个  experienced participants  和 m 个 newbies ,需要组成尽量多的组,组由3个人组成.有两种组合方式:(1)1 个 experienced participant 和 2 个  newbie  (2)2 个 experienced participant 和 1 个  newbie.问最多能组成的组数是多少组. 昨天做的时候不是暴力做的,惯性…
C. A and B and Team Training time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. An important part of preparing for a competition is s…
题目链接:http://codeforces.com/problemset/problem/489/C 题目意思:给出 m 和 s,需要构造最大和最小的数.满足长度都为 m,每一位的数字之和等于 s.如果构造不出来,输出 -1 -1.否则输出最小和最大且符合条件的数. 想了两个多小时,发现想错了方向...... /****************************************** 首先把不能得到最小数和最大数的情况揪出来. 第二组测试数据 3 0 有提示,s = 0 且 m >…
Time Limit:3000MS     Memory Limit:0KB Description Queues and Priority Queues are data structures which are known to most computer scientists. The Team Queue, however, is not so well known, though it occurs often in everyday life. At lunch time the q…
题目链接:http://codeforces.com/problemset/problem/454/B 题目意思:给出一个序列你 a1, a2, ..., an. 问每次操作只能通过将最后一个数拿出来插到队首,即 a1, a2, ..., an  变成 an, a1, a2, ..., an - 1.求更新后的序列变成非递减的时候,操作了多少次. 其实是不难的一道题目啦---,可能昨天真的太累,脑有点短路,想得太过复杂. /************************************…
interlinkage: http://codeforces.com/contest/1119/problem/F description: 有一颗$n$个节点的树,每条边有一个边权 对于一个$x$,删去一些边使得每个点的度数都不超过$x$,最小化删去边的边权并输出 需要一次输出$x=0->n-1$的值 $1<=n<=250000$ solution: part1 先考虑单个$x$的做法.任选一个根,设$f_{u,0/1}$表示以节点$u$为根的子树内,节点$u$与它的父亲不断/断的最…
                                                                                           B. Testing Robots time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output The Cybernetics Failures (CF) o…
C. A and B and Team Training time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. An important part of preparing for a competition is s…
A and B and Team Training time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A and B are preparing themselves for programming contests. An important part of preparing for a competition is shar…
C. A and B and Team Training 题目:A and B are preparing themselves for programming contests. An important part of preparing for a competition is sharing programming knowledge from the experienced members to those who are just beginning to deal with the…