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

×

[closed] Getting TLE in my java solution using similar solution to others Accepted soulution.. plz Help

problem link

editorial link

my all submissions

all other users AC submission in java

plz someONe Help getting TLE exceed
i used same approach(algo) "sieve" as given above but geting TLE
I TRIED MY BEST TO OPTIMISE MYCODE TO GIVE AC BUT failed

asked 02 Apr '18, 12:53

hemant_dhanuka's gravatar image

5★hemant_dhanuka
533112
accept rate: 3%

closed 03 Apr '18, 20:51

The question has been closed for the following reason "The question is answered, right answer was accepted" by hemant_dhanuka 03 Apr '18, 20:51


Time limit is too tight for this question (2*0.127796 ~ 0.25 seconds for java). You can see my submissions-- https://www.codechef.com/status/BYTES4,vbt_95

I took same approach as you and got TLE. Even BufferedReader couldn't avoid TLE. Then i saw one submission of 0.14 seconds which used fastest method for reading input in java( refer https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/ ) Got accepted by using same method for fast input with 0.13 seconds execution time.

link

answered 03 Apr '18, 03:34

vbt_95's gravatar image

4★vbt_95
4406
accept rate: 27%

1

Thanks Bro, i did it using that 4th approach to take input.. myTest Case passed in .09 seconds..(i guess fastest among all submited solution of java ).. thank YOu Very Much ^_^

(03 Apr '18, 20:51) hemant_dhanuka5★

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,672
×319
×301
×5

question asked: 02 Apr '18, 12:53

question was seen: 208 times

last updated: 03 Apr '18, 20:51