Sunday, March 12, 2023

Codeforces Round 405 (rated, Div. 2, based on VK Cup 2017 Round 1) - 791 A Bear and Big Brother solution

After years, maybe 9 or 10, of being away from competitive programming, I'm finally back, and glad :)

I love competitive programming. I missed it. I missed those days in 2013 and 2014 when I would be listening to music in the background and would be coding. Finally, I'm back. This time I think I have brought with me the different skill set: Linux and Emacs. 

Anyway, let's get to the business. This is the solution for Codeforces Round 405 (rated, Div. 2, based on VK Cup 2017 Round 1) - 791 A Bear and Big Brother. 


  1. #include <stdio.h>
  2.  
  3. int main() {
  4. #ifndef ONLINE_JUDGE
  5. freopen("input.txt", "r", stdin);
  6. freopen("output.txt", "w", stdout);
  7. #endif
  8.  
  9. int a, b, c=0;
  10. scanf("%d %d", &a, &b);
  11. while(a<=b) {
  12. a=a*3, b=b*2, c++;
  13. }
  14. printf("%d\n", c);
  15. return 0;
  16. }

No comments:

Post a Comment