摘要: View Code 1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 5 char map[14][7]; 6 bool isw[14][7]; 7 bool f; 8 char newc[3]; 9 int m; 10 int dir[8][8]={ 11 {0,-1},{0,1},{-1,-1},{1,1}, 12 {-1,0},{1,0},{-1,1},{1,-1} 13 }; 14 15 void addnew() 16 { 17 ... 阅读全文
posted @ 2012-04-02 19:58 知行执行 阅读(8232) 评论(0) 推荐(0) 编辑
摘要: View Code 1 /* 2 这是一个贪心问题: 3 以岛屿为圆心,以雷达半径为半径画圆 和 X轴有两个交点 这就是说在这个范围内安装雷达都可以覆盖到 4 此岛屿 5 我们求出所有的这样的 区域 然后以左边界从小到大排列,左边界相同的 按右边界 从 大到小排列 6 7 我们只需关心 下一个范围十分 在 tr 左边 8 特别要注意的是 更新 tr 时 取得时 老 tr 和 新区域 右边界 r 两者的最小值 9 */10 #include<iostream>11 #include<algorithm>12 #include<cmath>13 using na 阅读全文
posted @ 2012-04-02 16:26 知行执行 阅读(236) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<stdio.h> 2 #include<stdlib.h> 3 4 int T[1001]; 5 int K[1001]; 6 7 int cmp(const void *x,const void *y) 8 { 9 int *m = (int *)x;10 int *n = (int *)y;11 return *m-*n;12 }13 14 int main()15 {16 int i,t;17 while(scanf("%d",&t) != EOF)18 {19 for(i=0;i<t;+ 阅读全文
posted @ 2012-04-02 12:52 知行执行 阅读(248) 评论(0) 推荐(0) 编辑
摘要: //10的8次方对 10003 mod 是 9 这是为什么要 乘以9了View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 5 char a[1000001]; 6 7 int main() 8 { 9 int t,zero,sum;10 int num,len,i;11 scanf("%d",&t);12 while(t--)13 {14 scanf("%s",a);15 sum=0;16 zero = 1;17 l 阅读全文
posted @ 2012-04-02 10:52 知行执行 阅读(218) 评论(0) 推荐(0) 编辑