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


Please help me in problem NUKES

I am facing problem with this question:

My solution is:

I am getting time limit exceeded, only in case 5, 6 ,7. All other cases are being excepted. I tried optimizing the code by adding a while loop, but yet no effect. Please help.

asked 29 Jan '18, 21:37

manan_'s gravatar image

accept rate: 0%

converted to question 29 Jan '18, 22:55

vijju123's gravatar image

4★vijju123 ♦♦

I read your code but can't understand too much as I don't know that language.
However I solved the question. What I understand from question is
if we insert A particles then A%(n+1) will remain in 0th chamber and A/(n+1) will go in next. the same will repeat for next also. now A=a/(n+1); A%(n+1) will remain in 1st chamber and A/(n+1) will go in next, now A=a/(n+1); so on...
my solution is in java


answered 30 Jan '18, 17:25

umesh9414's gravatar image

accept rate: 12%

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: 29 Jan '18, 21:37

question was seen: 162 times

last updated: 30 Jan '18, 17:25