結果

問題 No.3157 Nabeatsu
コンテスト
ユーザー Meso Meso
提出日時 2025-11-04 12:09:51
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 249 bytes
コンパイル時間 422 ms
コンパイル使用メモリ 82,520 KB
実行使用メモリ 72,296 KB
最終ジャッジ日時 2025-11-04 12:09:56
合計ジャッジ時間 5,009 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

if n % 3 == 0:
    n -= 1

n = list(str(n))

for i in range(len(n)):
    if n[i] == "3":
        n[i] = "2"
        for j in range(i+1, len(n)):
            n[j] = "9"

n = "".join(n)
n = int(n)
if n % 3 == 0:
    n -= 1

print(n)
0