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


Can anyone kindly explain the logic behind this solution???

Okay so I was solving this October cook off question:

I used simple logic. Like straight forward logic. But I got the much expected TLE. My solution is here: (dont even bother reading it's not worth it... )

So while going through the solutions I found this guy's answer:

I have no idea what on earth has he done! He has used God knows what algorithm!! Can anybody be a lamb and explain what he has done?? I have been trying to figure it out since forever...

This question is marked "community wiki".

asked 21 Oct '13, 15:57

thespacedude's gravatar image

accept rate: 6%

I think this post should be more than sufficient to explain the most common approach followed by most users


answered 21 Oct '13, 16:06

kcahdog's gravatar image

accept rate: 14%

Thanks a lot for the link... i din't know that there was a post already in place

(21 Oct '13, 16:12) thespacedude2★
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: 21 Oct '13, 15:57

question was seen: 881 times

last updated: 21 Oct '13, 16:12