HDU1073:Online Judge

时间:2022-09-24 15:10:32
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
 
 
//开始怀疑自己的智商了
//'\t'水平制表(跳到下一个tab位置)
 
#include <iostream>
#include <cstring>
#include <cstdio>
using namespace std; int main()
{
char data1[],ch[],data2[],p1[],p2[];
int t;
cin>>t;
getchar();
while(t--)
{
memset(data1,,sizeof(data1));
memset(data2,,sizeof(data2));
while(gets(ch))
{
if(strcmp(ch,"\0")==)
{ch[]=' ';
ch[]='\0';}
strcat(data1,ch);
if(strcmp(ch,"END")==)
break;
}
while(gets(ch))
{
if(strcmp(ch,"\0")==)
{ch[]=' ';
ch[]='\0';}
strcat(data2,ch);
if(strcmp(ch,"END")==)
break;
}
//cout<<data1<<endl;
//cout<<data2<<endl;
if(strcmp(data1,data2)==)
cout<<"Accepted"<<endl;
else
{
int j,k;
j=;k=;
for(int i=;i<strlen(data1);i++)
{
if(data1[i]!=' '&&data1[i]!='\t')
{
p1[j]=data1[i];
j++;
}
}
p1[j]='\0';
for(int i=;i<strlen(data2);i++)
{
if(data2[i]!=' '&&data2[i]!='\t')
{
p2[k]=data2[i];
k++;
}
}
p2[k]='\0';
//cout<<p1<<endl;
//cout<<p2<<endl;
if(strcmp(p1,p2)==)
cout<<"Presentation Error"<<endl;
else
cout<<"Wrong Answer"<<endl;
} }
return ;
}
 

HDU1073: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&sol;Cena的SPJ&lpar;special judge&rpar;

    转自: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. &lbrack;swustoj 1021&rsqb; Submissions of online judge

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

  7. HDOJ&sol;HDU 1073 Online Judge&lpar;字符串处理~&rpar;

    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 ...

随机推荐

  1. 一步一步来做WebQQ机器人-&lpar;五&rpar;&lpar;发送消息&vert;&vert;完结&rpar;

    × 本篇主要是: 发送QQ消息(to:好友,群),以及对小黄鸡抓包利用它的语言库 本文是WebQQ流程的最后一章 最后一章内容不多但我还是啰嗦,可能对大部分人都已知晓的流程方法我也会介绍一下 前面几个 ...

  2. 安装javajava整合Flex

    PS:今天上午,非常郁闷,有很多简单基础的问题搞得我有些迷茫,哎,代码几天不写就忘.目前又不当COO,还是得用心记代码哦! 这几天在学一个叫Flex的东西,之前也没搞过这一类的东西认为既神秘又生疏,随 ...

  3. android打包引用第三方jar出现的错误

    今天终于完成了近一个月的App开发工作,对程序进行混淆导出签名apk包时,却出现了如下的错误: Proguard returned with error code 1. See console Not ...

  4. 初探Apache Beam

    文章作者:luxianghao 文章来源:http://www.cnblogs.com/luxianghao/p/9010748.html  转载请注明,谢谢合作. 免责声明:文章内容仅代表个人观点, ...

  5. python3 第三十章 - 内置函数之Dictionary相关

    Python字典包含了以下内置函数: 序号 函数及描述 实例 1 len(dict)计算字典元素个数,即键的总数. >>> dict = {'Name': 'cnblogs', 'A ...

  6. PHP慢日子查询

    2开启慢日志配置输出php-fpm慢日志,阀值为2秒:request_slowlog_timeout = 2slowlog = log/$pool.log.slow利用sort/uniq命令分析汇总p ...

  7. 如何成为一名合格的CTO&quest;(转)

    不会走出去公众演说的的攻城狮不是好CTO. 本文来源于微信公众号“线性资本”(ID:LinearVenture) 成为一名合格 CTO 我们投过很多技术型的公司,对于什么是合格的 CTO 有过自己的一 ...

  8. BZOJ&period;1879&period;&lbrack;SDOI2009&rsqb;Bill的挑战&lpar;状压DP&rpar;

    题目链接 f定义和下面的思路一样,转移时枚举填什么字符,去更新f并算出有哪些字符串可以匹配某个状态(见code吧...). 预处理出有哪些字符串在第i位可以转移到某个字符c,dp时&一下状态即 ...

  9. iOS开发-Block回调

    关于Block之前有一篇文章已经写过一篇文章Object-C-代码块Block回顾,不过写的比较浅显,不能体现出Block在实际开发中的重要性,关于Block的基础知识,可以参考之前的博客.在实际开发 ...

  10. 【Java nio】 Blocking nio

    package com.slp.nio; import org.junit.Test; import java.io.File; import java.io.IOException; import ...