Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- bool sortbysec(const pair<int,int> &a, const pair<int,int> &b)
- {
- return (a.second>b.second);
- }
- int main(){
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- int n;
- cin>>n;
- vector< pair<int,int> > vec;
- while(n--)
- {
- int t,h;
- cin>>t>>h;
- vec.push_back(make_pair(t,h));
- }
- int ct=0;
- sort(vec.begin(),vec.end());
- for(int i=0;i<vec.size()-1;i++){
- if(vec[i].first<vec[i+1].first && vec[i].second> vec[i+1].second ){
- cout<<"Happy Alex"<<endl;
- ct=1;
- break;
- }
- else if(i!=vec.size()-1){
- continue;
- }
- }
- if(ct==0){
- cout<<"Poor Alex"<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment