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 971 (Div. 4) 2009C. The Legend of Freya the Frog Solution

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

Powered by Blogger.