这题是黄巨大出的比赛题.http://poj.org/problem?id=3278DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediatel...
分类:
其他好文 时间:
2014-06-19 00:58:53
阅读次数:
510
POJ2388,题目链接http://poj.org/problem?id=2388题意:水题一道给定n个数,输出中间值,可以用sort,干脆快捷。代码://396K 32MS#include #include int buf[10000];int main(){ int cowsNum; scan...
分类:
其他好文 时间:
2014-06-18 23:53:01
阅读次数:
309
http://poj.org/problem?id=3254 1 #include 2 #include 3 #include 4 #define maxn 1000 5 using namespace std; 6 const int mod= 100000000; 7 8 int dp[...
分类:
其他好文 时间:
2014-06-18 23:48:54
阅读次数:
374
POJ2299,题目链接http://poj.org/problem?id=2299题意:给出长度为n的序列,每次只能交换相邻的两个元素,问至少要交换几次才使得该序列为递增序列。思路:其实就是求逆序数,那么直接向到的就是冒泡了,交换一次,记录一次即可。但是n的范围达到50W,冒泡O(n^2)的复杂度...
分类:
其他好文 时间:
2014-06-18 23:21:12
阅读次数:
214
Problem DescriptionTeacher HU and his 40 students were trapped by the brigands. To show their power, the head of the brigands want to select one peopl...
分类:
其他好文 时间:
2014-06-17 00:28:32
阅读次数:
362
http://poj.org/problem?id=2411这道题用2进制表示1表示放0表示不放。第i行与第i-1行有关。枚举i-1行的每个状态,推出由此状态能达到的i行状态。 1 #include 2 #include 3 #include 4 #define maxn 500 5 #def...
分类:
其他好文 时间:
2014-06-17 00:20:14
阅读次数:
432
Bone Collector
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 27413 Accepted Submission(s): 11154
Problem Description
Many years ag...
分类:
其他好文 时间:
2014-06-15 13:28:47
阅读次数:
142
I NEED A OFFER!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 15266 Accepted Submission(s): 6031
Problem Description
Speakless很早就想...
分类:
其他好文 时间:
2014-06-15 12:14:45
阅读次数:
204
Problem Description
In a factory, there are N workers to finish two types of tasks (A and B). Each type has N tasks. Each task of type A needs xi time to finish, and each task of type B needs yj ti...
分类:
其他好文 时间:
2014-06-15 11:26:42
阅读次数:
195
Problem Description
输入一行数字,如果我们把这行数字中的‘5’都看成空格,那么就得到一行用空格分割的若干非负整数(可能有些整数以‘0’开头,这些头部的‘0’应该被忽略掉,除非这个整数就是由若干个‘0’组成的,这时这个整数就是0)。
你的任务是:对这些分割得到的整数,依从小到大的顺序排序输出。
Input
输入包含多组测试用例,每组输...
分类:
其他好文 时间:
2014-06-15 10:01:17
阅读次数:
195