做道题,并没有太多的技巧,关键在与对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. 文本分类需要CNN?No!fastText完美解决你的需求(后篇)

    http://blog.csdn.net/weixin_36604953/article/details/78324834 想必通过前一篇的介绍,各位小主已经对word2vec以及CBOW和Skip- ...

  2. linux下性能分析命令[总结]

    1.前言 在linux下开发程序,为了追求高性能,经常需要测试程序的性能,包括cpu.内存.io.网络等等使用情况.liunx下提供了众多命令方便查看各种资源的使用情况.经常用的有ps.top.fre ...

  3. (转)unityshaderLab中fixed function常用指令

    ShaderLab中常用的fixedFunction. SubShader{ Tags{"Queue"="Transparent"} //渲染完不透明物体,再渲 ...

  4. Excel长数字防止转换为科学计数法

    网上的一个方法是,加单引号,但是不好看. 我的处理,是先加,再替换成带格式的. strTable = Formater.SimpleTable(dt, "aaa", "| ...

  5. "Ext 4.1 Grid 'el.dom' 为空或不是对象"问题的解决

    我在使用Ext 4.1 做Grid,IE下冒出这么个错误,导致表格完全显示不出来,换另外一个IE浏览器,有没有问题,呵呵,百思不得其解啊... 后来得出答案,即在grid相关代码周围套上Ext.onR ...

  6. Log4j 2.0在开发中的高级使用具体解释—介绍篇(一)

    Log4j最终迎来了首个apache版本号.Log4j 2 是 Log4j 的升级版本号,该版本号比起其前任来说有着显著的改进,包括非常多在 Logback 中的改进以及Logback 架构中存在的问 ...

  7. js escape 与php escape

    javascript有编码函数escape()和对应的解码函数unescape(),而php中只有个urlencode和urldecode,这个编码和解码函数对encodeURI和encodeURIC ...

  8. 轻松python文本专题-字符与字符值转换

    场景: 将字符转换成ascii或者unicode编码 在转换过程中,注意使用ord和chr方法 >>> print(ord('a')) 97 >>> print(c ...

  9. JavaScript 之 ScriptManager.RegisterStartupScript的应用

    如果页面中不用Ajax,cs中运行某段js代码方式可以是: Page.ClientScript.RegisterStartupScript(Page.GetType(), "", ...

  10. Fiber Channel SAN Storage

    http://www.infotechguyz.com/VMware/FiberChannelSANStorage.html Using Fibre Channel with ESX/ESXi Fib ...