結果

問題 No.3157 Nabeatsu
ユーザー SUPERARMOR
提出日時 2025-06-19 11:53:53
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
実行時間 -
コード長 262 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 33,872 KB
最終ジャッジ日時 2025-06-19 11:54:01
合計ジャッジ時間 7,594 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30 RE * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

N = list(input())

# 10^6
if '3' in N:
  idx = N.index('3')
  N[idx:] = ['9'] * (len(N) - idx)
  N[idx] = '2'

sum_digits = sum(map(int, N))
number = int(''.join(N))

while (sum_digits % 3 == 0 or number % 10 == 3):
  number -= 1
  sum_digits -= 1

print(number)
0