## 10152 - ShellSort

All about problems in Volume 101. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

brianfry713
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!

fresher96
New poster
Posts: 25
Joined: Wed Sep 03, 2014 8:50 am

### 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

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;
}
``````

lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

### 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

fresher96
New poster
Posts: 25
Joined: Wed Sep 03, 2014 8:50 am

### Re: 10152 - ShellSort

lighted wrote:The following text is written here http://www.programming-challenges.com/pg.php?page=index
thanks Mr. lighted