Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main()
- {
- int N, a, b;
- vector <pair<int,int>> v;
- bool f = false;
- cin >> N;
- for (int i = 0; i < N; i++) {
- cin >> a;
- cin >> b;
- v.push_back(make_pair(a,b));
- }
- sort(v.begin(), v.end());
- for (int i = 0; i < N; i++) {
- if (f == true) {
- break;
- }
- if(i + 1 == N) {
- break;
- }
- if (v[i].first < v[i + 1].first && v[i].second > v[i + 1].second) {
- f = true;
- break;
- }
- }
- if (f == true) {
- cout << "Happy Alex";
- }
- else {
- cout << "Poor Alex";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement