题目链接:Codeforces 483B Friends and Presents
题目大意:要将1~v直间的数分配到两个集合中,第一个集合需要cnt1个数,第二个需要cnt2个数,第一个集合中的数
不能是x的倍数,同理第二个集合不能是y的倍数,两集合元素不能相同,问说v最小可以为多少。
解题思路:这题比第三题要难,想了有一会。二分答案,v,然后判断。
判断的时候只要分...
分类:
其他好文 时间:
2014-11-03 10:15:04
阅读次数:
172
DescriptionVasya has been playing Plane of Tanks with his friends the whole year. Now it is time to divide the participants into several categories de...
分类:
其他好文 时间:
2014-11-01 13:09:05
阅读次数:
258
最近一直在做 codeforces ,总觉得已经刷不动 BZOJ 了? ——真是弱喵你看连 Div.2 的 B 题都要谢谢题解,不是闲就是傻显然我没那么闲 ╮(╯_╰)╭我觉得这题的想法挺妙的~大意是你需要分别给 a 和 b cnt1 和 cnt2 个数字但是 a 不要被 x 整除的数 ,as we...
分类:
其他好文 时间:
2014-10-26 19:45:53
阅读次数:
154
题意:从1....v这些数中找到c1个数不能被x整除,c2个数不能被y整除! 并且这c1个数和这c2个数没有相同的!给定c1, c2, x, y, 求最小的v的值! 思路: 二分+容斥,二分找到v的值,那么s1 = v/x是能被x整除的个数 s2 = v/y是能被y整除数的个数,s3 = v/lc....
分类:
其他好文 时间:
2014-10-25 13:08:33
阅读次数:
143
Lambda在集合中的使用
列表的遍历
提起对于集合的遍历,恐怕下面的这种方式已经是一种思维定式了吧:
final ListString> friends = Arrays.asList("Brian", "Nate", "Neal", "Raju", "Sara", "Scott");
for(int i = 0; i friends.size(); i++) {
...
分类:
编程语言 时间:
2014-10-21 10:24:46
阅读次数:
405
DescriptionEdward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bough...
分类:
其他好文 时间:
2014-10-17 21:52:25
阅读次数:
312
Description
Lost and AekdyCoin are friends. They always play "number game"(A boring game based on number theory) together. We all know that AekdyCoin is the man called "nuclear weapon of FZU,descen...
分类:
其他好文 时间:
2014-10-17 15:38:24
阅读次数:
282
很水的并查集#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include ...
分类:
其他好文 时间:
2014-10-14 16:01:08
阅读次数:
192
Edward is the headmaster of Marjar University. He is enthusiastic about chess and often plays chess with his friends. What's more, he bought a large decorative chessboard with N rows
and M columns.
...
分类:
其他好文 时间:
2014-10-12 21:51:28
阅读次数:
382
介绍:需要美观打印时,可以使用textwrap模块来格式化要输出的文本,这个模块允许通过编程提高类似段落自动换行或填充特性等功能。1 创建实例数据1 sample_text = '''2 I’m very happy and I like to make friends with other...
分类:
其他好文 时间:
2014-10-10 04:10:53
阅读次数:
219