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

×

[closed] guessing the game

getting tle in guessing game bcoz of nested loops ,, any alternative??

asked 08 Jun '14, 22:04

sparky007's gravatar image

2★sparky007
164511
accept rate: 0%

closed 09 Jun '14, 19:53

garakchy's gravatar image

1★garakchy
1.1k163048

The question has been closed for the following reason "Other" by garakchy 09 Jun '14, 19:53


Try different approach, be more mathematical, just a hint: there is no Nested loop required.

No more hints, cos its ongoing Contest. more detailed hints will be against rules

link

answered 08 Jun '14, 22:08

s1h33p's gravatar image

3★s1h33p
329239
accept rate: 15%

okay thanks

link

answered 08 Jun '14, 22:10

sparky007's gravatar image

2★sparky007
164511
accept rate: 0%

How did you decide, you are getting TLE becoz of nested loop ? If your nested loops are if & else only, they won't effect your time much, they are O(1).

Hint : Most probably, problem is somewhere else.

link

answered 09 Jun '14, 00:09

mkkhedawat's gravatar image

2★mkkhedawat
233
accept rate: 0%

somewhere else means???

link

answered 09 Jun '14, 11:23

srswain2's gravatar image

3★srswain2
1395612
accept rate: 0%

If you are using some loops such as for and while which run for long time with large inputs then it will show TLE because your program didnt stop in the stipulated time.

link

answered 09 Jun '14, 15:32

ashwanimk's gravatar image

3★ashwanimk
129125
accept rate: 3%

the solution is o(1) for each test case :D . 3-5 line answer(excluding includes and declarations). purely mathematical.

link

answered 09 Jun '14, 15:47

s1h33p's gravatar image

3★s1h33p
329239
accept rate: 15%

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,477

question asked: 08 Jun '14, 22:04

question was seen: 746 times

last updated: 09 Jun '14, 19:53