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

Run time error 呀,可是我在VC6.0里能算出结果呀,哪位高人帮忙看看

Posted by zhzm883 at 2006-08-11 08:01:21 on Problem 1088
#include"stdio.h"
#define N 10

main()
{
	int r, q;
	int i=0, j=0, a[100][100]={0}, i1, j1 ,j2, i2;
	int k=0, p=0, m=2, max=0, x=0, y=0;
	int b[N][N]={0}, c[100]={0}, d[100]={0};
	scanf("%d",&r);
	scanf("%d",&q); 
	for(i=0;i<r;i++)
		for(j=0;j<q;j++)
			scanf("%d",&a[i][j]);
	for(i2=0;i2<r;i2++)
	for(j2=0;j2<q;j2++)	
	{
		p=k=0;
		c[k]=i2;
		d[k++]=j2;
		b[i2][j2]=1;
	while(p!=k)
	{
		i=c[p];
		j=d[p++];
		if(a[i][j]<a[i-1][j]&&i-1>=0)
		{
			b[i-1][j]=b[i][j]+1;
			x=c[k]=i-1;
			y=d[k++]=j;
		}
		if(a[i][j]<a[i][j-1]&&j-1>=0)
		{
			b[i][j-1]=b[i][j]+1;
			x=c[k]=i;
			y=d[k++]=j-1;
		}
		if(a[i][j]<a[i+1][j])
		{
			b[i+1][j]=b[i][j]+1;
			x=c[k]=i+1;
			y=d[k++]=j;
		}
		if(a[i][j]<a[i][j+1])
		{
			b[i][j+1]=b[i][j]+1;
			x=c[k]=i;
			y=d[k++]=j+1;
		}
		k=k%100;
		p=p%100;
	}
		for(i1=0;i1<r;i1++)
		for(j1=0;j1<q;j1++)
		{if(max<b[i1][j1])
		max=b[i1][j1];}
	}
			printf("%d",max);
}

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