1 solutions

  • 1
    @ 2024-12-5 21:55:48
    #include <bits/stdc++.h>
    using namespace std;
    int main()
    {
        int n, r, k[10000], p[10000], mx = 0, j = 0;
        cin >> n >> r;
        for (int i = 0; i < n; i++)
            cin >> k[i] >> p[i];
        for (int i = 0; i < n; i++)
        {
            if (mx < k[i] && r >= p[i])
            {
                mx = k[i];
                j = i;
            }
        }
        cout << k[j];
        return 0;
    }
    

    Information

    ID
    706
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    6
    Tags
    (None)
    # Submissions
    126
    Accepted
    36
    Uploaded By