You are not logged in. Please login at to post your questions!


query regarding execution time.

suppose size of input could be n=1...100000 and complexity of my code is O(n3). will it be able to execute in 2 sec.

asked 28 May '16, 00:05

arpit728's gravatar image

accept rate: 10%

Generally you can do 10^7 to 10^8 calculations per second in any competitive platform.

In your case n will get max value of 10^5 so it require approx. 10^15 calculations.

so it will definitely exceed time limit of 2 seconds (It will exceed time limit of 1000 seconds).

I think you should make solution having time complexity of O(nlogn).


answered 28 May '16, 02:28

dhavalmehta's gravatar image

accept rate: 30%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 28 May '16, 00:05

question was seen: 619 times

last updated: 28 May '16, 02:28