結果

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

ソースコード

diff #

import sys
sys.set_int_max_str_digits(0)

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