×

# NUKES REACTOR Problem(EASY)

 0 Sir, why are we taking mod of Particle Count with Max Count+1 as chamber value and then dividing it by Max Count+1... ? Which algorithm is this ? asked 04 Oct '12, 16:02 1★parasmth 31●2●2●6 accept rate: 0%

 2 If there are A particles, starting from 1 every time you reach Max Count + 1 particles, 1 particle is moved to the consecutive chamber and whole Max Count + 1 particles are destroyed. So, Particles left in the chamber is A % (Max Count + 1) And particles transferred to the next chamber is A / (Max Count + 1) since this will happen again and again starting from 1 to Max Count + 1. See this video it might help you Click answered 08 Oct '12, 18:06 336●4●10●19 accept rate: 3%
 1 The solution is basically writing A in the base of n+1. This is because at every n+1 particle the carry is taken over to the the next chamber. Think of this in terms of binary and then you'll be able to apply this for every base n+1. That being said, I'm not able to pass the 3rd test case even though I am 100% sure of my solution (all of them are clearing in 0.00s). Is there anything I should look out for in particular ? answered 08 Sep '17, 20:53 10●1 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×14

question asked: 04 Oct '12, 16:02

question was seen: 4,054 times

last updated: 08 Sep '17, 20:53