796B Find The Bone
来源:互联网 发布:遇见app 知乎 编辑:程序博客网 时间:2024/06/08 00:25
#include<iostream>#include<vector>#include<string>#include<set>#include<map>#include<algorithm>#include<queue>#include<stack>#include<cstdio>using namespace std;int main(){int n, m, k;while (scanf("%d %d %d", &n, &m, &k)!=EOF){vector<bool> hole(n + 1, false);for (int i = 0; i < m; i++){int t;scanf("%d", &t);hole[t] = true;}int position = 1;bool flag = false;if (hole[position]) flag = true;for (int i = 0; i < k; i++){int a, b;scanf("%d %d", &a, &b);if (flag) continue;if (a == position || b == position){position = a + b - position;}if (hole[position]) flag = true;}printf("%d\n", position);}return 0;}
0 0
- 796B Find The Bone
- B. Find The Bone
- CodeForces 796B Find The Bone
- 【CodeForces 796B】Find The Bone
- 【Codeforces 796 B. Find The Bone】
- Find The Bone (Codeforces-796B)
- Codeforces Round #408 B. Find The Bone
- codeforces round#408(div.2) B. Find The Bone
- Codeforces Round #408 (Div. 2)-B. Find The Bone
- Codeforces Round #408 (Div. 2) B. Find The Bone
- Codeforces Round #408 (Div. 2) B.Find The Bone(模拟)
- cf find the bone
- Codeforces Round #408 (Div. 2) B. Find The Bone【模拟】水题~
- 0519 G2n#W2B-C Find The Bone
- UVA - 10921 - Problem B - Find the Telephone
- NYOJ B. Bone Collector
- Tempter of the Bone
- Tempter of the Bone
- 02_mysql连接阶段
- 版本号管理知识
- CNN:Case Study
- TCL初学之软件安装(1)
- STM32基础知识2-分享PWM输入模式捕捉4路PWM波形的周期和占空比
- 796B Find The Bone
- gazebo中的坐标系
- thinkPHP
- 创建MySQL用户名
- JDK 工具一览
- suwstojT1(0860)
- 知识导向
- [acm/icpc2016ChinaFinal][CodeforcesGym101194] Mr.Panda and TubeMaster费用流
- 数值积分(函数指针的运用)