2 solutions

  • 0
    @ 2025-8-26 12:04:34
    #include <bits/stdc++.h>
    using namespace std;
    int n;
    struct F 
    {
    	string s;
    	int k;
    }a[105];
    bool cmp(F x, F y)
    {
    	return x.k > y.k;
    }
    int main()
    {
    	cin >> n;
    	for (int i = 1;i <= n;i++)
    	{
    		cin >> a[i].s >> a[i].k;
    	}
    	sort (a + 1, a + n + 1, cmp);
    	cout << a[1].s;
    	return 0;
    }
    

    Information

    ID
    1035
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    7
    Tags
    # Submissions
    49
    Accepted
    12
    Uploaded By