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

×

Please help me in problem NUKES

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

manan_'s gravatar image

0★manan_
1
accept rate: 0%

converted to question 29 Jan '18, 22:55

vijju123's gravatar image

4★vijju123 ♦♦
15.4k12065


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

link

answered 30 Jan '18, 17:25

umesh9414's gravatar image

5★umesh9414
182
accept rate: 12%

toggle preview
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