×

# Determining whether algorithm runs in given time limit

 0 hey guys i am new to competitive coding. Please help me regarding time limit issues. I am talking with respect to http://www.codechef.com/problems/NI02. This problem have time limit 3 second. Q1) Single source shortest path solution have 0( n^2 ) time complexity. How one will detrmine considering (maximum input size)*(#test cases) whether algo will run within time limit. Q2) I have submitted solution it got executed in 0.88. Can we approximately determine this value or at least maximum value in question 1 Or what is number of operations per second in codechef judging environment. asked 13 Jul '14, 13:00 1●1 accept rate: 0%

 1 Approximately 10^8 number of operation per second are run in the coding environment . You can get an idea if it will run in the time limit this way . Get an idea of the complexity of the problem . Get an idea of the total operation it will require . For example , as complexity is O(n^2) therefore for n=2500 , in the worst case . Therefore operations = 25002500 = 6.25 10^6 . Also since there are 10 test cases , therefore operations = 6.25*10^7 . Since it is less than 10^8 , it will run in the time limit . answered 13 Jul '14, 13:05 4★the65bit 1.1k●10●13●28 accept rate: 13%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×715

question asked: 13 Jul '14, 13:00

question was seen: 718 times

last updated: 13 Jul '14, 13:09