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点 ...
随机推荐
- activity fragment 转场动画
http://www.cnblogs.com/avenwu/p/3372736.html v4 fragment fragmentTransaction.setCustomAnimations(R.a ...
- ickeck插件
地址:http://www.bootcss.com/p/icheck/#skins 使用 1. 先引入文件 css <link rel="stylesheet" type=& ...
- Aspose.cells 读取Excel表中的图片问题
一.说明 本文主要是讲解,怎么使用aspose.cells读取Excel表中的图片,并把图片转换成流或是image对象. 二.开发环境说明 开发工具vs2012,c#语言, 三.Aspose.cell ...
- 九度OJ 1142:Biorhythms(生理周期) (中国剩余定理)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:266 解决:189 题目描述: Some people believe that there are three cycles in a p ...
- appium(1)-about appium
about appium Introduction to Appium Appium is an open-source tool for automating native, mobile web, ...
- alsa 编程
ALSA(Advanced Linux Sound Architecture)是由内核驱动,标准的API库和一系列实用程序组成.因为涉及到版权和BUG的问题Linux 2.6内核抛弃了旧的OSS,AL ...
- Photoshop颜色通道实例
PHOTOSHOP学到这会儿,我们不得不来学学枯燥乏味的颜色理论了,因为如果再不学,就难以学下去了.眼下我们就遇到了难点:颜色通道.前面在初识通道的时候,我已经说过:当你打开一张照片(RGB模式)的时 ...
- system调用命令行命令而不显示命令行窗口
system调用命令行命令而不显示命令行窗口 通常用system调用命令行命令时都会弹出黑底白字的命令行窗口,下面的代码可以不显示弹出的命令行窗口. 代码如下 #pragma comment( lin ...
- nginx ,node 配置项目
nginx ,node 配置项目 1.安装好node,npm 2.安装cnpm,-g是全局的 sudo npm install -g cnpm --registry=https://registry. ...
- Java 发送Get和Post请求
package com.htpt.superviseServices.dm.util; import java.io.BufferedReader; import java.io.IOExceptio ...