UVa 11734

From Algorithmist
Jump to navigation Jump to search

11734 - Big Number of Teams will Solve This[edit]

http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2834

Summary[edit]

Submitted runs that give additional spaces (Output matches with Judges output after ignoring the 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.

Explanation[edit]

1.If submitted output and judges output matches exactly i.e: strcmp(submitted output string,judges output string)==0 ,then program will print "Yes".

      • If not,then make a string from submitted output string ignoring spaces i.e:
           int j,k=0;
           for(j=0;j<(length of submitted output string);j++)
           {
               if((submitted_output_string[j]>='a'&&submitted_output_string[j]<='z')||(submitted_output_string[j]>='A'&&submitted_output_string[j]<='Z'))
               {
                   new_string[k]=submitted_output_string[j];
                   k++;
               }
           }
           new_string[k]='\0';

2.If new string and judges output matches exactly i.e: strcmp(new string,judges output string)==0 ,then program will print "Output Format Error".As the teams output consists of alphabets and spaces. The judges output consists of alphabets only. 3.If new string and judges output does not match exactly i.e: strcmp(submitted output string,judges output string)!=0 ,then program will print "Wrong Answer".

Gotchas[edit]

While using strcmp(*,*),ensure that string.h header file is present at your program.

Notes[edit]

This program is easy.Try to understand what is wanted from you.

Implementations[edit]

ad hoc, string manipulation.

Optimizations[edit]

Optimizations here.

Input[edit]

4
y e 
yes 
Casematters 
casematters 
no space please 
nospaceplease 
yess
yess

Output[edit]

Case 1: Wrong Answer 
Case 2: Wrong Answer 
Case 3: Output Format Error 
Case 4: Yes

Solutions[edit]

C++: http://codealltheproblems.blogspot.com/2015/04/uva-11734-big-number-of-teams-will.html