2 solutions
-
0
##两个map,应该还是很好理解,就是映射之间的关系
#include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e6+5; int main() { map<string,int> q; map<int,string> max1; int n,_max=0; cin>>n; for(int i=0;i<n;i++) { string s; cin>>s; q[s]++; if(q[s]>_max) { _max=q[s]; max1[_max]=s; } } cout<<max1[_max]<<endl; return 0; }
- 1
Information
- ID
- 1096
- Time
- 1000ms
- Memory
- 16MiB
- Difficulty
- 2
- Tags
- # Submissions
- 45
- Accepted
- 30
- Uploaded By