标签:cst ase span next contest distrib this hat ber
5 green red blue red red 3 pink orange pink 0Sample Output
red pink
代码:
#include <iostream> #include <cstdio> #include <queue> #include <map> using namespace std; int main() { int n; string a,max="a"; map<string,int> b; while(scanf("%d",&n)&&n) { b[max]=0; for(int i=1;i<=n;i++) { cin>>a; b[a]++; if(b[a]>b[max])max=a; } cout<<max<<endl; } }
标签:cst ase span next contest distrib this hat ber
原文地址:http://www.cnblogs.com/8023spz/p/7224910.html