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

×

[closed] spoj BYECAKES

http://www.spoj.com/problems/BYECAKES/

https://ideone.com/GdbHQs

Getting WA repeatedly. Can't find the error in my logic. Can anyone Help??

asked 12 Nov '14, 21:23

abeyaar's gravatar image

1★abeyaar
33422140
accept rate: 30%

closed 21 Dec '14, 14:24

Have you tried using C++?

(13 Nov '14, 03:20) michelangelo4★

No, I dont't think language is a problem here. The only difference between my code and the accepted ones seems to be in the ratio line http://qr.ae/mK44O. But still I dont find anything wrong in my logic of taking ratios

(13 Nov '14, 05:54) abeyaar1★

I can't find anything wrong with your logic. Someone must answer this question. But I would like to point out one thing: b[0]+=max-b[0]; does nothing but assigning max to b[0]. Same for b[1],b[2],b[3].

(13 Nov '14, 23:05) michelangelo4★

Yeah I knew that before..but still can't find anything wrong

(14 Nov '14, 07:13) abeyaar1★
(25 Nov '14, 12:55) abeyaar1★
(21 Dec '14, 13:34) abeyaar1★
showing 5 of 6 show all

The question has been closed for the following reason "The question is answered, right answer was accepted" by abeyaar 21 Dec '14, 14:24


check for input 0 0 0 0 its a tricky case of this question ,i guess.. answer should be 0 right? as he's not wasting anything.. https://ideone.com/mlqFRv

link

answered 21 Dec '14, 14:07

dracowane's gravatar image

6★dracowane
59316
accept rate: 48%

lol..thanks mate such a bad mistake on my part of not checking the boundary cases. :)

(21 Dec '14, 14:23) abeyaar1★

anytime :)

(21 Dec '14, 14:29) dracowane6★

but one thing.. after adding this tricky case i still didn't got a AC :P

(21 Dec '14, 14:36) dracowane6★

https://ideone.com/LI0jz6 You can use this Solution for reference. And can you also look into http://discuss.codechef.com/questions/59132/spoj-brckts-runtime-error-nzec

(21 Dec '14, 14:39) abeyaar1★

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:

×1,134

question asked: 12 Nov '14, 21:23

question was seen: 3,320 times

last updated: 21 Dec '14, 14:39