시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 104 | 36 | 32 | 42.105% |
You are supplied a set of values for stamps (e.g., {1, 3, 5}) and the maximum number of stamps that can be applied to an envelope (e.g., five stamps). Your goal is to calculate the largest contiguous set of postage that can be accommodated. For the set of {1, 3, 5} with five maximum stamps, one can build:
There appears to be no way to build 22 cents with no more than five members of this set of stamps. Thus, one can build values in the ragen [1..21,] a total of 21 contiguous stamp values. There is no reason to believe that the largest contiguous set will start with the value '1'.
The maximum number of contiguous values that can be created by combining the stamps.
3 5 1 3 5
21