10152 - ShellSort
Moderator: Board moderators
-
- Guru
- Posts: 5947
- Joined: Thu Sep 01, 2011 9:09 am
- Location: San Jose, CA, USA
Re: 10152 - ShellSort
Don't print a blank line at the start of the output. Don't print a space on the blank lines.
Check input and AC output for thousands of problems on uDebug!
Re: 10152 - ShellSort _ WA with PC judge
if any one have interest in "programming-challenges.com" judge
do you have any idea what is wrong with it.
this is about the fifth problem for me that is accepted with uva and have "wrong answer" with PC judge
is the problem with that judge or the test cases are different which means that uva tests are weak or the problem is with the format (even they have the same description and samples)
any one who got it accepted there can share tips
or anyone know the problem !?
to submit http://www.programming-challenges.com/p ... bid=110407
&thanks
here's my code if needed
do you have any idea what is wrong with it.
this is about the fifth problem for me that is accepted with uva and have "wrong answer" with PC judge
is the problem with that judge or the test cases are different which means that uva tests are weak or the problem is with the format (even they have the same description and samples)
any one who got it accepted there can share tips
or anyone know the problem !?
to submit http://www.programming-challenges.com/p ... bid=110407
&thanks
here's my code if needed
Code: Select all
#define MAX 81
#define NMAX 200
/**/
#include <stdio.h>
#include <string.h>
/**/
int T,n,i,j;
char fr[NMAX][MAX],to[NMAX][MAX];
/**/
int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%d\n",&n);
for(i=0; i<n; i++)
gets(fr[i]);
for(i=0; i<n; i++)
gets(to[i]);
j=n-1;
for(i=n-1; i>=0; i--)
if(strcmp(fr[i],to[j]) == 0)
j--;
for(i=j; i>=0; i--)
printf("%s\n" , to[i]);
printf("\n");
}
return 0;
}
Re: 10152 - ShellSort
The following text is written here http://www.programming-challenges.com/pg.php?page=index
Welcome to Programming Challenges
This site is still in beta testing and several features are not yet completely stable. If you experience problems, please
(1) let us know by reporting them to revilla@mac.uva.es and
(2) test your submissions on the UVa Online Judge as well.
Some users have reported difficulties with Java, but C/C++ programs should work fairly reliably. Due to differences in compilers and operating systems, the two judges are not completely consistent, meaning that a program might get accepted by one judge but not the other. Do not feel too bad if the judge won't accept a program you are sure is correct, because it does not administer perfect justice. Do the best that you can and have fun with it!
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Re: 10152 - ShellSort
thanks Mr. lightedlighted wrote:The following text is written here http://www.programming-challenges.com/pg.php?page=index
![:)](./images/smilies/icon_smile.gif)