Online Judge
Problem Description
Ignatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user's result file, then the system compare the two files. If the two files are absolutly same, then the Judge System return "Accepted", else if the only differences between the two files are spaces(' '), tabs(' '), or enters('
'), the Judge System should return "Presentation Error", else the system will return "Wrong Answer".
Given the data of correct output file and the data of user's result file, your task is to determine which result the Judge System will return.
Input
The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
Each test case has two parts, the data of correct output file and the data of the user's result file. Both of them are starts with a single line contains a string "START" and end with a single line contains a string "END", these two strings are not the data. In other words, the data is between the two strings. The data will at most 5000 characters.
Output
For each test cases, you should output the the result Judge System should return.
Sample Input
Sample Output
Presentation Error
Presentation Error
Wrong Answer
Presentation Error
// 挺好的题,想了一阵,没想到好的方法,看了kuangbin大神的思路,很强, 把' '当字符加进去,再把实际数据分理出来,比较,是个很好的方法
还是太菜啊,继续刷题!!!
1 #include <bits/stdc++.h> 2 using namespace std; 3 #define MX 5005 4 5 char s1[MX],s2[MX]; 6 char data1[MX],data2[MX]; 7 char tmp[MX]; 8 9 void input(char *a,char *b) 10 { 11 gets(tmp); 12 while (gets(tmp)) 13 { 14 if (strcmp(tmp,"END")==0) break; 15 strcat(a,tmp); 16 strcat(a," "); 17 } 18 int t=0; 19 int len = strlen(a); 20 for (int i=0;i<len;i++) 21 { 22 if (a[i]!=' '&&a[i]!=' '&&a[i]!=' ') 23 b[t++]=a[i]; 24 } 25 b[t++]='