摘要: http://pat.zju.edu.cn/contests/pat-practise/1008 1 #include <stdio.h> 2 int number[102]; 3 int main() 4 { 5 int N; 6 scanf("%d",&N); 7 int i; 8 for(i=0;i<N;i++) 9 scanf("%d",&number[i]);10 int sum=0;11 sum+=6*number[0];12 for(i=... 阅读全文
posted @ 2011-10-09 12:11 linyvxiang 阅读(173) 评论(0) 推荐(0) 编辑
摘要: http://pat.zju.edu.cn/contests/pat-practise/1013本来以为会卡时间,偷懒没用并查集,没想到DFS就过了。不过第一次访问标志重置时居然重置的1。。。PS:想起了扫雷游戏中的蒙板数组。。。用一下,其实不用也行的 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 int map[1002][1002]={0}; 5 int tem_map[1002][1002]={0}; 6 bool visit[1002]={false}; 7 bo 阅读全文
posted @ 2011-10-09 10:53 linyvxiang 阅读(509) 评论(0) 推荐(0) 编辑
摘要: http://pat.zju.edu.cn/contests/pat-practise/1011示例数据是错的。。。 1 #include <stdio.h> 2 double mat[3][3]={0}; 3 char map[]={'W','T','L'}; 4 int main() 5 { 6 int i,j; 7 for(i=0;i<3;i++) 8 for(j=0;j<3;j++) 9 scanf("%lf",&mat[i][j]);10 int pos[3];11 for(i=0;i 阅读全文
posted @ 2011-10-09 10:10 linyvxiang 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <string.h> 3 #define MAX_NUM 0x7fffffff 4 typedef struct Stu{ 5 char ID[10]; 6 double score[4]; 7 int best_rank; 8 int best_course; 9 }Stu;10 Stu stu[1000000];11 int N,M;12 char map[]={'C','M','E','A'};13 int main()14 {15 in 阅读全文
posted @ 2011-10-09 09:49 linyvxiang 阅读(335) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <string.h>#define MAX_NUM 0x7ffffffftypedef struct Stu{ char ID[10]; double score[4]; int best_rank; int best_course;}Stu;Stu stu[1000000];int N,M;char map[]={'C','M','E','A'};int main(){ int i; scanf("%d%d",&N,& 阅读全文
posted @ 2011-10-09 09:47 linyvxiang 阅读(130) 评论(0) 推荐(0) 编辑