Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя Accidentally_Coder

Автор Accidentally_Coder, история, 3 года назад, По-английски

In the past DIV3 #725 D problem(https://codeforces.me/contest/1538/problem/D), this https://codeforces.me/contest/1538/submission/119201717 is my accepted code. But my previous code https://codeforces.me/contest/1538/submission/119201640 was getting TLE on test case 6. As soon I took integer variable in Divcnt() function of the TLE code, my code got AC. My question is, why did taking long long inside Divcnt() bring me TLE and why did int bring me AC whereas in the problem statement the range of a,b,k is up to 10^9. Also, when I passed a,b in the Divcnt() function from the main function, I passed them as long long, not as int. What is this sorcery!?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
3 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

I think long long calculations takes a lot more time than int calculations.

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    About twice as long, since they have twice as many bits (Long long has 64 bits while int has 32)