摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4715【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 #define N 1000151 8 9 int prim[N+10];10 int hash[1000000];11 int mark[1000010];12 int cjsb[1000010];13 int hash_cnt=0;14 int lowbit(int i)15 {16 return i&-i;17 }18 v... 阅读全文
posted @ 2013-09-09 22:00
crazy_apple
阅读(266)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4710【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 #define N 1000151 8 9 int prim[N+10];10 int hash[1000000];11 int mark[1000010];12 int cjsb[1000010];13 int hash_cnt=0;14 int lowbit(int i)15 {16 return i&-i;17 }18 v... 阅读全文
posted @ 2013-09-09 21:57
crazy_apple
阅读(271)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4707【题目大意】:Lin Ji 的宠物鼠丢了,在校园里寻找,已知Lin Ji 在0的位置,输入N D,N表示校园中点的个数,D表示宠物鼠不可能在距离D之内,接下来N-1行,输入x,y,表示x与y相邻,(相邻两点之间的距离为1,不相邻为inf),不存在环结构。【题解】:用邻接表存储树形结构,然后用DFS遍历图【code】: 1 #include 2 #include 3 #include 4 #include 5 6 using namespace std; 7 #define NN 100010 ... 阅读全文
posted @ 2013-09-09 21:23
crazy_apple
阅读(563)
评论(1)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4706【题目大意】: 用a-z排出N的形状,输出大小为3-10的N,如果超过z之后,重新从a开始下面是大小为3的N(其实这里的N是反的,呵呵)a ebdfc g大小为4的Nh ni mojl pk q【code】: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 char str[11][11][11]; 8 int cnt; 9 10 void solve(int id)11 {12 int n=id,i;13 ... 阅读全文
posted @ 2013-09-09 21:17
crazy_apple
阅读(300)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4712Hamming DistanceTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 797Accepted Submission(s): 284Problem Description(From wikipedia) For binary strings a and b the Hamming distance is equal to the number o 阅读全文
posted @ 2013-09-09 20:54
crazy_apple
阅读(647)
评论(0)
推荐(0)

浙公网安备 33010602011771号