hduoj1073--Online Judge
做道题,并没有太多的技巧,关键在与对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
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.
1 + 2 = 3
START
1+2=3
START
START
#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的更多相关文章
- Gym 101102C---Bored Judge(区间最大值)
题目链接 http://codeforces.com/gym/101102/problem/C problem description Judge Bahosain was bored at ACM ...
- NOJ 1074 Hey Judge(DFS回溯)
Problem 1074: Hey Judge Time Limits: 1000 MS Memory Limits: 65536 KB 64-bit interger IO format: ...
- 【教程】如何正确的写一个Lemon/Cena的SPJ(special judge)
转自:http://www.cnblogs.com/chouti/p/5752819.html Special Judge:当正确的输出结果不唯一的时候需要的自定义校验器 首先有个框架 #includ ...
- 九度 Online Judge 之《剑指 Offer》一书相关题目解答
前段时间准备华为机试,正好之前看了一遍<剑指 Offer>,就在九度 Online Judge 上刷了书中的题目,使用的语言为 C++:只有3题没做,其他的都做了. 正如 Linus To ...
- UVa Online Judge 工具網站
UVa Online Judge 工具網站 UVa中译题uHuntAlgorithmist Lucky貓的ACM園地,Lucky貓的 ACM 中譯題目 Mirror UVa Online Judg ...
- [swustoj 1021] Submissions of online judge
Submissions of online judge(1021) 问题描述 An online judge is a system to test programs in programming c ...
- HDOJ/HDU 1073 Online Judge(字符串处理~)
Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...
- 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 ...
- UVA 489-- Hangman Judge(暴力串处理)
Hangman Judge In ``Hangman Judge,'' you are to write a program that judges a series of Hangman gam ...
- 杭州电子科技大学Online Judge 之 “确定比赛名次(ID1285)”解题报告
杭州电子科技大学Online Judge 之 "确定比赛名次(ID1285)"解题报告 巧若拙(欢迎转载,但请注明出处:http://blog.csdn.net/qiaoruozh ...
随机推荐
- 提高sql2005中带freetexttable和rank的全文检索的速度
原来使用中的sql2005的全文检索的速度总是不如意,尤其是带rank的.今天搜了一下,原来在freetexttable中还有一个参数top_n_by_rank,是第4个参数.注意还要设置:EXEC ...
- Tag Archives: 海明距离
在前一篇文章 <海量数据相似度计算之simhash和海明距离> 介绍了simhash的原理,大家应该感觉到了算法的魅力.但是随着业务的增长 simhash的数据也会暴增,如果一天100w, ...
- spark0.8.0安装与学习
spark0.8.0安装与学习 原文地址:http://www.yanjiuyanjiu.com/blog/20131017/ 环境:CentOS 6.4, Hadoop 1.1.2, J ...
- JAVA 中不错的开源FTP组件:commons-net
第一步:引入jar到pom.xml. <!-- https://mvnrepository.com/artifact/commons-net/commons-net --> <dep ...
- sqrt函数的实现
原文:http://blog.csdn.net/legend050709/article/details/39394381 sqrt算法实现: (一)int sqrt1(int n);求取整数x的平方 ...
- ArcGIS10.6了解一下
因为计算机水平不断更新,ESRI不得不重新倾力打造下一代ArcMap,叫ArcGIS Pro,现在ArcGIS Pro功能有一定地突显,但还不够强大和稳定:而ArcGIS Desktop方面没有什么大 ...
- php 字符串中的\n换行符无效、不能换行的解决方法
php 字符串中的\n换行符无效.不能换行的解决方法 程序的中的换行符\n会直接输出,无法正确换行,解决方法是把单引号改为双引号 aa
- 树莓派系统(Debain)中设置SSH服务开机自启动
一.方式: 禁用命令:sudo update-rc.d ssh disable 启用命令:sudo update-rc.d ssh enable 二.chkconfig的方式: 1.安装:apt-ge ...
- tomcat7配置
<?xml version='1.0' encoding='utf-8'?><!-- Licensed to the Apache Software Foundation (ASF) ...
- Linux安装和设置Samba服务器
1. 安装 安装前先关闭iptables和SELinux. Centos输入以下命令: yum install samba samba-client Ubuntu输入以下命令: apt-get ins ...