Submission #168790
Source Code Expand
#include <iostream> #include <map> #include <string> using namespace std; int main() { map<string,int> m; int N; scanf("%d",&N); for(int i=0;i<N;i++) { string S; cin>>S; if(m.find(S)==m.end()) { m[S]=1; }else { m[S]++; } } int x=0; string name; for(map<string,int>::iterator it=m.begin();it!=m.end();it++) { if(it->second>x) {x=it->second;name=it->first;} } cout<<name<<endl; }
Submission Info
Submission Time | |
---|---|
Task | B - 投票 |
User | Div9851 |
Language | C++ (G++ 4.6.4) |
Score | 0 |
Code Size | 428 Byte |
Status | CE |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:8:15: error: ‘scanf’ was not declared in this scope