Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
太假了,1000ms刚过,不可能有比我更慢的了#include <cstdio> int map[251][251]; int main() { int n,b,k; scanf("%d%d%d",&n,&b,&k); char ch; for (int i=1;i!=n+1;++i) { ch=getchar(); for (int j=1;j!=n+1;++j) scanf("%d",&map[i][j]); } for (int i=0;i!=k;++i) { int x,y; scanf("%d%d",&x,&y); int Min=map[x][y]; int Max=map[x][y]; for (int ii=x;ii!=x+b;++ii) { for (int jj=y;jj!=y+b;++jj) { if(Min>map[ii][jj])Min=map[ii][jj]; if(Max<map[ii][jj])Max=map[ii][jj]; } } // printf("max=%d min=%d\n",Max,Min); printf("%d\n",Max-Min); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator