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

×

Determining whether algorithm runs in given time limit

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

ghostrider_kgp's gravatar image

3★ghostrider_kgp
11
accept rate: 0%

edited 13 Jul '14, 13:02


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 .

  1. Get an idea of the complexity of the problem .
  2. 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 .

link

answered 13 Jul '14, 13:05

the65bit's gravatar image

4★the65bit
1.1k101328
accept rate: 13%

edited 13 Jul '14, 13:09

toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×715

question asked: 13 Jul '14, 13:00

question was seen: 718 times

last updated: 13 Jul '14, 13:09