做道题,并没有太多的技巧,关键在与对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. 理解SVG图片标签的viewport、viewBox、preserveAspectRatio缩放

    一.viewport 表示SVG可见区域的大小,或者可以想象成舞台大小,画布大小. <svg width="></svg> 上面的SVG代码定义了一个视区,宽500单 ...

  2. Eclipse 文件太长,导致着色异常问题

    1. 把C/C++ ->Editor->Scalability, 对应红框中的数字调大.

  3. SharePoint中Rating相关的字段。

      From: https://sharepoint.stackexchange.com/questions/194197/how-to-manipulate-likeby-nooflikes-rat ...

  4. MySQL查询当天、本周,本月,上一个月的数据

    QUARTER)); ; MONTH),'%Y-%m') select * from user where DATE_FORMAT(pudate,'%Y%m') = DATE_FORMAT(CURDA ...

  5. Linux网络编程:基于UDP的程序开发回顾篇

    基于无连接的UDP程序设计 同样,在开发基于UDP的应用程序时,其主要流程如下:   对于面向无连接的UDP应用程序在开发过程中服务端和客户端的操作流程基本差不多.对比面向连接的TCP程序,服务端少了 ...

  6. SqlServer和Mysql插入记录前判断是否存在,存在则插入,不存在则修改。

    SqlServer中是这样: ) ,@title,@searchKeys,@serviceIntervalSecond,@sleepMillisecondPerSearch) ELSE UPDATE ...

  7. vue重要特性

    重要特性 自定义input组件 动态组件 递归组件 slot 作用域slot 异步组件 内联模板 子组件索引 进阶 自定义指令 状态管理vuex 单文件组件 生产部署 路由 xxx

  8. 《简明Python教程》读书笔记

    1:help 需要获取Python中任何函数.类型的信息,使用   help('内容')   命令查看帮助,按  q  退出帮助. 2:格式化字符串 format 方法是数据格式化的重要方法. 字符串 ...

  9. 【Thinking in Java】读书笔记

    转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6480258.html 第三章:操作符 1:基本数据类型的比较用 ==.!=,引用类型的==.!=是针对地址的比 ...

  10. CUPS/Printer sharing

    https://wiki.archlinux.org/index.php/CUPS/Printer_sharing_(简体中文)   GNU/Linux系统间共享 在作为打印服务器的GNU/Linux ...