Codeforces Round #438
来源:互联网 发布:西服 知乎 编辑:程序博客网 时间:2024/06/08 05:16
题意:
给你一个目标字符串(长度2),给你n个字符串(长度2),任意连接着n个字符串,看能不能组成目标字符串。
POINT:
水题,尾和头连就行,或者本来就已经存在这个目标字符串特判。
#include <iostream>#include <string.h>#include <stdio.h>#include <vector>#include <algorithm>using namespace std;#define LL long longint xian[333];int hou[333];int main(){ char s[4]; cin>>s; int n; cin>>n; int flag=0; for(int i=1;i<=n;i++){ char ss[4]; cin>>ss; if(strcmp(ss,s)==0){ flag=1; } xian[ss[0]]=1; hou[ss[1]]=1; } if(flag){ printf("YES\n"); return 0; } if((hou[s[0]]&&xian[s[1]])){ printf("YES\n"); }else{ printf("NO\n"); }}
阅读全文
0 0
- Codeforces Round #438 题解
- Codeforces Round #438 题解
- Codeforces Round #438 B
- Codeforces Round #438
- Codeforces Round #438
- Codeforces Round #438
- Codeforces Round #438
- 【codeforces】Codeforces Round #363
- Codeforces Round #438 C. Qualification Rounds
- Codeforces Round #438 868A/B/C
- Codeforces Round #438 C. Qualification Rounds 二进制
- Codeforces Round #438 A. Bark to Unlock
- Codeforces Round #438 B. Race Against Time
- codeforces round #438 C. Qualification Rounds
- Codeforces Round #438 C. Qualification Rounds 题解
- Codeforces Round #438 C. Qualification Rounds
- Codeforces Round #270 Codeforces Round #270
- 【Codeforces】Codeforces Round #271 div2
- IDEA Maven打包时报找不到符号错误
- GitHub Tips
- nyoj255C小加 之 随机数
- 冒泡排序
- java基础_温故知新
- Codeforces Round #438
- VS Code的快捷键
- Codeforces Round #439C 组合数-The Intriguing Obsession
- 从React专利事件看开源软件许可
- python中的字典详细介绍
- 实验二线性表综合实验
- MarkDown编辑器的使用
- UVA
- 全局变量与局部变量