【Codeforces Round #438 A】Bark to Unlock
【链接】h在这里写链接
【题意】
【题解】
【错的次数】
【反思】
【代码】
#include <bits/stdc++.h>
using namespace std; const int N = 100; string s;
string ts[N+10]; int main()
{
//freopen("F:\\rush.txt","r",stdin);
ios::sync_with_stdio(0),cin.tie(0);
int n;
cin >> s;
cin >> n;
for (int i = 1;i <= n;i++)
cin >> ts[i];
for (int i = 1;i <= n;i++)
if (ts[i]==s)
return cout <<"YES"<<endl,0;
for (int i = 1;i <= n;i++)
{
string temp = "";
temp += ts[i][1];
temp += ts[i][0];
for (int j = 1;j <= n;j++)
{
temp[1] = ts[j][0];
if (temp==s)
return cout << "YES"<<endl,0;
}
}
cout << "NO"<<endl;
return 0;
}
【Codeforces Round #438 A】Bark to Unlock的更多相关文章
- 【Codeforces Round #438 C】 Qualification Rounds
[链接]h在这里写链接 [题意] 给你n个问题,每个人都知道一些问题. 然后让你选择一些问题,使得每个人知道的问题的数量,不超过这些问题的数量的一半. [题解] 想法题. 只要有两个问题. 这两个问题 ...
- 【Codeforces Round #438 B】Race Against Time
[链接]h在这里写链接 [题意] 时针.分钟.秒针走不过去. 问你从t1时刻能不能走到t2时刻 [题解] 看看时针.分钟.秒针的影响就好. 看看是不是在整时的位置就好. 然后看看影响到x不能到y; 然 ...
- 【Codeforces Round 438 A B C D 四个题】
题目所在比赛的地址在这里呀 A. Bark to Unlock ·述大意: 输入一个目标串.然后输入n(1<=n<=100)个串,询问是否可以通过这些串收尾相接或者它本身拼出目 ...
- Codeforces Round #438 (Div.1+Div.2) 总结
本来兴致勃勃的想乘着这一次上紫,于是很早很早的到了机房 但是好像并没有什么用,反而rating-=47 Codeforces Round #438(Div.1+Div.2) 今天就这样匆匆的总结一下, ...
- 【Codeforces #312 div2 A】Lala Land and Apple Trees
# [Codeforces #312 div2 A]Lala Land and Apple Trees 首先,此题的大意是在一条坐标轴上,有\(n\)个点,每个点的权值为\(a_{i}\),第一次从原 ...
- 【Codeforces Round 431 (Div. 2) A B C D E五个题】
先给出比赛地址啦,感觉这场比赛思维考察非常灵活而美妙. A. Odds and Ends ·述大意: 输入n(n<=100)表示长度为n的序列,接下来输入这个序列.询问是否可以将序列划 ...
- 【Codeforces Round】 #432 (Div. 2) 题解
Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017) A. Arpa and a research in Mexi ...
- 【Codeforces Round】 #431 (Div. 2) 题解
Codeforces Round #431 (Div. 2) A. Odds and Ends time limit per test 1 second memory limit per test ...
- 【Codeforces Round 1137】Codeforces #545 (Div. 1)
Codeforces Round 1137 这场比赛做了\(A\).\(B\),排名\(376\). 主要是\(A\)题做的时间又长又交了两次\(wa4\)的. 这两次错误的提交是因为我第一开始想的求 ...
随机推荐
- Android 最简洁的获取联系人头像的代码
ContentResolver cr = view.getContext().getContentResolver(); Uri uri = ContentUris.withAppendedId(Co ...
- POJ 2236 Wireless Network ||POJ 1703 Find them, Catch them 并查集
POJ 2236 Wireless Network http://poj.org/problem?id=2236 题目大意: 给你N台损坏的电脑坐标,这些电脑只能与不超过距离d的电脑通信,但如果x和y ...
- 【例题 4-1 UVA - 1339】 Ancient Cipher
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 位置其实都没关系了. 只要每个字母都有对应的字母,它们的数量相同就可以了. 求出每种字母的数量. 排序之后. 肯定是要一一对应的. ...
- Python模块学习笔记— —random
Python中的random模块用于生成随机数. random.random 函数原型 random.random() 生成一个范围在[0,1)的随机浮点数. import random print ...
- iOS_01_什么是ios
* ios是一款由苹果公司开发的操作系统(os是Operating Systen的简称),就像平时在电脑上用的Window XP.Window 7.都是操作系统. * 那什么是操作系统呢?操作系统其实 ...
- YUM查询软件信息
我们常会碰到这样的情况,想要安装一个软件,只知道它和某方面有关,但又不能确切知道它的名字.这时yum的查询功能就起作用了.你可以用yum search keyword这样的命令来进行搜索,比如我们要则 ...
- 各个RFC
RFC:Request For Comments(RFC),是一系列以编号排定的文件.文件收集了有关互联网相关信息,以及UNIX和互联网社区的软件文件.目前RFC文件是由Internet Societ ...
- “locktype”enum type 类型重定义问题的解决
作者:朱金灿 来源:http://blog.csdn.net/clever101 使用ado来连接数据库,结果出现这样一些编译错误: 1>f:\c++pro\iocptser\debug\msa ...
- blob-照片转换与展示
File转java.sql.Blob(照片)Struts2 public Blob photos(File zp) { Blob photo=null; try { FileInputStream f ...
- [D3] Load and Inspect Data with D3 v4
You probably use a framework or standalone library to load data into your apps, but what if that’s o ...