题目描述

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.

输入

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.

输出

For each test cases, you should output the the result Judge System should return.

样例输入

START
+ =
END
START
+=
END
START
+ =
END
START
+ = END
START
+ =
END
START
+ =
END
START
+ =
END
START
+ =
END
样例输出
Presentation Error
Presentation Error
Wrong Answer
Presentation Error

题目链接:http://acm.zznu.edu.cn/problem.php?id=1163

*************************************************

题意:OJ的判题系统,只判 AC , WA ,PE。将所有的字符读入(包括回车)到一个字符串中,逐个比较,如果完全相同 AC , 如果只有space , '\t' 或者 '\n'处不同则 PE 否则 WA

分析:第二行空相当于一个'\0',所以我们要写个循环把每一行的值都存入相同一个串,再比较。

AC代码:

 #include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include<limits.h>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <vector>
#include <queue>
#include <map> using namespace std; #define N 10000
#define INF 0x3f3f3f3f
#define met(a, b) memset (a, b, sizeof (a))//// met (dist, -1);
#define LL long long char a[N],b[N],s[],str[N],str1[N]; int main()
{
int T,i,j,len;
scanf("%d", &T);
getchar(); while(T--)
{
int k=,l=,f=; memset(a,'',sizeof(a));
memset(b,'',sizeof(b));
gets(s);
while(gets(str))
{
if(strcmp(str,"END")==)
break;
len=strlen(str);
for(i=;i<=len;i++)
a[k++]=str[i];
} gets(s);
while(gets(str1))
{
if(strcmp(str1,"END")==)
break; len=strlen(str1);
for(i=;i<=len;i++)
b[l++]=str1[i];
} for(i=,j=; i<=k&&j<=l;)
{
if(a[i] != b[j])
{
if(a[i] == ' '||a[i] == '\0'||a[i] == '\t')
{
i++;
f=;
}
else if(b[j]==' '||b[j]=='\0'||b[j]=='\t')
{
j++;
f=;
}
else
{
f=;
break;
}
}
else
{
i++;
j++;
}
} if(f==)
printf("Accepted\n");
else if(f==)
printf("Presentation Error\n");
else if(f==)
printf("Wrong Answer\n"); }
return ;
}

ZZNU 1163: 在线判题(指针专题)的更多相关文章

  1. 在线判题系统hustoj的搭建

    摘要:ACM/ICPC程序设计竞赛,越来越受到各个高校的重视,是程序设计竞赛中的奥林匹克.Hustoj是搭建在linux系统上的判题系统.能够判断代码的正确性.会及时返回通过或者不通过,如果不通过会返 ...

  2. 牛客网在线判题系统JavaScript(V8)使用

    JavaScript作为一种弱类型的编程语言,语法和C/C++.JAVA等存在差别,但是对于大部算法题,不只是C/C++.JAVA,也依然可以使用JavaScript来实现.所以在牛客网中,如果你喜欢 ...

  3. 在线判题 (模拟)http://202.196.1.132/problem.php?id=1164

    #include<stdio.h> #include<math.h> #include<string.h> #include<stdlib.h> #de ...

  4. YC大牛的判题任务-想法

    YC大牛的判题任务 Time Limit: 1000ms Memory Limit: 65536KB   64-bit integer IO format: %lld      Java class ...

  5. 输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点),返回结果为复制后复杂链表的head。(注意,输出结果中请不要返回参数中的节点引用,否则判题程序会直接返回空)

    // test20.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include<iostream> #include< ...

  6. LeetCode刷题 链表专题

    链表专题 链表题目的一般做法 单链表的结构类型 删除节点 方法一 方法二 增加节点 LeedCode实战 LC19.删除链表的倒数第N个结点 解法思路 LC24.两两交换链表中的节点 解法思路 LC6 ...

  7. LeetCode刷题 树专题

    树专题 关于树的几个基本概念 1 树的节点定义 2 关于二叉树的遍历方法 2.1 前序遍历 2.2 中序遍历 2.3 后序遍历 2.4 层序遍历 3 几种常见的树介绍 3.1 完全二叉树 3.2 二叉 ...

  8. 【dp专题】NOIP真题-DP专题练习

    这里学习一下DP的正确姿势. 也为了ZJOI2019去水一下做一些准备 题解就随便写写啦. 后续还是会有专题练习和综合练习的. P1005 矩阵取数游戏 给出$n \times m$矩阵每次在每一行取 ...

  9. C语言指针专题——指针怎么就很灵活?

    最近在研读 C Primer pkus(第五版)中文版,老外写的还是很经典的,推荐给朋友们,购买地址:C primer plus 5版中文版购买 另外再推荐两本书: 1. 2017年9月全国计算机二级 ...

随机推荐

  1. Java自带的性能监测工具用法简介——jstack、jconsole、jinfo、jmap、jdb、jsta、jvisualvm

    JDK内置工具使用 一.javah命令(C Header and Stub File Generator) 二.jps命令(Java Virtual Machine Process Status To ...

  2. 曲演杂坛--SQLCMD下执行命令失败但没有任何错误提示的坑

    今天使用SQLCMD导入到SQL SERVER数据库中,看着数据文件都成功执行,但是意外发现有一个文件数据没有成功导入,但执行不报错,很容易导致问题被忽略. 使用存在问题的文件做下测试,从界面上看几行 ...

  3. OpenH264

    转自:http://blog.csdn.net/chinabinlang/article/details/41209053 目前最常用的264工程师x264: 最近有又有一个开源工程OpenH264, ...

  4. js判断获取浏览器关闭状态

    如题,js获取浏览器关闭状态,可实现判断选择是否关闭. <html> <head> <title> </title> </head> < ...

  5. angular1.x 脏检测

    写在前面 双向绑定是angular的大亮点,然后支撑它的就是脏检测.一直对脏检测都有一些理解,却没有比较系统的概念. 以下是我阅读网上博文以及angular高级程序设计的理解与总结. 接收指导与批评. ...

  6. 【css2、css3】css改变select选择框的样式

    效果: 代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="U ...

  7. java 访问后台方法顺序混乱

    今天遇到后台接值顺序混乱的问题. 环境:前台ajax请求后台方法.前台页面会频繁访问这个ajax. 现象:访问后台方法的顺序混乱. 怎么发现的问题:数量小访问没有问题,今天压力测试发现的问题. 解决办 ...

  8. gimagex 2.0.17 汉化版

    软件名称: gimagex 2.0.17 汉化版 软件语言: 简体中文 授权方式: 免费软件 运行环境: Win 32位/64位 软件大小: 1.31MB 图片预览: 软件简介: gimagex 2. ...

  9. matlab中选择图片路径

    %读取训练图片数据文件 [FileName,PathName] = uigetfile('*.*','选择测试图片数据文件t10k-images.idx3-ubyte'); %暴露图片路径 saved ...

  10. Proteus中MATRIX-8X8 LED灯的连接

    上面8个引脚用于选择行,低电平有效.下面8个引脚用于选择列,高电平有效. 经测试,红色点阵LED与之相反,是上面的引脚用于选择列,且高电平有效:下面的引脚用于选择行,低电平有效. 在AT89C51单片 ...