Codeforces 43A. Football Solution
Solution in C++:
///La ilaha illellahu muhammadur rasulullah
///******Bismillahir-Rahmanir-Rahim******///
///AH Tonmoy
///Department of CSE,23rd batch
///Islamic University,Bangladesh
- #include <bits/stdc++.h>
- using namespace std;
- map<string,int>ms;
- int main()
- {
- int n,mx=0,i;
- string s,ans;
- cin>>n;
- for(i=0; i<n; i++)
- {
- cin>>s;
- ms[s]++;
- if(ms[s]>mx)
- {
- mx=ms[s];
- ans=s;
- }
- }
- cout<<ans<<endl;
- }
No comments