codeforece Round#311 BCDE】的更多相关文章

B题 给我们n,m ,  m表示茶壶的容量 接下来2*n个数字,表示茶杯的容量,将这些茶杯分给n个男孩和n个女孩 可以倒x毫升的茶水给每个女孩,那么就要倒2x毫升的茶水给男孩,当然了,茶杯要装的下,且茶壶的水足够多 问最多能倒多少毫升? 思路:将茶杯按容量从下到大排序,那么前n个茶杯一定分给女孩,后n个茶杯分给男孩.那么只要将第一个茶杯的容量作为上界,0作为下界,二分枚举x, 每次统计后n个茶杯的容量是不是>=2x,如果是,那么说明该容量是可行的. 但是最终的数据测试却错了, 因为精度要达到1e…
E. Ann and Half-Palindrome Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/E Description Tomorrow Ann takes the hardest exam of programming where she should get an excellent mark. On the last theoretical class t…
D. Vitaly and Cycle Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/D Description After Vitaly was expelled from the university, he became interested in the graph theory. Vitaly especially liked the cycles of an…
C. Arthur and Table Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/C Description Arthur has bought a beautiful big table into his new flat. When he came home, Arthur noticed that the new table is unstable. In t…
B. Pasha and Tea Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/B Description Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and…
A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/problem/A Description Soon a school Olympiad in Informatics will be held in Berland, n schoolchildren will participate there. At a meeting of the jury…
题目链接: 点这里 题目 D. Vitaly and Cycle time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output 问题描述 After Vitaly was expelled from the university, he became interested in the graph theory. Vitaly especially…
http://www.cnblogs.com/wenruo/p/4959509.html 给一个图(不一定是连通图,无重边和自环),求练成一个长度为奇数的环最小需要加几条边,和加最少边的方案数. 很容易知道连的边数只能是0,1,2,3. 如果是二分图一定不含长度为奇数的环. 难点是如果是二分图怎么求方案数呢? 二分图染色时能求出每一个联通块.在每一个联通块中把任意两个颜色相同的点连一条边即可达到要求. 如图中红色和绿色的边就是部分可行解 代码(含注释): /*******************…
E. Ann and Half-Palindrome time limit per test 1.5 seconds memory limit per test 512 megabytes input standard input output standard output Tomorrow Ann takes the hardest exam of programming where she should get an excellent mark. On the last theoreti…
我仅仅想说还好我没有放弃,还好我坚持下来了. 最终变成蓝名了,或许这对非常多人来说并不算什么.可是对于一个打了这么多场才好不easy加分的人来说,我真的有点激动. 心脏的难受或许有点是由于晚上做题时太激动了,看别人过得那么快自己也紧张了. 后来看到有非常多大神给我的建议是,刚開始学习的人,手速并非唯一重要的关键,掌握算法,一步步系统的完好它才是最重要的. 所以这一回也没有太紧张,也没有做一题看一下排名. 然后居然第一次进了前1000.rating一下子加了220多. 希望这是一个好的开端,我还想…