submission error

The forum to report every bug you find or tell us what you'd like to find in UVa OJ's new system

Moderator: Board moderators

Locked
_iojw
New poster
Posts: 1
Joined: Wed Feb 27, 2013 5:55 pm

submission error

Post by _iojw » Wed Feb 27, 2013 6:00 pm

I'm trying to submit code for UVa 469 - Wetlands of Florida. I'm fairly certain that my code outputs the correct answer however I get submission error whenever I submit it. The site spends a few minutes on Running then it becomes submission error. To my knowledge, submission error means that the problem isn't with my program but with the site. I recently changed my username if it matters, around a day ago. My new username is iojw (id 214488). Could anyone tell me what is wrong?

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: submission error

Post by brianfry713 » Wed Feb 27, 2013 11:15 pm

That seems to show up in some problems. It could be an issue with your code, maybe a TLE.
Check input and AC output for thousands of problems on uDebug!

User avatar
@ce
Learning poster
Posts: 71
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: submission error

Post by @ce » Thu Jun 06, 2013 8:15 am

Everyone is getting submission error on this problem for the last 22 days.
929 - Number Maze
-@ce

triplemzim
New poster
Posts: 48
Joined: Sat Apr 06, 2013 6:02 pm

Re: submission error

Post by triplemzim » Tue Oct 15, 2013 9:06 am

problem: 469
why getting submission error?? please help

Code: Select all

#include<iostream>
#include<cstdio>
#include<cstring>
#include<stdlib.h>


using namespace std;

char cell[100][100];
int length[100],result[10010];
int color[100][100];
int r,s;

int get_len(int i,int j)
{

	if(i>r || j>=length[i] || i<0 || j<0) return 0;

	if(color[i][j]!=0) return 0;
	if(cell[i][j]=='L') return 0;

	color[i][j]=s;

	int count=1;

	count+=get_len(i-1,j-1);
	count+=get_len(i-1,j);
	count+=get_len(i-1,j+1);
	count+=get_len(i,j-1);
	count+=get_len(i,j+1);
	count+=get_len(i+1,j-1);
	count+=get_len(i+1,j);
	count+=get_len(i+1,j+1);

	return count;

}

int main()
{

memset(length,0,sizeof(length));
	int cases;
	bool blank=false;

	scanf("%d",&cases);
	getchar();
	getchar();
	while(cases--)
	{
		if(blank) printf("\n");
		else blank=true;
		memset(color,0,sizeof(color));

		int row=0;
		gets(cell[row]);

		while(cell[row][0]=='L' || cell[row][0]=='W')
		{
			length[row]=strlen(cell[row]);
			row++;
			gets(cell[row]);

		}
		r=row-1;
		int i=0,j=0;
		s=0;
		while(strlen(cell[row])!=0)
		{
			bool flag=false;
			for(int k=0;k<strlen(cell[row]);k++)
			{
				if(cell[row][k]==' ')
				{
					flag=true;
					continue;
				}
				if(flag)
				{
					j=j*10+ (int)cell[row][k]-48;
				}
				else
				{
					i=i*10+(int)cell[row][k]-48;
				}
			}
			i--;j--;

			if(color[i][j]!=0)
			{
				printf("%d\n",result[color[i][j]]);
			}
			else
			{
				s++;
				result[s]=get_len(i,j);
				cout<<result[s]<<endl;
			}
			i=0;j=0;
			gets(cell[row]);
		}

	}

	return 0;
}

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: submission error

Post by brianfry713 » Tue Oct 15, 2013 8:15 pm

Check input and AC output for thousands of problems on uDebug!

triplemzim
New poster
Posts: 48
Joined: Sat Apr 06, 2013 6:02 pm

Re: submission error

Post by triplemzim » Tue Oct 22, 2013 10:06 am

Most probably there won't be any blank line after the last input (for the above problem 469), but my program is not ending without getting that blank line so can you please tell me that how can i decide that this is the last input and terminate my program???

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: submission error

Post by brianfry713 » Tue Oct 22, 2013 8:41 pm

gets returns NULL if EOF is reached.
http://www.cplusplus.com/reference/cstdio/gets/
Check input and AC output for thousands of problems on uDebug!

triplemzim
New poster
Posts: 48
Joined: Sat Apr 06, 2013 6:02 pm

Re: submission error

Post by triplemzim » Wed Oct 23, 2013 9:54 pm

brianfry713 wrote:gets returns NULL if EOF is reached.
http://www.cplusplus.com/reference/cstdio/gets/
thank you, got AC

User avatar
Carlos
System administrator
Posts: 1286
Joined: Sat Oct 13, 2001 2:00 am
Location: Valladolid, Spain
Contact:

Re: submission error

Post by Carlos » Sat Jan 18, 2014 2:30 am

The problem with submission errors should be gone now. Should you have it occurring again, please send us the id of the subission via the "Contact us" form in the web.
DON'T PM ME --> For any doubt, suggestion or error reporting, please use the "Contact us" form in the web.

Locked

Return to “Bugs and suggestions”