1 solutions

  • 0
    @ 2024-5-6 12:04:26
    #include <iostream>
    
    using namespace std;
    
    const int MAXN = 1e5 + 5;
    
    int k[MAXN],p[MAXN];
    int n,R;
    int ans = 0;
    
    int main(){
    	cin >> n >> R;
    	for (int i=1;i<=n;i++)
    		cin >> k[i] >> p[i];
    		
    	for (int i=1;i<=n;i++)
    		if (R >= p[i])
    			ans = max(ans, k[i]);
    	
    	cout << ans << endl;
    }
    
    • 1

    Information

    ID
    7933
    Time
    1000ms
    Memory
    512MiB
    Difficulty
    1
    Tags
    # Submissions
    123
    Accepted
    48
    Uploaded By