博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
省赛热身赛之Kagome Kagome
阅读量:5829 次
发布时间:2019-06-18

本文共 2153 字,大约阅读时间需要 7 分钟。

原题:

Description

Kagome kagome, kago no naka no tori waItsu itsu deyaru? Yoake no ban niTsuru to kame to subetta.Ushiro no shoumen daare?
Translation:
Kagome kagome, the bird in the cage,when will you come out?In the evening of the dawn,the crane and turtle slipped.Who stands right behind you now?

Kagome Kagome is a Japanese children's game. One child is chosen as the oni (literally demon or ogre, but similar to the concept of "it" in tag) and sits blindfolded (or with their eyes covered). The other children join hands and walk in circles around the oni while singing the song for the game. When the song stops, the oni speaks aloud the name of the person behind him, and if he is correct, the person behind will exchange places with the oni.

Higurashi Tewi is playing Kagome Kagome with her n (n is even) friends as the oni now. She peeps to know who is right in front of her. Knowing the order of the children in circle and assuming that they keep distance evenly, it's easy to derive who is right behind her.

Input

There are multiple test cases. The first line of input is an integer T ≈ 100 indicating the number of test cases. 

The first line of each test case starts with an even number 1 ≤ n ≤ 100, followed by the name of the child who is right in front of Higurashi Tewi. The second line contains exactly n different names, listed in counterclockwise order. Name is an alphanumeric string whose length never exceeds 20. It's guaranteed that the child in front of Higurashi Tewi is always contained in the list exactly once.

Output

For each test case, output the name of the child who is right behind Higurashi Tewi.

Sample Input

32 AliceAlice Bob4 inuinu neko usagi kizune4 catdog cat rabbit fox

Sample Output

Bobusagifox分析:
不知道为什么用scanf和printf会报错??????????????????
原码:
#include
#include
#include
using namespace std;int main(){ int t, n, i, a; string name, str[110]; scanf("%d",&t); while (t--) { scanf("%d",&n); cin>>name;//不知道为什么用scanf会报错,以后就用cin了! a = 0; for (i=0; i
> str[i]; for (i=0; i
 
 

转载地址:http://rwodx.baihongyu.com/

你可能感兴趣的文章
asp.net怎样在URL中使用中文、空格、特殊字符
查看>>
路由器发布服务器
查看>>
实现跨交换机VLAN间的通信
查看>>
jquery中的data-icon和data-role
查看>>
python例子
查看>>
环境变量(总结)
查看>>
ios之UILabel
查看>>
Java基础之String,StringBuilder,StringBuffer
查看>>
1月9日学习内容整理:爬虫基本原理
查看>>
安卓中数据库的搭建与使用
查看>>
AT3908 Two Integers
查看>>
C++ 0X 新特性实例(比较常用的) (转)
查看>>
node生成自定义命令(yargs/commander)
查看>>
各种非算法模板
查看>>
如何创建Servlet
查看>>
.NET 设计规范--.NET约定、惯用法与模式-2.框架设计基础
查看>>
win7 64位+Oracle 11g 64位下使用 PL/SQL Developer 的解决办法
查看>>
BZOJ1997:[HNOI2010]PLANAR——题解
查看>>
BZOJ1014:[JSOI2008]火星人prefix——题解
查看>>
使用Unity3D引擎开发赛车游戏
查看>>