HDU 1073 - Online Judge
模拟评测机判断答案
先判断有没有不一样的
有的话再提取出 有效子列 看看有没有错的
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
using namespace std;
int t;
string a,b,sa,sb;
char s[];
const char p[][]={"Accepted","Presentation Error","Wrong Answer"};
void getstring(string& a)
{
while(gets(s))
{
if(!strcmp(s,"START")) break;
}
while()
{
gets(s);
if(!strcmp(s,"END")) break;
a+=s;
a+='\n';
}
}
void getsub(string& a,string& sa)
{
int len=a.length();
for(int i=;i<len;i++)
{
if(a[i]==' '||a[i]=='\t'||a[i]=='\n') continue;
sa+=a[i];
}
}
int main()
{
scanf("%d",&t);
int i,j,lena,lenb;
while(t--)
{
a.clear(); sa.clear();
b.clear(); sb.clear();
getstring(a);
getstring(b);
lena=a.length();
lenb=b.length();
int ans=;
if(lena!=lenb) ans=;
else {
for(i=;i<lena;i++)
{
if(a[i]!=b[i])
{
ans=; break;
}
}
}
if(ans)
{
getsub(a,sa);
getsub(b,sb);
int lsa=sa.length(), lsb=sb.length();
if(lsa!=lsb) ans=;
else{
for(i=;i<lsa;i++)
{
if(sa[i]!=sb[i])
{
ans=; break;
}
}
}
}
printf("%s\n",p[ans]);
}
}
HDU 1073 - Online Judge的更多相关文章
- 解题报告:hdu 1073 Online Judge
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1073 Problem Description Ignatius is building an Onli ...
- HDOJ/HDU 1073 Online Judge(字符串处理~)
Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...
- HDU 1073 Online Judge (字符串处理)
题目链接 Problem Description Ignatius is building an Online Judge, now he has worked out all the problem ...
- HDU 1073 Online Judge(字符串)
Online Judge Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Tot ...
- HDU ACM 1073 Online Judge ->字符串水题
分析:水题. #include<iostream> using namespace std; #define N 5050 char a[N],b[N],tmp[N]; void Read ...
- HDU 1073
http://acm.hdu.edu.cn/showproblem.php?pid=1073 模拟oj判题 随便搞,开始字符串读入的细节地方没处理好,wa了好久 #include <iostre ...
- 【HDOJ】1073 Online Judge
这道题TLE了N多次,完全不明白为什么,稍微改了一下,居然过了.使用gets过的,看讨论帖有人还推荐用hash. #include <stdio.h> #include <strin ...
- hdu 1073 字符串处理
题意:给一系列的输出和标准答案,比较二者是AC,PE或WA 字符串处理还是比较薄弱,目前没什么时间搞字符串专题,所以遇到一题就努力搞懂 #include<cstdio> #include& ...
- 并查集---体会以及模板&&How Many Tables - HDU 1213
定义&&概念: 啥是并查集,就是将所有有相关性的元素放在一个集合里面,整体形成一个树型结构,它支持合并操作,但却不支持删除操作 实现步骤:(1)初始化,将所有节点的父亲节点都设置为自己 ...
随机推荐
- 关于降低android手机摄像头预览分辨率
假设现在有这样一个需求需要一直开着手机摄像头 但是不做任何拍照动作 但是每个手机的相机分辨率都不同 而默认预览的时候参数是最大分辨率 这样有时候就回导致电量损耗的加快 所以我们可以采取降低相机分辨率的 ...
- TaobaoProtect.exe,Alipaybsm.exe进程删除----让流氓软件滚粗
可能经常上网的朋友都会有这样的经历,只要你上过一次淘宝,那么阿里会给你的电脑自动下载一个TaobaoProtect.exe的程序,这是支付宝安全控件,名为安全控件,实际上它会在后台搜集用户数据和信息, ...
- 实战 Spring MVC接入支付宝即时到账 (部分代码)
下面就拿我项目中的部分代码来实践一下. 支付请求 首先,是提交表单 fund.jsp(这里我表单只需要用户填交易金额,其他的订单号之类的全部后台生成) <form id="deposi ...
- C++服务器设计(七):聊天系统服务端实现
在之前的章节中,我们对服务端系统的设计实现原理进行了剖析,在这一章中,我们将对服务端框架进行实际运用,实现一款运行于内网环境的聊天系统.该聊天系统由客户端与服务器两部分组成,同时服务端通过数据库维护用 ...
- (原)Ubuntu16中编译caffe
转载请注明出处: http://www.cnblogs.com/darkknightzh/p/5797526.html 参考网址: http://caffe.berkeleyvision.org/in ...
- 使用LAMP创建基于wordpress的个从博客网站
参考: http://blog.csdn.net/ck_boss/article/details/27866117 一.mysql配置 1.安装mysql yum install mysql-serv ...
- mac下 WebStorm下主题包安装
mac下: 主题包 1.mac下,点击桌面,使用shift+command+G 输入:~/Library/Preferences 前往(mac查找安装目录的方法,因为默认这些文件夹是隐藏的),进入We ...
- 转:Linux中find命令-path -prune用法详解
在Windows中可以在某些路径中查找文件,也可以设定不在某些路径中查找文件,下面用Linux中的find的命令结合其-path -prune参数来看看在Linux中怎么实现此功能. 假如在当前目录下 ...
- dedecms 财付通接口
用织梦做了个旅游网站,网址:http://www.redtourism.cn/ 客户要求财付通支付,上网找了下 不是要买就是要钱,只有自己写了. 代码: <?phpif(!defined('DE ...
- Hdu1001(1到100的和)
常规算法: #include <stdio.h> int main() { // 常规算法 int a; while(scanf("%d",&a)!=EOF){ ...