submission error
Moderator: Board moderators
submission error
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?
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: submission error
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!
Re: submission error
Everyone is getting submission error on this problem for the last 22 days.
929 - Number Maze
929 - Number Maze
-@ce
-
- New poster
- Posts: 48
- Joined: Sat Apr 06, 2013 6:02 pm
Re: submission error
problem: 469
why getting submission error?? please help
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;
}
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: submission error
Info on submission errors: http://uva.onlinejudge.org/index.php?op ... 1&Itemid=1
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 48
- Joined: Sat Apr 06, 2013 6:02 pm
Re: submission error
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???
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: submission error
gets returns NULL if EOF is reached.
http://www.cplusplus.com/reference/cstdio/gets/
http://www.cplusplus.com/reference/cstdio/gets/
Check input and AC output for thousands of problems on uDebug!
-
- New poster
- Posts: 48
- Joined: Sat Apr 06, 2013 6:02 pm
Re: submission error
thank you, got ACbrianfry713 wrote:gets returns NULL if EOF is reached.
http://www.cplusplus.com/reference/cstdio/gets/
-
- System administrator
- Posts: 1286
- Joined: Sat Oct 13, 2001 2:00 am
- Location: Valladolid, Spain
- Contact:
Re: submission error
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.