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

Post by brianfry713 » Tue Mar 19, 2013 11:53 pm

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

Post by fresher96 » Sun Oct 12, 2014 3:59 am

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: 585
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 10152 - ShellSort

Post by lighted » Mon Oct 13, 2014 4:52 pm

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

Post by fresher96 » Mon Oct 20, 2014 1:27 am

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

Post Reply

Return to “Volume 101 (10100-10199)”

Who is online

Users browsing this forum: No registered users and 1 guest