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点 ...
随机推荐
- iOS8的UIPresentationController
本文转载至 http://kyfxbl.iteye.com/blog/2147888 从iOS8开始,controller之间的跳转特效,需要用新的API UIPresentationControll ...
- J++ C#
J++几乎有与Java相同的编程语言和虚拟机.
- JavaScript精粹
序:好书是需要不断品读的!再读语言精粹,顺便做点笔记. 1.NaN是一个数值,它表示一个不能产生正常结果的运算结果.NaN不等于任何值,包括它自己.检测是否为NaN: isNaN(number). ...
- hdu1427 速算24点
</pre><pre> //#pragma comment(linker, "/STACK:102400000,102400000") //HEAD #in ...
- react-native填坑--react-navigation
Navigator已经被React Native废弃了.也许你可以在另外的一个依赖库里react-native-deprecated-custom-components里找到.不过既然官方推荐的是re ...
- linux source命令与sh shell scripts的区别
source FileName 作用:在当前bash环境下读取并执行FileName中的命令. 注:该命令通常用命令“.”来替代. 如:source .bash_rc 与 . .bash_rc 是等效 ...
- POJ 2309 BST(二叉搜索树)
BST Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8657 Accepted: 5277 Description C ...
- phpcms 内容模块PC标签调用
PHPcms 调用命令的基本格式: 开始:{pc:content action="模块操作名" catid="调用栏目ID" num="数据调用数量& ...
- php数组合并
php的数合并函数: array_merge($arr1, $arr2, ..., $arr{$n}); 如果数组的键名有重复,后面的会覆盖前面的. 如果键名是数字索引,则会重新排列索引,往后累加. ...
- web.xml 有什么用?
1.每个javaEE工程中都有web.xml文件,那么它的作用是什么呢?它是每个web.xml工程都必须的吗? 一个web中可以没有web.xml文件,也就是说,web.xml文件并不是web工程必须 ...