Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: “Roman” corridor
Description Let’s remind the notation of Roman numerals. The notation is for natural numbers from 1 to 3999. Capital Latin letters ‘I’, ‘V’, ‘X’, ‘L’, ‘C’, ‘D’, ‘M’ and their combinations are used to represent so called
To put down a number The Roman numerals are put down from left to right without spaces. Thus, the number Can you pass through the corridor so that the sequence of symbols on the tiles composing your path was a correct number in the Roman notation? Among all possible solutions you need to find the minimal number. Input The first line contains numbers n and m, separated by one or more spaces. Each of the next n lines consists of m characters describing tiles. Output The output contains one line with the found Roman number or the word Sample Input 4 6 VXILID DIVIII CDLXIV ICCXDC Sample Output CDLVIII Source Northeastern Europe 2005, Western Subregion |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator