Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

太假了,1000ms刚过,不可能有比我更慢的了

Posted by TSERROF at 2012-08-07 15:34:11 on Problem 2019
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator