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

×

getting TLE in 'gcdqueries'..how to reduce compile time.

I am using a simple algorithm, which passed some testcases and gave 40 points..In the question it is given that USE FASTER IO.. Can anyone tell me what does it mean...I am using C.

asked 04 Jan '15, 13:37

shivansh812's gravatar image

2★shivansh812
11
accept rate: 0%

edited 12 Jan '15, 15:13

admin's gravatar image

0★admin ♦♦
19.8k350498541

1

Surely because your algorithm is not efficient enough. I got perfect score in Python and so did many. Think of the algorithm, not IO

(05 Jan '15, 16:51) chefkaushik942★

Generally in some languages I/O takes very large time.Example "cin/cout" in C++.So you should use Faster I/O, for those languages.

I don`t think there is any such problem with C.

Try to solve this question enormous input test.

Hope it helps.

Happy Coding!!!

link

answered 04 Jan '15, 13:40

the65bit's gravatar image

4★the65bit
1.1k101328
accept rate: 13%

edited 04 Jan '15, 13:42

Try to concentrate on improving the algorithm efficiency rather than going for fast io. Generally original solution is tested on all popular languages and the time limit is adjusted according to it...

link

answered 04 Jan '15, 17:12

saichandu6's gravatar image

4★saichandu6
93
accept rate: 0%

No, its not !

(05 Jan '15, 16:50) chefkaushik942★

Well, my solution passed after implementing my own fast i/o, was getting TLE with scanf, and I'm 100% sure that it's best possible complexity, so maybe the time limit is too strict.

link

answered 04 Jan '15, 18:53

vladamg98's gravatar image

4★vladamg98
395257
accept rate: 5%

There may be much more optimization which can be done to the problem in order pass the complete test case. Think on what to do and code accordingly. try using fast i/o. it may be one of the reason.

Take care.

link

answered 04 Jan '15, 19:58

goutham7_4's gravatar image

3★goutham7_4
112
accept rate: 0%

My code is passing The Enormous Input Test http://www.codechef.com/viewsolution/5746564, But Still getting TLE in this GCDQueries problem

link

answered 04 Jan '15, 21:48

codehalwai's gravatar image

1★codehalwai
11
accept rate: 0%

@codehalwai I am not sure but this may be because your algorithm is not efficient enough.

link

answered 04 Jan '15, 21:58

the65bit's gravatar image

4★the65bit
1.1k101328
accept rate: 13%

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:

×717
×9

question asked: 04 Jan '15, 13:37

question was seen: 1,798 times

last updated: 12 Jan '15, 15:13