做道题,并没有太多的技巧,关键在与对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. NodeJS错误-throw er; // Unhandled 'error' event

    第一眼看以为Express版本出现问题,因为本地已经存在另外一个运行的Node项目,端口重复,修改一下端口号即可,错误提示如下: events.js:85 throw er; // Unhandled ...

  2. ElasticSearch客户端注解使用介绍

    The best elasticsearch highlevel java rest api-----bboss 1.ElasticSearch客户端bboss提供了一系列注解 @ESId  用于标识 ...

  3. UML图中聚合、组合、关联、依赖、泛化的强弱关系

    一.泛化 1.说明 泛化是一种继承关系,如果一个类A的所有属性和操作能被另一个类B所继承,则类B不仅可以包含自己独有的属性,而且可以包含类A的属性和操作.继承是类与类或者类与接口之间最常见的关系. 2 ...

  4. Linux源码包安装过程及注意事项

    众做周知RedHat Linux使用RPM包管理器安装rpm包,但是RPM包是由红帽编译打包的,通常相对于最新版落后了很多,甚至可能缺少我们所要使用的功能.如果你需要定制想要的软件功能.自定义安装路径 ...

  5. angularJs中$controller的使用

    $controller的使用 参考:https://stackoverflow.com/questions/27866620/can-someone-provide-a-use-case-for-th ...

  6. echarts文档对照

    echarts的各种配置项可以对照这个文档: https://echarts.baidu.com/echarts2/doc/option.html#title~tooltip.axisPointer. ...

  7. FPS游戏服务器设计的问题 【转】

    一.追溯 去gameloft笔试,有一个题目是说: 叫你去设计一个FPS(第一人称射击游戏),你是要用TCP呢还是要用UDP,说明理由 . 二.学习 这是两篇网上找到的文章,写非常不错. 当时笔试的时 ...

  8. Oracle中对数字加汉字的排序(完好)

    之前写过一篇 Oracle中对数字加汉字的排序以及REGEXP_SUBSTR介绍 后来在开发的过程中又遇到相似问题.数据不一样了,按之前的使用方法是不适用的. 之前的是数字在前汉字在后,最基本的差别是 ...

  9. php composer工具高速使用教程,超级简单

    php依赖管理工具.用于处理packages或者libraries.基于单个工程project,在project的vender目录下保存,默认永远不会全局安装. 须要php 5.3.2+,安装资源包时 ...

  10. VS2017安装或卸载错误1303

    为添加一个Python开发环境,运行Visual Studio Installer安装报错,下面是日志: 问题日志 安装出现问题. 可通过以下方式排查包故障问题: 1. 使用以下搜索 URL 来搜索针 ...