随笔分类 -  08ACM

POJ1161(并查集)
摘要:1、题目链接地址 http://poj.org/problem?id=11612、源代码#include using namespace std;int parent[30001];int suspect[30001]; int find(int x){ if(parent[x] == x) ... 阅读全文

posted @ 2014-08-16 22:27 BestNow 阅读(134) 评论(0) 推荐(0) 编辑

POJ1012(约瑟夫问题)
摘要:1、题目链接地址 http://poj.org/problem?id=1012 2k个人,前面k个是好人,后面k个是坏人,找一个数t,每数到第t时就去掉,使所有坏人在好人之前被杀掉。 思路:约瑟夫公式的应用。2、源代码#includeusing namespace std; int test(... 阅读全文

posted @ 2014-08-16 22:19 BestNow 阅读(404) 评论(0) 推荐(0) 编辑

POJ3624(背包问题)
摘要:1、题目链接地址 http://poj.org/problem?id=3624 2、源代码#includeusing namespace std;#define MAXN 3403 //物品的最大数量#define MAXM 12881 //重量的上限 int max(int x, int ... 阅读全文

posted @ 2014-08-16 21:38 BestNow 阅读(374) 评论(0) 推荐(0) 编辑

POJ1657
摘要:1、题目链接地址 http://poj.org/problem?id=1657 2、源代码#includeusing namespace std;int main(){ int T; cin >> T; while(T--) { char ... 阅读全文

posted @ 2014-08-16 21:25 BestNow 阅读(167) 评论(0) 推荐(0) 编辑

POJ1308
摘要:1、题目链接地址 http://poj.org/problem?id=13082、源代码#includeusing namespace std;#define MAXN 100int set[MAXN]; //set[]记录每个节点的父节点int FindSet(int x) //寻找x所在根的根... 阅读全文

posted @ 2014-08-16 20:59 BestNow 阅读(223) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示