B. Cards   time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she…
B. Cards 题目连接: http://www.codeforces.com/contest/626/problem/B Description Catherine has a deck of n cards, each of which is either red, green, or blue. As long as there are at least two cards left, she can do one of two actions: take any two (not ne…
C. Lieges of Legendre 题意:给n,m表示有n个为2的倍数,m个为3的倍数:问这n+m个数不重复时的最大值 最小为多少? 数据:(0 ≤ n, m ≤ 1 000 000, n + m > 0) ps:很水的题,主要是策略: 思路:由于里面每隔6就会重复一次,不好直接模拟,并且模拟的效率很低,那就二分吧!二分即上界为2单独的最大倍数与3单独时的最大倍数之和,下界为前面二者的max;之后利用判断是否mid/2 >= n && mid/3 >= m &am…
F. Group Projects   There are n students in a class working on group projects. The students will divide into groups (some students may be in groups alone), work on their independent pieces, and then discuss the results together. It takes the i-th stu…
题目链接:http://codeforces.com/contest/626/problem/C 题意就是给你n个分别拿着2的倍数积木的小朋友和m个分别拿着3的倍数积木的小朋友,每个小朋友拿着积木的数量互不相同,求小朋友中拿着最大积木数的最小的情况(有点绕). 那最坏的情况就是2n或者3m,假设最大的积木数为x,x肯定能被2或3整除,那么x/2就是2的倍数个数,x/3就是3的倍数的个数,x/6就是6的倍数的个数. 因为这个数据量很小,那么只要暴力寻找刚好符合x/3 + x/2 - x/6 >=…
G. Raffles 题目连接: http://www.codeforces.com/contest/626/problem/G Description Johnny is at a carnival which has n raffles. Raffle i has a prize with value pi. Each participant can put tickets in whichever raffles they choose (they may have more than o…
F. Group Projects 题目连接: http://www.codeforces.com/contest/626/problem/F Description There are n students in a class working on group projects. The students will divide into groups (some students may be in groups alone), work on their independent piec…
E. Simple Skewness 题目连接: http://www.codeforces.com/contest/626/problem/E Description Define the simple skewness of a collection of numbers to be the collection's mean minus its median. You are given a list of n (not necessarily distinct) integers. Fi…
D. Jerry's Protest 题目连接: http://www.codeforces.com/contest/626/problem/D Description Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds. In each round, Andrew and Jerry draw randomly without replaceme…
C. Block Towers 题目连接: http://www.codeforces.com/contest/626/problem/C Description Students in a class are making towers of blocks. Each student makes a (non-zero) tower by stacking pieces lengthwise on top of each other. n of the students use pieces…