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


How to determine if my program is gonna give TLE ??

I have recently tried solving the questions in the long challenge, in the greedy candidates questions I tried implementing it in java and got 2.1s and TLE, how to understand why it gave TLE and how to overcome it??

asked 19 Aug '17, 18:40

x_blitz_x's gravatar image

accept rate: 0%

Dont use scanner class for taking input. In that 2 second time, I bet that a huge chunk of your time is taken in just taking input. Google and copy the Fast I/O template of java, and re-run the same code.


answered 19 Aug '17, 18:48

vijju123's gravatar image

5★vijju123 ♦♦
accept rate: 18%

edited 19 Aug '17, 18:49

thanks a lot!

(19 Aug '17, 19:21) x_blitz_x1★

Use Buffer Reader or any other fast I/O template for taking input.
Also, in case you didn't know about time complexity, this link will be helpful!


answered 19 Aug '17, 18:58

dishant_18's gravatar image

accept rate: 12%

edited 19 Aug '17, 18:58

thanks a lot!

(19 Aug '17, 19:21) x_blitz_x1★
Answer is hidden as author is suspended. Click here to view.

answered 19 Aug '17, 19:11

raj79's gravatar image

accept rate: 10%

thanks a lot!

(19 Aug '17, 19:21) x_blitz_x1★

I found an answer for this question in detail here

I hope you will find it helpful.


answered 19 Aug '17, 20:23

adnanli's gravatar image

accept rate: 33%

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

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


question asked: 19 Aug '17, 18:40

question was seen: 384 times

last updated: 19 Aug '17, 20:23