1 solutions

  • 0
    @ 2025-12-15 22:02:44
    #include<bits/stdc++.h>
    using namespace std;
    int n,a,c,ans;
    map<int,int>mp; 
    int main()
    {
    	cin>>n;
    	for(int i=1;i<=n;i++)
    	{
    		cin>>a>>c;
    		if(mp[c])
    		{
    			mp[c]=min(a,mp[c]);
    		}
    		else
    		{
    			mp[c]=a;
    		}
    	}
    	for(auto x:mp)
    	{
    		ans=max(ans,x.second);
    	}
    	cout<<ans;
    	return 0;
    }
    
    • 1

    Information

    ID
    2737
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    10
    Tags
    # Submissions
    3
    Accepted
    3
    Uploaded By