1 solutions

  • 1
    @ 2026-5-31 11:29:59
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n;cin>>n;
        map<string,int> h;
        for(int i=1;i<=n;i++)
        {
            string x;cin>>x;
            h[x]++;
        }
        int mx=0;
        string s;
        for(auto x:h)
        {
            if(x.second>mx) mx=x.second,s=x.first;
        }
        cout<<s;
        return 0;
    }
    
    • 1

    Information

    ID
    2616
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    # Submissions
    23
    Accepted
    9
    Uploaded By