Codeforces 61B【怪在读题】
搞不懂为什么DFS的写法崩了,然后乱暴力,因为题意不是很懂。。。
主要还是读题吧(很烦
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int>PII;
const double eps=1e-5;
const double pi=acos(-1.0);
//const int mod=1e9+7;
const int INF=0x3f3f3f3f; char temp[5][1010];
char tep[30][5030]; bool Judge(char x)
{
if(x>='a'&&x<='z')
return 1;
if(x>='A'&&x<='Z')
return 1;
return 0;
}
int num;
void init()
{
int len,num1;
char s[1010];
for(int i=0;i<3;i++)
{
scanf("%s",s);
len=strlen(s);
num1=0;
for(int j=0;j<len;j++)
{
if(Judge(s[j]))
{
if(s[j]>='A'&&s[j]<='Z')
temp[i][num1++]=s[j]+'a'-'A';
else
temp[i][num1++]=s[j];
}
}
temp[i][num1]='\0';
}
num=0;
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
if(i==j) continue;
for(int k=0;k<3;k++)
{
if(j!=k&&k!=i)
{
int sp=0;
int len=strlen(temp[i]);
for(int p=0;p<len;p++)
tep[num][sp++]=temp[i][p];
len=strlen(temp[j]);
for(int p=0;p<len;p++)
tep[num][sp++]=temp[j][p];
len=strlen(temp[k]);
for(int p=0;p<len;p++)
tep[num][sp++]=temp[k][p];
tep[num][sp]='\0';
num++;
}
}
}
}
} int main()
{
char s[1010],ss[1010];
int n;
init();
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%s",s);
int len=strlen(s);
int num1=0;
for(int j=0;j<len;j++)
{
if(Judge(s[j]))
{
if(s[j]>='A'&&s[j]<='Z')
ss[num1++]=s[j]+'a'-'A';
else
ss[num1++]=s[j];
}
}
ss[num1]='\0';
int flag=0;
for(int k=0;k<num;k++)
{
if(strcmp(ss,tep[k])==0)
{
flag=1;
break;
}
}
if(flag)
puts("ACC");
else
puts("WA");
}
return 0;
} /*
aa
aaa
z
1
aaazaa
*/
Codeforces 61B【怪在读题】的更多相关文章
- Codeforces 659B Qualifying Contest【模拟,读题】
写这道题题解的目的就是纪念一下半个小时才读懂题...英文一多读一读就溜号... 读题时还时要静下心来... 题目链接: http://codeforces.com/contest/659/proble ...
- 杭电ACM2076--夹角有多大(题目已修改,注意读题)
杭电ACM2076--夹角有多大(题目已修改,注意读题) http://acm.hdu.edu.cn/showproblem.php?pid=2076 思路很简单.直接贴代码.过程分析有点耗时间. / ...
- 【托业】【全真题库】TEST01-03-阅读题
[托业][全真题库]TEST01-03-阅读题
- HDUOJ--2079选课时间(题目已修改,注意读题)
选课时间(题目已修改,注意读题) Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) ...
- hdu 3268 09 宁波 现场 I - Columbus’s bargain 读题 最短路 难度:1
Description On the evening of 3 August 1492, Christopher Columbus departed from Palos de la Frontera ...
- Codeforces#441 Div.2 四小题
Codeforces#441 Div.2 四小题 链接 A. Trip For Meal 小熊维尼喜欢吃蜂蜜.他每天要在朋友家享用N次蜂蜜 , 朋友A到B家的距离是 a ,A到C家的距离是b ,B到C ...
- You Are Given a Decimal String... CodeForces - 1202B [简单dp][补题]
补一下codeforces前天教育场的题.当时只A了一道题. 大致题意: 定义一个x - y - counter :是一个加法计数器.初始值为0,之后可以任意选择+x或者+y而我们由每次累加结果的最后 ...
- Day1 读题解题提升
The 2014 ACM-ICPC Asia Mudanjiang Regional Contest 昨晚做了训练赛,然后读题又自闭了QAQ. Average Score ZOJ - 3819 题意: ...
- Educational Codeforces Round 10 A B题、
A. Gabriel and Caterpillar 题意: 就是说 一个小孩子去观察毛毛虫从 h1的地方爬到h2的地方.毛毛虫从10点爬到22点.每小时爬的距离是a, 晚上22点到第二天早上10点 ...
随机推荐
- Android 开发之static引发的冤案
前段时间在android手机系统上开发一个小东西,先介绍一下他吧: 就是当手指点击屏幕不论什么地方的时候会出现点击的特效,就是在你点击屏幕的地方会出现各种效果,比方:雪花纷飞;出现五彩的肥皂泡:鲜花盛 ...
- Html5的placeholder属性(IE兼容)
HTML5对Web Form做了很多增强,比方input新增的type类型.Form Validation等. Placeholder是HTML5新增的还有一个属性,当input或者textarea设 ...
- Operation not permitted - /usr/bin/pod
问题描述:执行sudo gem install cocoapods, 提示出错:While executing gem ... (Errno::EPERM) Operation not per ...
- Python: lambda, map, reduce, filter
在学习python的过程中,lambda的语法时常会使人感到困惑,lambda是什么,为什么要使用lambda,是不是必须使用lambda? 下面就上面的问题进行一下解答. 1.lambda是什么? ...
- linux环境下安装的activemq的输出日志
activemq输出日志的位置: activemq/data/activemq.log 查看activemq.log文件即可.
- mac10.10 打造Python多版本虚拟环境
一.简介 1.在操作系统mac10.10(yosemite)中搭建Python多版本虚拟环境: 2.多版本虚拟环境包含三个含义: 在一个操作系统中安装多个版本的Python,不同版本可以随意切换,例如 ...
- chatty: uid=10549(u0_a549) com.exampleidentical 40 lines
主要是因为你的app在短时间内输出太多次的日志,导致日志丢失 As soon as app considered 'chatty' by logcat (more than 5 lines per s ...
- Struts页面跳转问题
只有在web-INF中的jsp才可以不用加namespace名 <s:a action="systemIndexAction_turn" >跳转</s:a> ...
- xmlToEntity or entityToXML 工作笔记
最近工作中调用接口,返回报文是String,取值不方便,需要转换为实体,回来自己简单写了个demo,基本上可以满足工作需求. 除了下面代码外,还要创建对应的实体. package yh.test.t1 ...
- UVA10870 Recurrences —— 矩阵快速幂
题目链接:https://vjudge.net/problem/UVA-10870 题意: 典型的矩阵快速幂的运用.比一般的斐波那契数推导式多了几项而已. 代码如下: #include <bit ...