Codeforces 456A. Laptops Solutions

  1. Solve in C++:
  2. ///**********ALLAH IS ALMIGHTY************///
  3. ///AH Tonmoy
  4. ///Department of CSE
  5. ///Islamic University,Bangladesh
  6. #include<iostream>
  7. using namespace std;
  8. int main()
  9. {
  10.  
  11. int ar[100009],br[100009],n,i,c1=0,c2=0;
  12. cin>>n;
  13. for(i=0; i<n; i++)
  14. {
  15. cin>>ar[i]>>br[i];
  16. }
  17. for(i=0; i<n; i++)
  18. {
  19. if(ar[i]<br[i])
  20. {
  21. c1=1;
  22. cout<<"Happy Alex"<<endl;
  23. break;
  24. }
  25. if(c1==1)
  26. break;
  27. }
  28. if(c1==0)
  29. cout<<"Poor Alex"<<endl;
  30. }

No comments

Most View Post

Recent post

Codeforces Round 925 (Div. 3) 1931D. Divisible Pairs Solution

    Problem Link  :   https://codeforces.com/contest/1931/problem/D S olution in C++: /// Author : AH_Tonmoy #include < bits / stdc ++. ...

Powered by Blogger.