-
Notifications
You must be signed in to change notification settings - Fork 7
/
Chapter6
51 lines (42 loc) · 806 Bytes
/
Chapter6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
using namespace std;
int main(){
ll n,i;
cin >> n;
ll p1,q1;
vector<pair <ll,ll> > a;
pair <ll,ll> c1;
for (i=0;i<n;i++){
cin >> p1 >> q1;
c1 = make_pair(p1,q1);
a.push_back(c1);
}
/*
for (i=0;i<n;i++){
cout << a[i].first << " " << a[i].second << endl;
}
cout << endl;
*/
sort(a.begin(),a.end());
/*
for (i=0;i<n;i++){
cout << a[i].first << " " << a[i].second << endl;
}
*/
int flag=0;
for(i=0;i<n-1;i++){
if(a[i].second>a[i+1].second){
flag=1;
break;
}
}
if(flag==1){
cout << "Happy Alex\n";
}
else{
cout << "Poor Alex\n";
}
}