Advertisement
Guest User

Untitled

a guest
Mar 13th, 2019
2,178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement