1 solutions

  • 0
    @ 2026-1-12 16:26:56
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	map<int,int> h;
    	for(int i=1;i<=n;i++)
    	{
    		int a,c;
    		cin>>a>>c; //c是颜色,a是分数
    		if(h.count(c)) 
    		{
    			h[c]=min(h[c],a);
    		}
    		else{
    			h[c]=a;
    		}
    	}
    	int ans=-1;
    	for(auto x:h)
    	{
    		ans=max(ans,x.second);
    	}
    	cout<<ans;
    	return 0;
    }
    
    • 1

    Information

    ID
    2737
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    9
    Tags
    # Submissions
    11
    Accepted
    4
    Uploaded By