getting TLE in 'gcdqueries' 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.

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!!!

1 Like

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…

1 Like

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.

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.

My code is passing The Enormous Input Test, But Still getting TLE in this GCDQueries problem

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

No, its not !

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

1 Like