M_A_Noman's blog

By M_A_Noman, history, 10 months ago, In English

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

  • Vote: I like it
  • +2
  • Vote: I do not like it

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
10 months ago, # |
  Vote: I like it +3 Vote: I do not like it

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

»
10 months ago, # |
  Vote: I like it 0 Vote: I do not like it

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

»
10 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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