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

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

In the past DIV3 #725 D problem(https://mirror.codeforces.com/contest/1538/problem/D), this https://mirror.codeforces.com/contest/1538/submission/119201717 is my accepted code. But my previous code https://mirror.codeforces.com/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
  • Проголосовать: не нравится

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

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