ZOJ 3492 Kagome Kagome
2016-03-13 20:20
477 查看
#include <algorithm> #include <iostream> #include <cstring> #include <cstdlib> #include <cstdio> #include <string> #include <vector> #include <queue> #include <stack> #include <cmath> #include <ctime> #include <list> #include <set> #include <map> using namespace std; typedef long long ll; #define PB push_back #define UB upper_bound #define LB lower_bound #define MP make_pair #define pii pair<int,int> #define vi vector<int> #define vii vector<vi> #define mst(x,y) memset(x,y,sizeof(x)) #define fr(x) freopen(x,"r",stdin) #define fw(x) freopen(x,"w",stdout) #define iin(x) scanf("%d",&x) #define complete_unique(a) a.erase(unique(a.begin(),a.end()),a.end()) #define sp system("pause") #define INF 1e9 #define MAXN 100005 #define PI acos(-1.0) #define eps 1e-10 const int MOD = 1e9 + 7; double a[500+20]; int main() { int t; cin >> t; while(t--) { int n; cin >> n; string h; cin >> h;int mark = 1; string s[111]; for(int i = 1;i <= n;i++) { cin >> s[i]; if(s[i] == h) mark = i; } if(mark > n / 2) cout << s[mark - n / 2] << endl; else cout << s[mark + n / 2] << endl; } return 0; }
相关文章推荐
- POJ 2762 Going from u to v or from v to u? (强连通分量缩点+拓扑排序)
- 我与小娜(35):AlphaGo第四局为何输了?
- Go语言并发之美
- Machine Learning - Neural Networks for Multi-class Classification
- 除百度、Google外其他蜘蛛IP封锁脚本
- HibernateTemplate、HibernateDaoSupport两种方法实现增删改查Good
- 【大雾】关于mongoose的model的小问题
- 【大雾】mongoose中createConnection和connect的大坑!
- The 8th Zhejiang Provincial Collegiate Programming Contest-> Kagome Kagome
- 李世石首胜谷歌AlphaGo
- 李世石首胜谷歌AlphaGo
- uva11292 The Dragon of Loowater
- ubuntu14.04 and ros indigo install kinect driver--16
- Django 学习笔记二
- Golang websocket使用方法
- django中的分页
- Django 学习笔记一
- 一些重要的算法The Most Important Algorithms
- Django实战教程 分页列表
- Django分页的基本实现办法