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

×

how to reduce compilation time in C ??

I am getting TLE in my program .. using for loops 2 times & it is showing TLE..how to optimize my algorithm?? plz help

asked 05 Jan '14, 23:26

shantanu10's gravatar image

2★shantanu10
45336
accept rate: 0%

are u sure u want to reduce the compilation time...:P

(06 Jan '14, 21:15) kunal3614★

Optimization will depend on type and category of problem. for example if problem is sorting then it can be optimized from O(n^2) to O(n) but not below that. Share your problem and solution,then only any one can help.

Vaguely I can just suggest, try to do a thing in linear time i.e O(n) time rather than O(n^2) if it is giving TLE.

link

answered 06 Jan '14, 02:21

c0d3_k1ra's gravatar image

2★c0d3_k1ra
175118
accept rate: 11%

Actually the problem is from live contest and that's why I won't be able to discuss it here..but thanks for the advice

(06 Jan '14, 15:56) shantanu102★

if you use c++, then prefer scanf and printf over cin and cout, will compile quicker. i dont know any other trick yet.

link

answered 06 Jan '14, 02:41

garakchy's gravatar image

1★garakchy
1.1k163048
accept rate: 1%

yup. already using scanf & printf

(06 Jan '14, 15:57) shantanu102★
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:

×1,901
×1,650
×1,470
×715
×196
×29
×7
×6

question asked: 05 Jan '14, 23:26

question was seen: 18,477 times

last updated: 06 Jan '14, 21:15