GLJIVE - GLJIVE
In front of Super Mario there are 10 mushrooms, arranged in a row. A certain amount of points is awarded for picking each of the mushrooms. Super Mario must pick mushrooms in order they appear, but is not required to pick them all – his goal is to score a number of points as close as possible to 100.
In case there exist two such numbers which are equally close to 100 (e.g. 98 and 102), Mario will pick the greater one (in this case 102).
Help Super Mario and tell him how many points he will score.
Input
Input consists of 10 lines, each of which contains one positive integer less than or equal to 100, denoting the scores awarded for picking each mushroom, in the order that Mario can pick them in.
Output
The first and only line of output must contain the required number of points.
Example
Input: 10 20 30 40 50 60 70 80 90 100 Output: 100
hide comments
Vipul Pandey:
2013-01-19 15:22:28
problem description is very confusing.. but a very easy question if you understand it. Last edit: 2013-01-19 15:22:44 |
|
nitin suri:
2012-12-30 18:11:08
Can any 1 tell whats wrong in my prog?
|
|
strings:
2012-12-26 18:05:11
@ac srinivas, its 102... remember, mario takes all mushrooms in series... and what i thought after reading the statement !!!
|
|
code warrior:
2012-10-01 20:11:45
i solved it as modified knapsack..
|
|
akb:
2012-09-17 21:21:51
"score a number of points as close as possible to
|
|
eliminator:
2012-09-17 16:51:26
simple if else :)
|
|
AC Srinivas:
2012-08-21 10:01:17
@Centurion @darky
|
|
Sumit Kumar Satnalika:
2012-07-09 19:42:08
my code is working properly...still it is showing W.A....why????
|
|
napster:
2012-06-18 06:24:28
nice one!!! |
|
Darky:
2012-06-16 21:00:37
@Centurion 102 |
Added by: | akaki |
Date: | 2011-02-13 |
Time limit: | 0.205s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | coci |