11734 - Big Number of Teams will Solve This

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

Moderator: Board moderators

nazmuldiu
New poster
Posts: 4
Joined: Wed Aug 05, 2009 6:05 pm

11734 - Big Number of Teams will Solve This

Post by nazmuldiu »

I did not find problem why this getting WA. Can any one please help?

Code: Select all

# include <stdio.h>
# include <string.h>
# include <ctype.h>

int main()
{
	int t,i;
	char team[25], judge[25],teamEdit[25];
	scanf("%d\n",&t);
	for(i=1;i<=t;i++)
	{
		gets(team);
		gets(judge);
		if(!strcmp(team,judge))	printf("Case %d: Yes\n",i);
		else
		{
			int j=0,k,lt=strlen(team);
			for(k=0;k<lt;k++)
			{
				if(!isspace(team[k]))
				{
					teamEdit[j]=team[k];
					j++;
				}
			}
			if(!strcmp(teamEdit,judge))	printf("Case %d: Output Format Error\n",i);
			else	printf("Case %d: Wrong Answer\n",i);
		}

	}
	return 0;
}

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11734 WA : (Big Number of Teams will Solve This)

Post by naseef_07cuet »

Just check this input:
n a s e ef
naseef
The output will be:
Output Format Error
but your program shows: Wrong Answer
Fix it.....Best of luck:)
If you have determination, you can do anything you want....:)

shaon_cse_cu08
New poster
Posts: 50
Joined: Tue May 25, 2010 9:10 am
Contact:

Re: 11734 - Big Number of Teams will Solve This

Post by shaon_cse_cu08 »

Can an1 help me with this problem..... Is there any critical "Input"?
I will be really Happy if i got AC in this prob..... :( :(

Code: Select all

#include<stdio.h>
#include<string.h>
int main()
{
	char tem[50],jug[21],bfr;

	int t,i,j,cas,tag,n1,n2;

	scanf("%d",&t);
	scanf("%c",&bfr);
	
	if(t>0&&t<20)
	for(cas=1;cas<=t;cas++)
	{

		gets(tem);
		gets(jug);

		n1=strlen(tem);
		n2=strlen(jug);


		tag=1;
		for(i=0,j=0;i<n2,j<n1;)
		{
			if(tem[j]!=' ')
			{
				if(tem[j]!=jug[i])
				{
					tag=0;
					printf("Case %d: Wrong Answer\n",cas);
					break;
				}
				
				i++;
				j++;
			}
			else
				j++;
		}

		if(tag==1&&n1!=n2)
			printf("Case %d: Output Format Error\n",cas);
		
		else if(tag==1&&n1==n2)
			printf("Case %d: Yes\n",cas);
		
	
	}
return 0;
}
I'll keep holding on...Until the walls come tumbling down...And freedom is all around ..... :x

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11734 - Big Number of Teams will Solve This

Post by naseef_07cuet »

try this:
1
naseeef
naseeeff

output should be :Case 1: Output Format Error
but your program shows : Case 1: Wrong Answer

and change " scanf("%c",&bfr);" this to "getchar();"

hope you will find the bug... :)

Best of luck :)
If you have determination, you can do anything you want....:)

shaon_cse_cu08
New poster
Posts: 50
Joined: Tue May 25, 2010 9:10 am
Contact:

Re: 11734 - Big Number of Teams will Solve This

Post by shaon_cse_cu08 »

output should be :Case 1: Output Format Error
but your program shows : Case 1: Wrong Answer
Naseef u r wrong bro...This case is Wrong ans..may be u dindn't follow the 1st part of the problem
The requirement in reality is the output must match character per character with that of the judges. Submitted runs that give additional spaces are given the verdict “Output Format Error”. If the output still mismatches after ignoring the spaces, it is given the verdict “Wrong Answer”. A verdict of “Yes” is given when the output matches exactly.
I tried dat programm differently and it works... See this code...
I'll keep holding on...Until the walls come tumbling down...And freedom is all around ..... :x

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11734 - Big Number of Teams will Solve This

Post by naseef_07cuet »

Sorry ...it Should be:-
try this:
1
naseeef
naseeeff

output should be :Case 1: Wrong Answer
but your program shows : Case 1: Output Format Error

and change " scanf("%c",&bfr);" this to "getchar();"

hope you will find the bug...

Best of luck
If you have determination, you can do anything you want....:)

MZA
New poster
Posts: 1
Joined: Sun Jan 16, 2011 8:22 am

Re: 11734 - Big Number of Teams will Solve This

Post by MZA »

11734 - Big Number of Teams will Solve This. I m getting WA. But cant get what is the problem.
Here is my code:

Code: Select all

#include<stdio.h>
#include<string.h>

int main()
{
	long t = 0;
	char AA[30],BB[30],*ans;
	int lenAA,lenBB;

	//freopen("Input.in","r",stdin);
	//freopen("Output.out","w",stdout);
	scanf("%d",&t);

	for(long i = 1; i<=t;i++)
	{
		scanf("  %[^\n]s ",AA);
		scanf("  %[^\n]s ",BB);
		lenAA = strlen(AA);
		lenBB = strlen(BB);
		lenAA = lenAA>lenBB ? lenAA : lenBB;
		ans = "Yes";
		for(long j = 0; j<lenAA;j++)
		{
			if(AA[j] == ' ')
			{
				ans = "Output Format Error";
				break;
			}
			if(AA[j] != BB[j])
			{
				ans = "Wrong Answer";
				break;
			}
		}
		
		printf("Case %d: %s\n",i,ans);
		
	}
	return 0;
}

Could any 1 pls help me?

naseef_07cuet
Learning poster
Posts: 62
Joined: Sat Nov 21, 2009 10:17 pm
Location: CUET,Chittagong,Bangladesh

Re: 11734 - Big Number of Teams will Solve This

Post by naseef_07cuet »

Take a getchar() after taking the input of t.....hope you will get it...
If you have determination, you can do anything you want....:)

puzzlemusa
New poster
Posts: 1
Joined: Wed May 11, 2011 10:24 am

11734 - Big Number of Teams will Solve This Plz help me.

Post by puzzlemusa »

i'm getting wa FOR this code
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
int n,c=1;
char user[100],jud[100];
cin>>n;
while (c<=n)
{
int i,j=0,x,l;
gets(user);
gets(user);
cin>>jud;
l=strcmp(user,jud);
if (l==0)
cout<<"Case "<<c<<": Yes\n";
else
{
for (i=0;user!=NULL;i++)
{
if (user==32)
{
x=0;
continue;
}
if (user!=jud[j] || strlen(jud)>strlen(user))
{
cout<<"Case "<<c<<": Wrong Answer\n";
x=1;
break;
}
j++;
}
if (x==0)
cout<<"Case "<<c<<": Out Format Error\n";
}
c++;
}
return 0;
}

Shafaet_du
Experienced poster
Posts: 147
Joined: Mon Jun 07, 2010 11:43 am
Location: University Of Dhaka,Bangladesh
Contact:

Re: 11734 - Big Number of Teams will Solve This

Post by Shafaet_du »

be careful about blank spaces

Gabrielwer
New poster
Posts: 6
Joined: Thu Sep 08, 2011 12:27 pm

Re: 11734 - Big Number of Teams will Solve This

Post by Gabrielwer »

Unfortunatelly blank spaces, dashes, commas spy phone so frequent problems of us all :( ..

cse.mehedi
New poster
Posts: 36
Joined: Sun Mar 18, 2012 8:18 am

11734 why WA???

Post by cse.mehedi »

Plz, help me!! :(

Code: Select all

Removed after AC
Last edited by cse.mehedi on Tue Apr 03, 2012 3:24 am, edited 2 times in total.

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

Re: 11734 why WA???

Post by brianfry713 »

Doesn't match the sample I/O.
Check input and AC output for thousands of problems on uDebug!

cse.mehedi
New poster
Posts: 36
Joined: Sun Mar 18, 2012 8:18 am

Re: 11734 why WA???

Post by cse.mehedi »

I have changed but again WA! :(

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

Re: 11734 why WA???

Post by brianfry713 »

Input

Code: Select all

1
no spac        please
nospaceplease
AC output:

Code: Select all

Case 1: Wrong Answer
Check input and AC output for thousands of problems on uDebug!

Post Reply

Return to “Volume 117 (11700-11799)”