题目:给你一些题目的输出结果,推断是AC,PE还是WA。

分析:模拟。

依照题意模拟就可以,注意PE条件为全部数字字符出现顺序同样就可以。

说明:想起非常多年前写的OJ的后台判题程序了╮(╯▽╰)╭。

#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath> using namespace std; char list1[101][122];
char list2[101][122];
char numb1[12001];
char numb2[12001]; int main()
{
int n,m,t = 1;
while (~scanf("%d",&n) && n) {
getchar();
for (int i = 0; i < n; ++ i)
gets(list1[i]);
scanf("%d",&m);
getchar();
for (int i = 0; i < m; ++ i)
gets(list2[i]); int AC = 1;
if (m == n) {
for (int i = 0; i < n; ++ i)
if (strcmp(list1[i], list2[i])) {
AC = 0;
break;
}
}else AC = 0; int PE = 1,save1 = 0,save2 = 0;
for (int i = 0; i < n; ++ i)
for (int j = 0; list1[i][j]; ++ j)
if (list1[i][j] >= '0' && list1[i][j] <= '9')
numb1[save1 ++] = list1[i][j];
for (int i = 0; i < m; ++ i)
for (int j = 0; list2[i][j]; ++ j)
if (list2[i][j] >= '0' && list2[i][j] <= '9')
numb2[save2 ++] = list2[i][j];
if (save1 == save2) {
for (int i = 0; i < save1; ++ i)
if (numb1[i] != numb2[i]) {
PE = 0;
break;
}
}else PE = 0; printf("Run #%d: ",t ++);
if (AC) printf("Accepted\n");
else if (PE) printf("Presentation Error\n");
else printf("Wrong Answer\n");
}
return 0;
}

UVa 10188 - Automated Judge Script的更多相关文章

  1. [UVa10188]Automated Judge Script

    题目大意:叫你写一个判断答案的系统. 解题思路:模拟即可.AC条件为,答案条数相等,所有字符相等.PE条件为,答案条数可能不等,所有数字字符相等.其他为WA. UVa现在的C++已经不支持gets了, ...

  2. UVA.12169 Disgruntled Judge ( 拓展欧几里得 )

    UVA.12169 Disgruntled Judge ( 拓展欧几里得 ) 题意分析 给出T个数字,x1,x3--x2T-1.并且我们知道这x1,x2,x3,x4--x2T之间满足xi = (a * ...

  3. UVA 12169 Disgruntled Judge 扩展欧几里得

    /** 题目:UVA 12169 Disgruntled Judge 链接:https://vjudge.net/problem/UVA-12169 题意:原题 思路: a,b范围都在10000以内. ...

  4. UVa 12169 - Disgruntled Judge(拓展欧几里德)

    链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  5. uva 489.Hangman Judge 解题报告

    题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...

  6. uva 489 Hangman Judge(水题)

    题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&am ...

  7. UVa 489 Hangman Judge(字符串)

     Hangman Judge  In ``Hangman Judge,'' you are to write a program that judges a series of Hangman gam ...

  8. uva 489 Hangman Judge

    大意:电脑想个单词,玩家来猜.玩家输入一个个字母,若答案里有这个字母,则显示该单词中所有该字母.最终目标是显示答案所有字母.猜错7次,死: 注意特殊条件:1.玩家不断重复错误的字母,只算一次猜错.2. ...

  9. UVA 12169 Disgruntled Judge 枚举+扩展欧几里得

    题目大意:有3个整数 x[1], a, b 满足递推式x[i]=(a*x[i-1]+b)mod 10001.由这个递推式计算出了长度为2T的数列,现在要求输入x[1],x[3],......x[2T- ...

随机推荐

  1. C++ Primer学习笔记2--c++标准库中的 vector、string 和 bitset 类型

    一.string    #include <string>  using std::string    初始化函数:    string s1;        默认构造函数 s1 为空串 ...

  2. 【Lucene】近实时搜索

    近实时搜索:可以使用一个打开的IndexWriter快速搜索索引的变更内容,而不必首先关闭writer,或者向该writer提交:这是2.9版本之后推出的新功能. 代码示例(本例参考<Lucen ...

  3. 一个必用的javascript框架:underscore.js - wine的思考 - ITeye技术网站

    AngularJS+JqueryMobile+PhoneGap 打造APP « Dogeek AngularJS+JqueryMobile+PhoneGap 打造APP

  4. 【解决方法】System.IO.FileNotFoundException

    错误日志 See the end of this message for details on invoking just-in-time (JIT) debugging instead of thi ...

  5. 黑马程序猿 ---------- Java网络技术之 ---正則表達式 (Day06)

    ---------------------- ASP.Net+Unity开发..Net培训.期待与您交流. ---------------------- 正則表達式 正則表達式:基本知识 1  字符, ...

  6. 再淡spring jdbc 连接池断开重连设置

    先看一段错误日志: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConne ...

  7. 【图像处理】Gabor过滤器

    Gabor内核参考wiki 使用实数Real的公式计算核函数代码: Mat getGaborFilter(float lambda, float theta, float sigma2,float g ...

  8. Windows Azure入门教学系列 (四):使用Blob Storage

    本文将会介绍如何使用Blob Storage.Blob Storage可以看做是云端的文件系统.与桌面操作系统上不同,我们是通过REST API来进行对文件的操作.有关REST API的详细信息,请参 ...

  9. How to decompile class file in Java and Eclipse - Javap command example(转)

    Ability to decompile a Java class file is quite helpful for any Java developer who wants to look int ...

  10. 基于visual Studio2013解决面试题之0802数字最多元素

     题目