jakaria_hossain

codeforce - laptops

May 26th, 2019
70
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. scanf("%d",&n);
  7. pair<int,int>a[n];
  8. for(int i=0;i<n;i++)scanf("%d %d",&a[i].first,&a[i].second);
  9. sort(a,a+n);
  10. for(int i=0;i<n-1;i++)
  11. {
  12. if(a[i].first<a[i+1].first && a[i].second>a[i+1].second)
  13. {
  14. printf("Happy Alex\n");
  15. return 0;
  16. }
  17. }
  18. printf("Poor Alex\n");
  19. return 0;
  20. }
RAW Paste Data