2012年4月6日

poj 1573 模拟

摘要: 水题 1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 using namespace std; 5 6 int n,m; 7 8 bool out(int x,int y){if((x>=0 && x<n)&&(y>=0 && y<m))return 0;return 1;} 9 10 int main()11 {12 int start;13 bool visit[12][12];14 char c[ 阅读全文

posted @ 2012-04-06 17:02 Inpeace7 阅读(140) 评论(0) 推荐(0) 编辑

poj 2632 模拟

摘要: 模拟题,注意两点1.坐标2.L,R后边的数字是向左或向右转几次 1 #include <iostream> 2 #include <stdio.h> 3 #include <string.h> 4 using namespace std; 5 const int maxx=102; 6 int loc[maxx][maxx],a,b; //loc 地图第ij个位置是第几个机器人 7 char dir[maxx][maxx]; 8 struct OPE //操作 9 { 10 int ind; 11 char op; 12 ... 阅读全文

posted @ 2012-04-06 15:18 Inpeace7 阅读(194) 评论(0) 推荐(0) 编辑

poj 1068 模拟

摘要: 模拟能力太水,做了挺长时间还原括号数组,令r=1,num=0,从“(”向前扫,遇到“(”,r--,num++;遇到“)”r++,r为0是num即为解 1 #include <stdio.h> 2 #include <string.h> 3 int main() 4 { 5 int n,t,r,num,i,j,b[25]; 6 bool c[100]; 7 scanf("%d",&t); 8 for(int tt=1;tt<=t;tt++) 9 {10 memset(c,0,sizeof(c));11 scanf("%d&quo 阅读全文

posted @ 2012-04-06 09:36 Inpeace7 阅读(142) 评论(0) 推荐(0) 编辑

导航