結果
問題 |
No.3157 Nabeatsu
|
ユーザー |
|
提出日時 | 2025-05-27 14:31:04 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 595 bytes |
コンパイル時間 | 441 ms |
コンパイル使用メモリ | 82,308 KB |
実行使用メモリ | 176,484 KB |
最終ジャッジ日時 | 2025-05-27 14:31:12 |
合計ジャッジ時間 | 7,059 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 WA * 1 |
ソースコード
import sys sys.set_int_max_str_digits(0) N = input() for _ in range(2): ans = ['9'] * len(N) res = 9 * len(N) for i, n in enumerate(N): if n == '3': res -= 7 ans[i] = '2' break else: res -= 9 - int(n) ans[i] = n if res % 3 == 0: if ans[-1] == '0': ans = int(''.join(ans)) ans -= 1 else: ans[-1] = str(int(ans[-1]) - 1) ans = ''.join(ans) break else: ans = ''.join(ans) break N = str(ans) print(ans)