#include<iostream> using namespace std; int mod[20]={1,1,2,6,4,2,2,4,2,8,4,4,8,4,6,8,8,6,8,2}; char s[1010]; //字符串 int num[1010]; //转换为数字 int sovle() { int len,i,c,ans; len=strlen(s); ans=1; for(i=0;i<len;i++) num[i]=s[len-i-1]-'0'; while(len) {…
Ignatius and the Princess III Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11810 Accepted Submission(s): 8362 Problem Description "Well, it seems the first problem is too easy. I will let…
敌兵布阵 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 37903 Accepted Submission(s): 15985 Problem Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了.A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务…
Is It A Tree? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6961 Accepted Submission(s): 1619 [题目链接]http://acm.hdu.edu.cn/showproblem.php?pid=1325 这题如果用并查集做的话,最后判断的时候还是要看一个结点的入度是否为大于1(纯并查集的…
Bus System Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5190 Accepted Submission(s): 1275 [题目链接]http://acm.hdu.edu.cn/showproblem.php?pid=1690 [解题思路]SPFA求最短路径问题,将每个站之间的距离转化为相应的价格从而建立两站点相连的…
Free DIY Tour Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2735 Accepted Submission(s): 889 [题目链接]http://acm.hdu.edu.cn/showproblem.php?pid=1224 [题目意思]题目是说给你一个有环的图,结点之间有路径,每个结点都有个兴趣值,现在给你起…