Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A. Neverending competitions 水题
A. Neverending competitions
题目连接:
http://codeforces.com/contest/765/problem/A
Description
There are literally dozens of snooker competitions held each year, and team Jinotega tries to attend them all (for some reason they prefer name "snookah")! When a competition takes place somewhere far from their hometown, Ivan, Artsem and Konstantin take a flight to the contest and back.
Jinotega's best friends, team Base have found a list of their itinerary receipts with information about departure and arrival airports. Now they wonder, where is Jinotega now: at home or at some competition far away? They know that:
this list contains all Jinotega's flights in this year (in arbitrary order),
Jinotega has only flown from his hometown to a snooker contest and back,
after each competition Jinotega flies back home (though they may attend a competition in one place several times),
and finally, at the beginning of the year Jinotega was at home.
Please help them to determine Jinotega's location!
Input
In the first line of input there is a single integer n: the number of Jinotega's flights (1 ≤ n ≤ 100). In the second line there is a string of 3 capital Latin letters: the name of Jinotega's home airport. In the next n lines there is flight information, one flight per line, in form "XXX->YYY", where "XXX" is the name of departure airport "YYY" is the name of arrival airport. Exactly one of these airports is Jinotega's home airport.
It is guaranteed that flights information is consistent with the knowledge of Jinotega's friends, which is described in the main part of the statement.
Output
If Jinotega is now at home, print "home" (without quotes), otherwise print "contest".
Sample Input
4
SVO
SVO->CDG
LHR->SVO
SVO->LHR
CDG->SVO
Sample Output
home
Hint
题意
有个人要去参加比赛,他有n张飞机票,飞机票写着从A->B。
保证他只会两种旅行,home->xxx,xxx->home。
而且一开始在home
但是他的飞机票顺序是乱的,问你现在他在xxx,还是在home
题解:
其实飞机票都是误导你的。
如果飞机票数是偶数,那么就在家。
否则就在xxx
显然嘛。
代码
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
scanf("%d",&n);
if(n%2==0)cout<<"home"<<endl;
else cout<<"contest"<<endl;
}
Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A. Neverending competitions 水题的更多相关文章
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A B C D 水 模拟 构造
A. Neverending competitions time limit per test 2 seconds memory limit per test 512 megabytes input ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) A - Neverending competitions
地址:http://codeforces.com/contest/765/problem/A 题目: A. Neverending competitions time limit per test 2 ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) F. Souvenirs 线段树套set
F. Souvenirs 题目连接: http://codeforces.com/contest/765/problem/F Description Artsem is on vacation and ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) E. Tree Folding 拓扑排序
E. Tree Folding 题目连接: http://codeforces.com/contest/765/problem/E Description Vanya wants to minimiz ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) D. Artsem and Saunders 数学 构造
D. Artsem and Saunders 题目连接: http://codeforces.com/contest/765/problem/D Description Artsem has a fr ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) C. Table Tennis Game 2 水题
C. Table Tennis Game 2 题目连接: http://codeforces.com/contest/765/problem/C Description Misha and Vanya ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) B. Code obfuscation 水题
B. Code obfuscation 题目连接: http://codeforces.com/contest/765/problem/B Description Kostya likes Codef ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) E. Tree Folding
地址:http://codeforces.com/contest/765/problem/E 题目: E. Tree Folding time limit per test 2 seconds mem ...
- Codeforces Round #397 by Kaspersky Lab and Barcelona Bootcamp (Div. 1 + Div. 2 combined) D. Artsem and Saunders
地址:http://codeforces.com/contest/765/problem/D 题目: D. Artsem and Saunders time limit per test 2 seco ...
随机推荐
- Linux使用imagemagick的convert命令压缩图片、节省服务器空间
一.安装: sudo apt-get install imagemagick 二.说明 imagemagick的命令convert可以完成此任务,其参数-resize用来改变图片尺寸,可以直接指定像素 ...
- dedecms织梦让channelartlist标签支持currentstyle属性
打开include\taglib\channelartlist.lib.php 大约93行 找到: $pv->Fields['typeurl'] = GetOneTypeUrlA($typei ...
- 高并发数据库之MySql性能优化实战总结
向MySQL发送一个请求时MySQL具体的操作过程 慢查询 1.慢查询 SHOW VARIABLES LIKE '%quer%' 索引优化技巧 1.对于创建的多列索引(复合)索引,只要查询条件使用了最 ...
- Sublime Text 3 绿色汉化版 x64
之前做了<Sublime Text 2 绿色汉化版 x64>,这些天抽空做了下 ST3 的汉化.. 果然我没有任何理由爱上 ST3,不仅pojie麻烦,而且汉化更麻烦,菜单字符长度做了限制 ...
- spring Mvc + Maven + 拷贝插件 (十一)
maven-antrun-plugin:可用于在项目编译打包时,把文件指定的文件拷贝到指定的位置,我们打包一般都是打包到 项目 的target 文件下; <groupId>org.apac ...
- 第12月第26天 swift 下划线
1. The _ is used to define that the parameter is not named If you have multiple _ it states that you ...
- python 入门基础23 选课系统 项目
选课系统 代码地址:github_code # 选课系统 # 角色:学校.学员.课程.讲师 # 要求: # 1. 创建北京.上海 2 所学校 # 2. 创建linux , python , go 3个 ...
- linux笔记_day10_shell编程
1.shell编程 编程语言 静态语言:编译型语言 强类型(变量在使用前,必须事先声明) 事先转换成可执行语言 动态语言:解释型语言 弱类型(变量用时声明,拿来直接用,甚至不区分数据类型,一般默认都为 ...
- casperjs get开头的几个dom操作使用
getCurrentUrl() Signature: getCurrentUrl() Retrieves current page URL. Note that the url will be url ...
- IIS 无法识别的属性“targetFramework”---解决之道
在安装VS2010后,应用.NET Framework 4创建的网站放在IIS(7.0)下会出现如下的错误: 其中的“版本信息”中告诉了我们.NET Framework和ASP.NET的版本都是2.0 ...