摘要: 题目:Stone原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=4764 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 int main() 8 { 9 int n,k;10 while(scanf("%d%d",&n,&k)==2)11 {12 if(n==0&&k==0)break;13 if((n-1)%(k+1)==0)printf("Jiang\n");1 阅读全文
posted @ 2013-09-28 22:10 EtheGreat 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题目:小希的迷宫原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1272分析:并查集的应用。判断有无环以及是否都在一个集合里即可! 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define maxn 100005 7 #define ll long long 8 #define inf 0x7fffffff 9 using namespace std;10 int fa[maxn],vis[maxn];11 void make_set()12 {13 for(int i... 阅读全文
posted @ 2013-09-28 21:29 EtheGreat 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 题目:Flyer原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=4768分析:二分。只需要注意到最多只有一个为奇数,则可以首先求出学生获得的总的传单数,为奇数时,二分找到答案。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 #define LL long long 8 #define maxn 20005 9 struct N10 {11 LL now,lim,add;12 }p[maxn];13 int n;14 int ma... 阅读全文
posted @ 2013-09-28 19:31 EtheGreat 阅读(266) 评论(0) 推荐(1) 编辑