結果

問題 No.518 ローマ数字の和
ユーザー letrangerjpletrangerjp
提出日時 2017-05-31 18:22:38
言語 Ruby
(3.3.0)
結果
OLE  
実行時間 -
コード長 222 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 11,928 KB
実行使用メモリ 16,224 KB
最終ジャッジ日時 2023-10-21 19:07:17
合計ジャッジ時間 4,923 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
16,108 KB
testcase_01 AC 84 ms
16,108 KB
testcase_02 AC 84 ms
16,108 KB
testcase_03 AC 85 ms
16,108 KB
testcase_04 AC 84 ms
16,108 KB
testcase_05 AC 88 ms
16,108 KB
testcase_06 AC 84 ms
16,108 KB
testcase_07 OLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

T={M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}
gets
n=gets.split.map{|r|r.scan(/#{T.keys*?|}/).map{|c|T[c.intern]}.sum}.sum
n>3999?$><<:ERROR:(c,i=T.find{|c,i|i<=n};n-=i;$><<c)while n>0
puts""
0