This Forum is in read only mode now.

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

×

COOK104B testCase

hi i am not able to understand the test case of third question march cook off 2019. Can anybody tell me how we get 7 as the answer.Thankyou.

question link - https://www.codechef.com/COOK104A/problems/SONGSHOP

and this one

5 3 14

1 8 2

1 4 2

1 13 1

2 13 2

2 9 1

14 7 48

Ans - 5

asked 25 Mar, 13:32

dhruv_is_back's gravatar image

4★dhruv_is_back
112
accept rate: 0%

edited 25 Mar, 13:43


You can buy album 1 at cost of 10 and can also buy last song at 13 to total cost = 23 and greatness is 2+2+1+2 = 7...
For the second test case,
Buy album 1 at cost 14 and you will get 2+2+1=5 greatness...
Basically there are individual prices for each song and if you buy whole set of song(album) then you may get some discount on price...

link

answered 25 Mar, 13:59

l_returns's gravatar image

5★l_returns
1.6k211
accept rate: 23%

edited 25 Mar, 14:01

Thankyou and fuck i read input in reverse order which means I read it as (vi,pi,ai) and now when you explain it to me i realize i read it wrong fuck me ...and thankyou..

link

answered 25 Mar, 14:06

dhruv_is_back's gravatar image

4★dhruv_is_back
112
accept rate: 0%

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:

×569

question asked: 25 Mar, 13:32

question was seen: 180 times

last updated: 25 Mar, 14:06