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

Автор M_A_Noman, история, 11 месяцев назад, По-английски

Please help to calculate the time complexity of the following code

Code

Can this code pass in 1 second for large value of both n and m which can be in the rang of 1 - 1e9 The range of the test case is 10^4

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

»
11 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by M_A_Noman (previous revision, new revision, compare).

»
11 месяцев назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

what is the range of t(number of the test cases)?

»
11 месяцев назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by M_A_Noman (previous revision, new revision, compare).

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

You can just run and measure?

My guess — large n and m = 100 is the fattest case, and I don't think it's gonna pass in 1s

But: measure every time you have doubts