做道题,并没有太多的技巧,关键在与对Accepted,presented error 和wa的判断,第一步如果两者完全一样,那么很定是AC了
,否则如果去掉多余换行,空格,制表后还有不同说明是数据 不同,就wa,如果相同就是pe了........

  

Online Judge

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4121    Accepted Submission(s): 1550

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('\t'), or enters('\n'), 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
4
START
1 + 2 = 3
END
START
1+2=3
END
START
1 + 2 = 3
END
START
1 + 2 = 3
END
START
1 + 2 = 3
END
START
1 + 2 = 4
END
START
1 + 2 = 3
 
END
START
1 + 2 = 3
END
 
Sample Output
Presentation Error
Presentation Error
Wrong Answer
Presentation Error

 #include<stdio.h>
#include<string.h>
#define MAX 5000
char s1[MAX+],s2[MAX+],temp[MAX+];
char rs1[MAX],rs2[MAX];
void input(char *s1)
{
int i=;
bool flag=false;
memset(temp,'\0',sizeof temp);
while(gets(temp),strcmp(temp,"END"))
{
if(flag!=true&&strcmp(temp,"START")==)
flag=true;
if(strcmp(temp,"START")!=&&flag==true)
{
if(*temp=='\0') *(s1+strlen(s1))='\n';
else strcat(s1,temp); }
}
}
void inst(char s[],char *rs)
{
int k=;
for(int i=;s[i]!='\0';i++)
{
if(s[i]!='\n'&&s[i]!='\t'&&s[i]!=' ')
{
*(rs+k++)=s[i];
}
}
}
int main()
{
int t;
scanf("%d",&t);
getchar();
while(t--)
{
memset(s1,'\0',sizeof s1);
memset(s2,'\0',sizeof s2);
memset(rs1,'\0',sizeof rs1);
memset(rs2,'\0',sizeof rs2);
input(s1);
input(s2);
if(strcmp(s1,s2)==)
puts("Accepted");
else
{
inst(s1,rs1);
inst(s2,rs2);
if(strcmp(rs1,rs2)==)
puts("Presentation Error");
else
puts("Wrong Answer");
} }
return ; }

hduoj1073--Online Judge的更多相关文章

  1. Gym 101102C---Bored Judge(区间最大值)

    题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...

  2. NOJ 1074 Hey Judge(DFS回溯)

    Problem 1074: Hey Judge Time Limits:  1000 MS   Memory Limits:  65536 KB 64-bit interger IO format: ...

  3. 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)

    转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...

  4. 九度 Online Judge 之《剑指 Offer》一书相关题目解答

    前段时间准备华为机试,正好之前看了一遍<剑指 Offer>,就在九度 Online Judge 上刷了书中的题目,使用的语言为 C++:只有3题没做,其他的都做了. 正如 Linus To ...

  5. UVa Online Judge 工具網站

    UVa Online Judge 工具網站   UVa中译题uHuntAlgorithmist Lucky貓的ACM園地,Lucky貓的 ACM 中譯題目 Mirror UVa Online Judg ...

  6. [swustoj 1021] Submissions of online judge

    Submissions of online judge(1021) 问题描述 An online judge is a system to test programs in programming c ...

  7. HDOJ/HDU 1073 Online Judge(字符串处理~)

    Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...

  8. write a macro to judge big endian or little endian

    Big endian means the most significant byte stores first in memory. int a=0x01020304, if the cpu is b ...

  9. UVA 489-- Hangman Judge(暴力串处理)

     Hangman Judge  In ``Hangman Judge,'' you are to write a program that judges a series of Hangman gam ...

  10. 杭州电子科技大学Online Judge 之 “确定比赛名次(ID1285)”解题报告

    杭州电子科技大学Online Judge 之 "确定比赛名次(ID1285)"解题报告 巧若拙(欢迎转载,但请注明出处:http://blog.csdn.net/qiaoruozh ...

随机推荐

  1. 实例游戏内存修改器----CUI版本模拟

    实现说明: 目标进程内存中很可能存在多个你要搜索的值, 所以在进行第一次搜索的时候, 要把搜索到的地址记录下来,然后让用户改变要搜索的值,再在记录的地址中搜索,直到搜索到的地址惟一为止.为此写两个辅助 ...

  2. 【Java】SAX解析characters 错误截取问题的解决

    SAX解析characters 错误截取问题的解决 SAX characters bug_百度搜索 SAX解析characters 错误截取问题的解决 - CSDN博客 [Android]SAX解析之 ...

  3. 【Spark】Spark-foreachRDD需要注意的问题

    Spark-foreachRDD需要注意的问题 dstream.foreachRDD_百度搜索 通过Spark Streaming的foreachRDD把处理后的数据写入外部存储系统中 - 吾心光明 ...

  4. Android Fragment的使用(转载)

    可以分为下面的几部分: 使用支持库 创建一个Fragment 创建一个动态UI 多个Fragment之间的通信 1.使用支持库 如果您的应用需要运行在3.0及以上的版本,可以忽略这部分内容. 如果您的 ...

  5. Spring(二十二):Spring 事务

    事务简介: 事务管理是企业级应用程序开发中必不可少的技术,用来确保数据的完整性和一致性. 事务就是一系列的动作,它们被当做一个单独的工作单元.这些动作要么全部完成,要么全部不起作用. 事务的是四个关键 ...

  6. Linux杀毒软件ClamAV初次体验

    1:官网 http://www.clamav.net 2:Ubuntu下安装ClamAV sudo apt-get update--更新系统 sudo apt-get install clamav-- ...

  7. Create root user on MongoDB

      db.createUser( { user: "user", pwd: "pass", roles: [ "root" ] } );   ...

  8. GitHub最新命令使用教程

    一.创建github仓库并提交代码 1.在github创建public仓库 2.会生成一个git地址 https://github.com/ae6623/Zebra.git 3.在本地打开命令,在文件 ...

  9. 在Excel中输入超过10的带圈数字

    通过改变字体,可以在excel中输入1-20的带圈数字.对于某些人这些还不够用,那怎么办呢? 有了下面这个不知道是哪个大神做的字体,你就可以直接输到100啦 将字体文件文件粘贴至“C:\WINDOWS ...

  10. iOS编程(双语版) - 视图 - Transform(转换)

    视图有一个transform属性,它描述了应该如何绘制该视图. 该属性是CGAffineTransform结构体,它代表了3 x 3的变换矩阵(线性代数). 下面的代码让两个矩形视图旋转45度 (Ob ...