SHARE
TWEET

Untitled

a guest Mar 13th, 2019 650 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define int long long
  4. const int N = 101;
  5. int n;
  6. pair <int, int> a[N];
  7. signed main() {
  8.     #ifdef HOME
  9.         freopen("input.txt", "r", stdin);
  10.     #else
  11.         ios_base::sync_with_stdio(0); cin.tie(0);
  12.     #endif
  13.     cin >> n;
  14.     for (int i = 0; i < n; ++i) cin >> a[i].first >> a[i].second;
  15.     int p;
  16.     cin >> p;
  17.     for (int i = n - 1; i >= 0; --i) {
  18.         if (a[i].first <= p) {
  19.             cout << n - i << '\n';
  20.             exit(0);
  21.         }  
  22.     }  
  23. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top