摘要: Piggy-BankTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9526 Accepted Submission(s): 4803Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action... 阅读全文
posted @ 2014-02-15 22:15 偶尔会寂寞 阅读(1587) 评论(0) 推荐(1) 编辑
摘要: Common SubsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20061Accepted Submission(s): 8571Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another. 阅读全文
posted @ 2014-02-15 20:37 偶尔会寂寞 阅读(143) 评论(0) 推荐(0) 编辑
摘要: #define _CRT_SECURE_NO_DEPRECATE#include#include#include#define MAX 1100using namespace std;int perm1[MAX], perm2[MAX];bool used[MAX];void _permutation(int pos, int n){ if (pos == n){ for (int i = 0; i < n; i++) cout << perm2[i] << ","; cout << endl; return; } ... 阅读全文
posted @ 2014-02-15 20:13 偶尔会寂寞 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 神、上帝以及老天爷Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19549Accepted Submission(s): 8287Problem DescriptionHDU 2006'10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行了一个别开生面、奖品丰厚的抽奖活动,这个活动的具体要求是这样的:首先,所有参加晚会的人员都将一张写有自己名字的字条放入抽奖箱中;然后,待所有字条加入完毕,每人从箱中取一个字条;最 阅读全文
posted @ 2014-02-15 17:34 偶尔会寂寞 阅读(308) 评论(2) 推荐(0) 编辑
摘要: Bone CollectorTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 23977Accepted Submission(s): 9729Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such 阅读全文
posted @ 2014-02-15 15:01 偶尔会寂寞 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 常规用法:默认从大到小排列。#include#includeusing namespace std;priority_queueque;typedef pair P;int main(){ for (int i = 0; i #include#include//需要用到greaterusing namespace std;priority_queue, greater> que;typedef pair P;int main(){ for (int i = 0; i #includeusing namespace std;struct cmp{ bool operator()... 阅读全文
posted @ 2014-02-15 13:09 偶尔会寂寞 阅读(828) 评论(0) 推荐(0) 编辑
摘要: Fence RepairTime Limit:2000MSMemory Limit:65536KTotal Submissions:22196Accepted:7074DescriptionFarmer John wants to repair a small length of the fence around the pasture. He measures the fence and finds that he needsN(1 ≤N≤ 20,000) planks of wood, each having some integer lengthLi(1 ≤Li≤ 50,000) uni 阅读全文
posted @ 2014-02-15 12:26 偶尔会寂寞 阅读(368) 评论(0) 推荐(0) 编辑
摘要: Best Cow LineDescriptionFJ is about to take hisN(1 ≤N≤ 2,000) cows to the annual"Farmer of the Year" competition. In this contest every farmer arrange... 阅读全文
posted @ 2014-02-15 09:52 偶尔会寂寞 阅读(598) 评论(0) 推荐(0) 编辑