Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 39796

KAN13G - Editorial

$
0
0

PROBLEM LINK:

Practice
Contest

Author: Dr. M Kaykobad
Tester:Jingbo Shang
Editorialist:Jingbo Shang

DIFFICULTY:

Easy

PREREQUISITES:

Greedy

PROBLEM:

Given a coin system, with 1 and 0.01, greedily determine the change plan for some given values.

EXPLANATION:

Because we need to use as many larger coin as possible, we first sort the coins in decreasing order. And then, greedily select coins as many as possible.

It will be better if you use integers rather than decimals by multiplying all input values with 100.

AUTHOR'S AND TESTER'S SOLUTIONS:

Author's solution can be found here.
Tester's solution can be found here.


Viewing all articles
Browse latest Browse all 39796

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>