結果

問題 No.405 ローマ数字の腕時計
ユーザー HAGI_TARO
提出日時 2021-10-12 10:13:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-09-16 18:27:49
合計ジャッジ時間 2,388 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

S,t = input().split()
num = 0
ans = ""
if S == "IX":
    num = 9
else:
    for i in range(len(S)):
        if S[i] == "X":
            num += 10
        elif S[i] == "V":
            num += 5
        else:
            num += 1
num += int(t) % 12
if num == 9:
    ans = "IX"
else:
    if num >= 13:
        num -= 12
    while num > 0:
        if num >= 10:
            ans += "X"
            num -= 10
        elif num >= 5:
            ans += "V"
            num -= 5
        else:
            ans += "I"
            num -= 1
print(ans)
0