http://acm.hdu.edu.cn/showproblem.php?pid=1073

模拟oj判题

随便搞,开始字符串读入的细节地方没处理好,wa了好久

#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std ;
char s1[],s2[] ;
char s3[],s4[] ;
int main()
{
int t ;
scanf("%d%*c",&t) ;
while(t--)
{
scanf("%*s%*c") ;
char ch ;
int st= ;
while(ch=getchar())
{
s1[st++]=ch ;
if(ch=='\n' && st> && s1[st-]=='E' && s1[st-]=='N' && s1[st-]=='D')
break ;
}
s1[st-]='\0' ;
scanf("%*s%*c") ;
st= ;
while(ch=getchar())
{
s2[st++]=ch ;
if(ch=='\n' && st> && s2[st-]=='E' && s2[st-]=='N' && s2[st-]=='D')
break ;
}
s2[st-]='\0' ;
if(!strcmp(s1,s2))
{
puts("Accepted") ;
}
else
{
st= ;
for(int i= ;i<strlen(s1) ;i++)
if(s1[i]==' ' || s1[i]=='\t' || s1[i]=='\n')
continue ;
else
s3[st++]=s1[i] ;
s3[st]='\0' ;
st= ;
for(int i= ;i<strlen(s2) ;i++)
if(s2[i]==' ' || s2[i]=='\t' || s2[i]=='\n')
continue ;
else
s4[st++]=s2[i] ;
s4[st]='\0' ;
if(!strcmp(s3,s4))
puts("Presentation Error") ;
else
puts("Wrong Answer") ;
}
}
return ;
}
#include <iostream>
#include <cstdio>
#include <cstring>
#include <map>
using namespace std ;
char s1[],s2[] ;
int main()
{
int t ;
scanf("%d%*c",&t) ;
while(t--)
{
scanf("%*s%*c") ;
char ch ;
int st= ;
while(ch=getchar())
{
s1[st++]=ch ;
if(ch=='\n' && st> && s1[st-]=='E' && s1[st-]=='N' && s1[st-]=='D')
break ;
}
s1[st-]='\0' ;
scanf("%*s%*c") ;
st= ;
while(ch=getchar())
{
s2[st++]=ch ;
if(ch=='\n' && st> && s2[st-]=='E' && s2[st-]=='N' && s2[st-]=='D')
break ;
}
s2[st-]='\0' ;
if(!strcmp(s1,s2))
{
puts("Accepted") ;
}
else
{
map <char,int> M1,M2 ;
for(int i= ;i<strlen(s1) ;i++)
M1[s1[i]]++ ;
for(int i= ;i<strlen(s2) ;i++)
M2[s2[i]]++ ;
map <char,int> :: iterator it ;
int f= ;
for(it=M1.begin() ;it!=M1.end() ;it++)
if(M2[it->first]!=it->second && it->first!=' ' && it->first!='\t' && it->first!='\n')
{
f= ;
break ;
}
if(f)
puts("Presentation Error") ;
else
puts("Wrong Answer") ;
}
}
return ;
}

HDU 1073的更多相关文章

  1. 解题报告:hdu 1073 Online Judge

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1073 Problem Description Ignatius is building an Onli ...

  2. HDOJ/HDU 1073 Online Judge(字符串处理~)

    Problem Description Ignatius is building an Online Judge, now he has worked out all the problems exc ...

  3. HDU 1073 - Online Judge

    模拟评测机判断答案 先判断有没有不一样的 有的话再提取出 有效子列 看看有没有错的 #include <iostream> #include <cstdio> #include ...

  4. hdu 1073 字符串处理

    题意:给一系列的输出和标准答案,比较二者是AC,PE或WA 字符串处理还是比较薄弱,目前没什么时间搞字符串专题,所以遇到一题就努力搞懂 #include<cstdio> #include& ...

  5. HDU 1073 Online Judge (字符串处理)

    题目链接 Problem Description Ignatius is building an Online Judge, now he has worked out all the problem ...

  6. HDU 1073 Online Judge(字符串)

    Online Judge Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Tot ...

  7. HDU ACM 1073 Online Judge -&gt;字符串水题

    分析:水题. #include<iostream> using namespace std; #define N 5050 char a[N],b[N],tmp[N]; void Read ...

  8. HDU——PKU题目分类

    HDU 模拟题, 枚举1002 1004 1013 1015 1017 1020 1022 1029 1031 1033 1034 1035 1036 1037 1039 1042 1047 1048 ...

  9. [转] HDU 题目分类

    转载来自:http://www.cppblog.com/acronix/archive/2010/09/24/127536.aspx 分类一: 基础题:1000.1001.1004.1005.1008 ...

随机推荐

  1. 【转载】Eclipse 任务栏锁定问题

    刚装上 Eclipse 将快捷方式拖 Win7 任务栏上了,可是打开后发现会另开一个图标并且点右键也没有锁定到任务栏的选项,很是不爽,MyEclipse 也是这样,解决方法如下. 在Eclipse目录 ...

  2. SaltStack部署配置Tomcat-第三篇

    实验目标 简单部署tomcat及安装java环境 实现步骤 编写salt的状态模块 [root@linux-node1 web]# pwd /srv/salt/base/web [root@linux ...

  3. spring 概念理解

    一.Spring的IoC(Inversion of Control).这是Spring中得有特点的一部份.IoC又被翻译成“控制反转”,也不知道是谁翻译得这么别扭,感觉很深奥的词.其实,原理很简单,用 ...

  4. 一个带展示的jsp上传控件模型

    带展示上传控件的基本模型,无样式 jsp部分: <td> <form id="form1" enctype="multipart/form-data&q ...

  5. WinCE数据通讯之Web Service分包传输篇

    前面写过<WinCE数据通讯之Web Service篇>那篇对于数据量不是很大的情况下单包传输是可以了,但是对于大数据量的情况下WinCE终端的内存往往会在解包或者接受数据时产生内存溢出. ...

  6. codeforces600E Lomsat gelral

    本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作. 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/ ...

  7. 最新版本的Struts2+Spring4+Hibernate4三大框架整合(截止2014-10-15,提供源码下载)

    一. 项目名称:S2316S411H436 项目原型:Struts2.3.16 + Spring4.1.1 + Hibernate4.3.6 + Quartz2.2.1 源代码下载地址: 基本版:ht ...

  8. Android系统源代码

    Android系统源代码 在线源码网站 1,http://androidxref.com 2,http://www.grepcode.com/ 3,http://www.androidos.net.c ...

  9. 仅需15分钟,使用OpenCV+Keras轻松破解验证码

    https://baijia.baidu.com/s?id=1586732712477979223&wfr=pc&fr=app_lst

  10. Android面试三之Service

    Service是什么 Service(服务)是一个没有用户界面的在后台运行执行耗时操作的应用组件.其他应用组件能够启动Service,并且当用户切换到另外的应用场景,Service将持续在后台运行.另 ...