結果

問題 No.405 ローマ数字の腕時計
ユーザー HAGI_TAROHAGI_TARO
提出日時 2021-10-12 10:13:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 537 bytes
コンパイル時間 1,937 ms
コンパイル使用メモリ 86,728 KB
実行使用メモリ 71,516 KB
最終ジャッジ日時 2023-10-15 00:55:19
合計ジャッジ時間 4,059 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,056 KB
testcase_01 AC 71 ms
71,196 KB
testcase_02 AC 70 ms
71,172 KB
testcase_03 AC 72 ms
71,240 KB
testcase_04 AC 71 ms
71,088 KB
testcase_05 AC 73 ms
71,372 KB
testcase_06 AC 72 ms
71,244 KB
testcase_07 AC 73 ms
71,236 KB
testcase_08 AC 72 ms
71,256 KB
testcase_09 AC 73 ms
71,116 KB
testcase_10 AC 71 ms
71,224 KB
testcase_11 AC 72 ms
71,164 KB
testcase_12 AC 73 ms
71,292 KB
testcase_13 AC 72 ms
71,304 KB
testcase_14 AC 72 ms
71,388 KB
testcase_15 WA -
testcase_16 AC 72 ms
71,176 KB
testcase_17 AC 73 ms
71,168 KB
testcase_18 AC 72 ms
71,192 KB
testcase_19 AC 74 ms
71,144 KB
testcase_20 AC 73 ms
71,396 KB
testcase_21 AC 72 ms
71,252 KB
testcase_22 AC 72 ms
71,464 KB
testcase_23 AC 74 ms
71,212 KB
testcase_24 AC 73 ms
71,292 KB
testcase_25 AC 74 ms
71,040 KB
testcase_26 AC 73 ms
71,372 KB
権限があれば一括ダウンロードができます

ソースコード

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