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
|
Praneeth :
2016-05-26 19:00:13
check for equally close to 100 also |
|
Siddharth Singh:
2016-05-24 09:55:20
Costed Me 3 WA's (Test Case 10)
|
|
shivam_15:
2016-05-16 19:39:13
@Anand 55+34+8+2+1=100 |
|
killjee_15:
2016-03-24 20:46:01
Ans i was doing subset sum :3 |
|
utkarsh538:
2016-03-21 15:18:44
Easy problem..think properly :)
|
|
lalit_nit:
2016-01-23 07:59:15
Dont underastimate it :/ ... 1WA just because = sign |
|
priyanshukm_17:
2015-12-18 19:16:57
Easy one....but underestimating it costed me 1 WA |
|
rajesh1995:
2015-11-29 04:55:08
no use EOF..simply a loop.. |
|
Anand:
2015-11-19 15:03:51
I read the comments, i googled "coci gljive". And in the first link there is the PDF.
|
|
abhigupta4:
2015-11-04 08:12:00
Wasted around 8 submissions in this because of test case 10.
|
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 |