UVa 10188 - Automated Judge Script
题目:给你一些题目的输出结果,推断是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的更多相关文章
- [UVa10188]Automated Judge Script
题目大意:叫你写一个判断答案的系统. 解题思路:模拟即可.AC条件为,答案条数相等,所有字符相等.PE条件为,答案条数可能不等,所有数字字符相等.其他为WA. UVa现在的C++已经不支持gets了, ...
- UVA.12169 Disgruntled Judge ( 拓展欧几里得 )
UVA.12169 Disgruntled Judge ( 拓展欧几里得 ) 题意分析 给出T个数字,x1,x3--x2T-1.并且我们知道这x1,x2,x3,x4--x2T之间满足xi = (a * ...
- UVA 12169 Disgruntled Judge 扩展欧几里得
/** 题目:UVA 12169 Disgruntled Judge 链接:https://vjudge.net/problem/UVA-12169 题意:原题 思路: a,b范围都在10000以内. ...
- UVa 12169 - Disgruntled Judge(拓展欧几里德)
链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- uva 489.Hangman Judge 解题报告
题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- uva 489 Hangman Judge(水题)
题目:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&am ...
- UVa 489 Hangman Judge(字符串)
Hangman Judge In ``Hangman Judge,'' you are to write a program that judges a series of Hangman gam ...
- uva 489 Hangman Judge
大意:电脑想个单词,玩家来猜.玩家输入一个个字母,若答案里有这个字母,则显示该单词中所有该字母.最终目标是显示答案所有字母.猜错7次,死: 注意特殊条件:1.玩家不断重复错误的字母,只算一次猜错.2. ...
- 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- ...
随机推荐
- CentOS 6.4 + 曙光DS200 IPSan组建FTP服务器
CentOS 6.4 + 曙光DS200 IPSan组建FTP服务器 http://write.blog.csdn.net/postedit/10911105#本系列文章由ex_net(张建波)编写, ...
- spark中各种连接操作以及有用方法
val a = sc.parallelize(Array(("123",4.0),("456",9.0),("789",9.0)) val ...
- HDU4850 构造一个长度n串,它需要随机长度4子是不相同
n<=50W.(使用26快报) 构造函数:26一个.截至构建26^4不同的字符串,最长的长度26^4+3.如此之大的输出"impossble",被判重量的四维阵列. 在正向结 ...
- ASP.NET - Repeater控件删除按钮,点击删除信息
前台代码: <!--类别信息--> <div id ="newnews" class ="Frm"> <h4>类别管理< ...
- tq2440+fedora安装qt4.5
1. make[1]: arm-none-linux-gnueabi-g++:命令未找到 make[1]: *** [.obj/release-shared-emb-arm/qatomic_arm.o ...
- nodejs之防jade
你们学习nodejs的时候,千万别用jade,我掉到它的坑里,2天没有爬出来后来用vue
- EasyUI - Tabs
代码: 判断是不是已经存在,如果存在,则直接选中,否则创建新的tab. $('#tabs').tabs({ fit: true, border: false }) $('#Tree').tree({ ...
- Entity FramWork - 在VS里面直接创建表,并同步到数据库
前面具体添加什么直接看: 1.Entity - 使用EF框架进行增删改查 - 模型先行 2.Entity - 使用EF框架进行增删改查 - 数据库先行 然后: 然后右键,可以添加[实体],也就是表.之 ...
- haproxy redirect location和redirect prefix
<pre name="code" class="html">redirect location <loc> [code <code ...
- 中科同向备份软件Heartsone-backup(足足16个软件,可差异化备份虚拟机)
传统的备份方式我们应该尽量避免,除非他们支持和执行使用基于(API)的虚拟环境中的管理备份.中科同向备份软件Heartsone-backup V8.0(以下简称HBU)就是通过VADP提供的一系列管理 ...