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

×

What is wrong in this code?

Question link:Buying Sweets

My code link:Answer

When i write the same logic with different implementation i get a AC. Can someone please help me out?

Accepted solution link:AC answer link

asked 22 Dec '18, 13:18

dilbwag1's gravatar image

3★dilbwag1
1
accept rate: 0%


Oh man, Your whole code was right. You just forgot to add '=' in the condition in "any_of" statement, as the program should give -1 even when we have a note with value $sum$ % $x$.

Here is the solution. I just have added the '=' sign in it.

link

answered 22 Dec '18, 19:25

m_never_dies's gravatar image

4★m_never_dies
335
accept rate: 0%

edited 22 Dec '18, 19:28

Oh!!..thank you for the help....:)

(22 Dec '18, 19:53) dilbwag13★
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:

×316
×181
×14
×10

question asked: 22 Dec '18, 13:18

question was seen: 82 times

last updated: 22 Dec '18, 19:53