Bark to Unlock CodeForces
来源:互联网 发布:鸿博客票网络诈骗 编辑:程序博客网 时间:2024/06/06 18:15
判自身,判相接
#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <string>#include <cmath>#include <set>#include <map>#include <stack>#include <queue>#include <ctype.h>#include <vector>#include <algorithm>#include <sstream>#define PI acos(-1.0)#define in freopen("in.txt", "r", stdin)#define out freopen("out.txt", "w", stdout)using namespace std;typedef long long ll;const int maxn = 1000 + 7, INF = 0x7f7f7f7f, mod = 1e9 + 7;int n;char s[4], t[6];int main() { scanf("%s", s); scanf("%d", &n); int f1 = 0, f2 = 0; for(int i = 0; i < n; ++i) { scanf("%s", t); if(t[0] == s[0] && t[1] == s[1]) { f1 = f2 = 1; } if(t[0] == s[1]) f1 = 1; if(t[1] == s[0]) f2 = 1; } if(f1 + f2 == 2) puts("YES"); else puts("NO"); return 0;}
阅读全文
1 0
- Bark to Unlock CodeForces
- codeforces 868A Bark to Unlock
- Codeforces 868A Bark to Unlock 水题
- Codeforces Round #438 A. Bark to Unlock
- CodeForces 868A Bark to Unlock
- codeforces 868A Bark to Unlock
- Codeforces868A Bark to Unlock
- Codeforces 868 A Bark to Unlock(水题)
- 【模拟】Codeforces Round #438 A. Bark to Unlock 题解
- Codeforces Round #438 (Div. 1 + Div. 2 combined) A. Bark to Unlock(模拟)
- Codeforces Round #438 (Div. 1 + Div. 2 combined) A. Bark to Unlock
- CF 868 A. Bark to Unlock 【简单匹配】
- How to unlock computer
- Two ways to unlock iphone4
- how to unlock /opt in ubuntu
- Enter password to unlock your login keyring
- How to unlock user in DB
- Tip of today-Bark to the Wrong Tree 狂犬吠树?
- 铺砖问题
- 4. Median of Two Sorted Arrays——LeetCode OJ
- jQuery最佳实践
- Eclipse卸载Spring Tool Suite插件后无法启动
- SNMP的意思简单理解 LocateRegistry的含义
- Bark to Unlock CodeForces
- 9.oracle简单表查询
- 有关数据库的代称
- 深度学习笔记(6)——CNN中的卷积block
- CodeForces
- java并发实战第七章
- <DP>codevs 2189 数字三角形w
- Java中的集合框架
- POJ 1026 Cipher(置换+循环节)