Submit | All submissions | Best solutions | Back to list |
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
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 |
hide comments
|
||||||||||||||
2015-06-27 20:44:36 Baymax
1.Not worth your time 2.have to start selecting mushrooms from 1st one 3.cannot discard previously selected ones i.e. you can only do mushroom 1,2,3,4,.... but not 2,3,4.. nor 3,4,5 |
||||||||||||||
2015-06-26 11:36:54 root8950
-_- |
||||||||||||||
2015-06-16 05:28:50 Gaurav kumar
AC but irritated from the problem statement. |
||||||||||||||
2015-06-06 09:15:37 siddharth tiwari
people getting WA in 10th case. try- 9 9 1 0 2 0 0 1 0 EOF Its all about using correctly dealing with EOF. |
||||||||||||||
2015-06-04 04:28:33 Chirag Agarwal
Have a "CLOSE" look at this question :) |
||||||||||||||
2015-02-12 13:15:08 Dinesh
simple one! read carefully Last edit: 2015-02-12 13:22:04 |
||||||||||||||
2015-02-03 22:12:24 codedog
thanks Sunny Leone, comment helped :) |
||||||||||||||
2015-01-22 07:36:28 Kishlay Raj
try this 96 7 0 0 0 0 0 0 0 0 ans is 103 Last edit: 2015-01-22 07:38:37 |
||||||||||||||
2014-12-27 16:56:35 agaurav77
ty @ Anand Namdev. ACed ! |
||||||||||||||
2014-12-23 16:47:37 Anand
cant believe i didnt focused on the word "close" . It can be either sides guys .But closer then the other . Costed me 2 wa |