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

×

# Please help me in problem NUKES

 0 I am facing problem with this question: https://www.codechef.com/problems/NUKES My solution is: https://www.codechef.com/viewsolution/17193614 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 0★manan_ 1 accept rate: 0% 15.4k●1●20●65

One Answer:
 0 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 link https://www.codechef.com/viewsolution/17193614 answered 30 Jan '18, 17:25 18●2 accept rate: 12%
 toggle preview community wiki:
Preview

### 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:

×3,746
×2,716
×717

question asked: 29 Jan '18, 21:37

question was seen: 162 times

last updated: 30 Jan '18, 17:25