摘要: 比赛链接:http://soj.me/contest_detail.php?cid=775Problem10001000. Bridges and Tunnels Total:54Accepted:11Time Limit: 3sec Memory Limit:256MB DescriptionIt may feel warm now, but in a few months,the citywill be full of snow. Luckily, many of the buildings on campus are connected by bridges and tunnels, . 阅读全文
posted @ 2012-11-24 22:46 java程序员-c 阅读(334) 评论(0) 推荐(0) 编辑
摘要: 放苹果Time Limit:1000MSMemory Limit:10000KTotal Submissions:21860Accepted:13944Description把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。Input第一行是测试数据的数目t(0 #include#includeusing namespace std;int dfs(int n,int m){ if(m==1) return 1; if(n==0) return 1; if(n>)所有不同的摆放方法可以分为两类:至少有一个 阅读全文
posted @ 2012-11-24 17:30 java程序员-c 阅读(232) 评论(0) 推荐(0) 编辑
摘要: The Bottom of a GraphTime Limit:3000MSMemory Limit:65536KTotal Submissions:7005Accepted:2871DescriptionWe will use the following (standard) definitions from graph theory. LetVbe a nonempty and finite set, its elements being called vertices (or nodes). LetEbe a subset of the Cartesian productV×V 阅读全文
posted @ 2012-11-24 15:30 java程序员-c 阅读(128) 评论(0) 推荐(0) 编辑
摘要: RelativesTime Limit:1000MSMemory Limit:65536KTotal Submissions:9411Accepted:4453DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a = xy a 阅读全文
posted @ 2012-11-24 10:25 java程序员-c 阅读(126) 评论(0) 推荐(0) 编辑
摘要: Primitive RootsTime Limit:1000MSMemory Limit:10000KTotal Submissions:2159Accepted:1194DescriptionWe say that integer x, 0 #include#include#includeusing namespace std;#define MAX 65550int prime[MAX];bool flag[MAX];int ct;void pre(){ memset(flag,0,sizeof(flag)); int i,j; flag[1]=1; ct=0; for(i=2;i*i1) 阅读全文
posted @ 2012-11-24 10:05 java程序员-c 阅读(257) 评论(0) 推荐(0) 编辑