摘要:
题目链接这个题,错了10+,不过还是挺值得的,发现了两个我的Floyd模版的两个问题,一个是初始化的数必须绝对的大,然后就是在判断句的时候if(p[i][j] > p[i][k] + p[k][j] && p[i][k] != N && p[k][j] != N) 以前不注意不写后边的两个&&,做这个题,发现在数据很大的时候会出错。。。血的教训啊。。。以后写Floyd一定要注意。。。。和AC代码 一句一句的比对啊。。。。 1 #include <stdio.h> 2 #include <string.h> 3 #in 阅读全文
posted @ 2012-06-30 19:58
Naix_x
阅读(152)
评论(0)
推荐(0)
摘要:
题目链接自己英语阅读能力下降了,还是题目描述的不清楚啊,太郁闷了,多组,用字符串,没了。。 1 #include <stdio.h> 2 #include <string.h> 3 char s[10010]={'\0'}; 4 int n,len; 5 int main() 6 { 7 while(scanf("%d\n",&n)!=EOF) 8 { 9 while(n--)10 {11 scanf("%s",s);12 len = strlen(s);13 if(strcmp("1... 阅读全文
posted @ 2012-06-30 16:53
Naix_x
阅读(206)
评论(0)
推荐(0)
摘要:
题目链接赤裸裸的并查集,搞不懂为什么POJ计划里,会用分治做。。 1 #include <stdio.h> 2 #include <string.h> 3 #define N 50001 4 int o[N]; 5 int find(int x) 6 { 7 int r,t; 8 r = x; 9 while(x != o[x])10 x = o[x];11 while(r != x)12 {13 t = o[r];14 o[r] = x;15 r = t;16 }17 return... 阅读全文
posted @ 2012-06-30 15:54
Naix_x
阅读(157)
评论(0)
推荐(0)

浙公网安备 33010602011771号