bideshbanerjee444's blog

By bideshbanerjee444, history, 4 years ago, In English

for(int i = 2; i <= int(1e6); i++){
for(int j = 0; j <= int(1e6); j += i){

//Here anything which takes O(1) time.....

} }

  • Vote: I like it
  • -18
  • Vote: I do not like it

| Write comment?
»
4 years ago, hide # |
Rev. 2  
Vote: I like it +5 Vote: I do not like it

Complexity is O(nlogn), so it will pass.
Also, you can use custom invocation to check run time.