题目:给你一些题目的输出结果,推断是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. php 抓取天气情况 www.weather.com.cn

    <?php print_r(getweather(101120501)); /** * Server 天气情况获取函数 * @param unknown $city */ function ge ...

  2. WCF消息之XmlDictionaryWriter

    原文:WCF消息之XmlDictionaryWriter XmlDictionaryWriter,是一个抽象类,从该类中派生了WCF,以便执行序列化和反序列化. 它有4种格式书写器: CreateBi ...

  3. C# 验证识别基类

    原文C# 验证识别基类 网上找了些代码 自己又改了下 先放出来了 处理简单的验证码足够了 001 using System; 002 using System.Collections.Generic; ...

  4. spring AOP 是如何一步一步被简化的

    Aop的配置使用 Aop的思想实现是基于代理设计模式的, 动态增加某些功能. 因此在最开始阶段 1 所有需要被织入的类都需要被代理(ProxyFactoryBean). 2 切面(advisor)的实 ...

  5. 关于Smartforms换页的

    smartforms中有系统变量SFSY-PAGE是总页码,SFSY-FORMPAGES是当前页,可以最后的窗体中做个判断 1.把窗体设置成最终窗体 2.新增一个命令,当前页等于最后一页才输出改内容, ...

  6. Friends

    Description Mike has many friends. Here are nine of them: Alice, Bob, Carol, Dave, Eve, Frank, Glori ...

  7. <IMG>中UserMap的用法

    usemap是<img>标签的一个属性,用作指明所使用的图像地图名. 后面的#Map的Map就是用<map>标签定义的一个图像地图,它的name属性是Map,像下面这样定义: ...

  8. DFA最小化 -- Hopcroft算法 Python实现

    wiki 伪代码看上去一直以为怪.发现葡萄牙语和俄罗斯语那里的 if 推断都还缺少一个条件. 国内的资料比較少.这几份学习资料不错.比我稀里糊涂的思路要好,分享下: http://www.liafa. ...

  9. 在ListCtrl控件中设置自定义光标

    ::SetCursor(::LoadCursor   (::AfxGetInstanceHandle(),   MAKEINTRESOURCE(IDB_BMP_MOUSE))); void   CMy ...

  10. "Invalid username/password or database/scan listener not up"

        文档 ID …         11.2 RAC DBconsole Creation Fails With Error: "Invalid username/password or ...