SHARE
TWEET

Untitled

a guest Mar 26th, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7. int main()
  8. {
  9.     int N, a, b;
  10.     vector <pair<int,int>> v;
  11.     bool f = false;
  12.     cin >> N;
  13.     for (int i = 0; i < N; i++) {
  14.         cin >> a;
  15.         cin >> b;
  16.         v.push_back(make_pair(a,b));
  17.     }
  18.     sort(v.begin(), v.end());
  19.     for (int i = 0; i < N; i++) {
  20.         if (f == true) {
  21.             break;
  22.         }
  23.         if(i + 1 == N) {
  24.             break;
  25.         }
  26.         if (v[i].first < v[i + 1].first && v[i].second > v[i + 1].second) {
  27.             f = true;
  28.             break;
  29.         }
  30.     }
  31.     if (f == true) {
  32.         cout << "Happy Alex";
  33.     }
  34.     else {
  35.         cout << "Poor Alex";
  36.     }
  37.     return 0;
  38. }
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