2011年9月22日

ZOJ 2412 Farm Irrigation

摘要: 题目描述:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1412#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int maxn=50;int r[4]= {0,-1,0,1},c[4]= {1,0,-1,0};int A[3*maxn+10][3*maxn+10],ch[11][3][3];int ind[maxn+10][maxn+10];char s[maxn+10][m 阅读全文

posted @ 2011-09-22 21:47 _Clarence 阅读(126) 评论(0) 推荐(0) 编辑

ACM PKU 1979 Red and Black

摘要: 题目链接:http://poj.org/problem?id=1979突然发现今天刷水题的速度上来了,而且是刷一个AC一个,哈哈#include <iostream>#include <cstdio>#include <cstring>using namespace std;const int maxn=20;int W,H,ans,sx,sy;int r[4]= {0,-1,0,1},c[4]= {1,0,-1,0};char C[maxn+10][maxn+10];bool charge(int x,int y){ if(x<0||y<0|| 阅读全文

posted @ 2011-09-22 20:55 _Clarence 阅读(131) 评论(0) 推荐(0) 编辑

ACM PKU 1562 Oil Deposits

摘要: 题目链接:http://poj.org/problem?id=1562这道题相当尴尬了,两个一样的程序换个输入就A了,改成一个个字母读入就wa了,不知道为什么,希望大家能指出错误之处,不胜感激;AC的代码:#include <iostream>#include <cstring>#include <cstdio>using namespace std;const int maxn=100;char ch[maxn+10][maxn+10];int r[8]= {0,-1,-1,-1,0,1,1,1},c[8]= {1,1,0,-1,-1,-1,0,1};in 阅读全文

posted @ 2011-09-22 20:27 _Clarence 阅读(128) 评论(0) 推荐(0) 编辑

ZOJ 2110 Tempter of the Bone

摘要: 题目描述:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2110这是在ZOJ上做的第一道题,题目倒不是很难,悲剧的是剪枝太多,我悲剧了两个晚上,今天终于做出来了,很高兴!贴一下我的代码,顺便奉上《图论算法理论应用与实践》上的解析代码供大家参考;我的代码:#include <iostream>#include <cstring>#include <cstdio>#include <cmath>using namespace std;int x,y,M,N,T,dx,dy;b 阅读全文

posted @ 2011-09-22 19:30 _Clarence 阅读(149) 评论(0) 推荐(0) 编辑

导航