POJ 3268 Silver Cow Party Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to b ...
分类:
编程语言 时间:
2017-07-24 22:22:41
阅读次数:
182
Catch That Cow Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100 ...
分类:
其他好文 时间:
2017-07-24 21:26:55
阅读次数:
170
POJ3660 Cow Contest 题目链接:http://poj.org/problem?id=3660 题意:农名约翰有些奶牛,约翰通过让他们决斗来决定他们的排名,约翰让这些奶牛一对一打完一定的局数之后,问有哪些奶牛的排名是可以确定的(注:a打得过b,b打得过c,则a打得c) 根据题意我们明 ...
分类:
编程语言 时间:
2017-07-24 00:15:08
阅读次数:
257
Description Farmer John is assigning some of his N (1 <= N <= 25,000) cows to do some cleaning chores around the barn. He always wants to have one cow ...
分类:
其他好文 时间:
2017-07-23 18:07:46
阅读次数:
149
题目大意: 有一些集合,求每个集合是多少个集合的真子集 思路: 树状数组 先按照右端点从大到小排序,这样只要考虑之前比它左端点小的出现过几次就可以了 模板题 #include<iostream> #include<cstdio> #include<cmath> #include<algorithm> ...
分类:
其他好文 时间:
2017-07-23 10:12:03
阅读次数:
160
Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 13987 Accepted: 4924 Case Time Limit: 1000MS Description Farmer John's cow ...
分类:
其他好文 时间:
2017-07-22 12:05:14
阅读次数:
196
从输出结果可以看到,通过for d in deck迭代的方式也能遍历整个_card数组。迭代器环境会先尝试__iter__方法,在尝试__getitem__.也就是如果对象不支持迭代协议,就会尝试索引运算。迭代环境是通过调用内置函数iter去尝试__iter__方法来实现的,这种方法返回一个迭代器对 ...
分类:
编程语言 时间:
2017-07-22 12:00:13
阅读次数:
173
Silver Cow Party Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 22580 Accepted: 10333 Description One cow from each of N farms (1 ≤ N ≤ 10 ...
分类:
其他好文 时间:
2017-07-21 17:22:27
阅读次数:
218
题目大意:给出一棵树。求两点间的最长距离。 思路:裸地树的直径。两次BFS,第一次随便找一个点宽搜。然后用上次宽搜时最远的点在宽搜。得到的最长距离就是树的直径。 CODE: #include <queue> #include <cstdio> #include <cstring> #include ...
分类:
其他好文 时间:
2017-07-21 15:48:31
阅读次数:
128
Recursive sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1323 Accepted Submission(s): 5 ...
分类:
其他好文 时间:
2017-07-21 01:29:25
阅读次数:
204