上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 99 下一页

2011年7月20日

考试排名

摘要: 模拟题啊,wa了好几次,原来是没有看清题意,悲剧啊。。不过做模拟题还是有意思啊。。还有通过这道题发现自己真的不太擅长字符串处理,开始搞错了,最后为了出错,写得代码有点多。。#include <stdio.h>#include <string.h>#include <stdlib.h>#include <ctype.h>struct node { int ac; char name[40]; int sum;}T[1010];char mark1[10],mark2[10];int x;int find ( char *s ){ int i, k 阅读全文

posted @ 2011-07-20 11:10 more think, more gains 阅读(179) 评论(0) 推荐(0)

产生冠军

摘要: 这题处理下字符串,判断下入度为零的点就可以了。。#include <stdio.h>#include <string.h>#include <stdlib.h>char name[2011][100];char str1[100],str2[100];//int map[2021][2211];int dp[2022];int N, M, flag;int find( char *s ,int x){ int i; for ( i = 0; i < x; i++) if(strcmp(s,name[i]) == 0) return i; return 阅读全文

posted @ 2011-07-20 11:04 more think, more gains 阅读(190) 评论(0) 推荐(0)

确定比赛名次 最简单的拓朴排序

摘要: #include <stdio.h>#include <string.h>#include <stdlib.h>#include <stack>using namespace std;int N, M, dp[510], visit[510];int map[510][510]; int main( ){ int i, j, a, b, t, flag, k; while (scanf("%d%d", &N, &M) != EOF) { flag = 0; k = 0; stack<int>q; m 阅读全文

posted @ 2011-07-20 11:00 more think, more gains 阅读(259) 评论(0) 推荐(0)

reward

摘要: 关键点是每一次点度数减1后,要即时更新其奖金值。。 用邻接矩阵写超时,学了下用STL vector写邻接表。用stl真的非常方便但是非常要时间啊 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <vector> 5 #include <stack> 6 7 using namespace std; 8 9 int N, M, i, j ,t1, t2, sum ,l, a, b;10 int dp[10010],exp[10010] 阅读全文

posted @ 2011-07-20 10:59 more think, more gains 阅读(241) 评论(0) 推荐(0)

Legal or Not

摘要: //用邻接矩阵写的,加 stl 栈,自己写栈也好简单的,直接开个数组,一个指针就可以了。。用stl太废时间了。//有些题目很容易超时 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <stack> 5 using namespace std; 6 7 int N, M, dp[110], visit[510]; 8 9 int map[110][110];10 11 int main( )12 {13 int i, j, a, b, t, fl 阅读全文

posted @ 2011-07-20 10:55 more think, more gains 阅读(214) 评论(0) 推荐(0)

上一页 1 ··· 54 55 56 57 58 59 60 61 62 ··· 99 下一页

导航