HDU 1029: Ignatius and the Princess IV
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了HDU 1029: Ignatius and the Princess IV相关的知识,希望对你有一定的参考价值。
Ignatius and the Princess IV
///@author Sycamore ///@date 8/8/2017 #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; while (cin >> n) { map<int, int>v; int t,ans=-1; for (int i = 1; i <=n; i++) { cin >> t; if(ans==-1) if (++v[t] >= ((n + 1) >> 1)) ans = t; } cout << ans << endl; } return 0; }
以上是关于HDU 1029: Ignatius and the Princess IV的主要内容,如果未能解决你的问题,请参考以下文章
[2016-03-27][HDU][1029][Ignatius and the Princess IV]
HDU 1029: Ignatius and the Princess IV
HDU 1029 Ignatius and the Princess IV
HDU 1029 Ignatius and the Princess IV