| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 (추가 시간 없음) | 1024 MB | 394 | 315 | 258 | 80.878% |
A chronogram is an inscription (usually found on monuments) in which the year of the event commemorated by the monument is encoded. The year is obtained by adding up all the values of those letters that can appear in Roman numerals. Values of individual letters:
I … 1V … 5X … 10L … 50C … 100D … 500M … 1000Chronograms are usually studied by theologians. As a part of a study of great importance in the Central Europe, they compiled a long list of chronograms. The monks would like to make sure they do not make any mistake in calculating the corresponding years and therefore decided to use a computer program. Since monks are not skilled programmers, they urgently need your help.
Write a program that will extract the year of the event from a chronogram.
The first line of the input contains an integer $T,ドル i.e. the number of test cases. This is followed by $T$ lines; each line contains one chronogram that contains at most 1000 characters. The text contains only uppercase letters of the English alphabet and spaces.
For each chronogram output one integer, i.e. the year encoded in the chronogram.
2 VIDE ISTA ECCLESIA CATHEDRALIS SVB PRAESVLE FRANCISCO PAROCHOQVE STANSLAO LAETA EXSISTIT REVIVISCENS ENTERTAINING REGIONAL CONTEST HELD IN EXTRAVAGANT LJUBLJANA WITH RIDICULOUSLY HARD TASKS
1999 2022
ICPC > Regionals > Europe > Central European Regional Contest > CERC 2022 연습 세션 X번