시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 512 MB | 403 | 299 | 274 | 75.275% |
Listening to music is a good way to take one’s mind off the monotony of typing out solution after correct solution.
However, it can be very annoying to start listening to a tune and then for time to run out early, cutting the listening short. How much more satisfying it would be if you could choose tunes to fit the time available!
With this in mind, you have found a way to code musical scores into simple lists of numbers representing the length of the notes in each tune as follows:
Code | Name | Length |
---|---|---|
0 | breve | 2 notes |
1 | semibreve | 1 notes |
2 | minim | 1/2 notes |
4 | crotchet | 1/4 notes |
8 | quaver | 1/8 notes |
16 | semiquaver | 1/16 notes |
Given such a list of numbers, calculate the length of the tune in notes.
Output the length of the tune, as a real number of notes. The output must be accurate to an absolute or relative error of at most 10−6.
4 1 1 1 0
5
10 1 2 2 2 1 4 4 8 8 16
4.3125
ICPC > Regionals > Europe > Northwestern European Regional Contest > The UK & Ireland Programming Contest > UKIEPC 2017 J번