結果
| 問題 |
No.3242 Count 8 Included Numbers (Hard)
|
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-08-22 21:19:32 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 265 bytes |
| コンパイル時間 | 245 ms |
| コンパイル使用メモリ | 82,772 KB |
| 実行使用メモリ | 141,200 KB |
| 最終ジャッジ日時 | 2025-08-22 21:19:35 |
| 合計ジャッジ時間 | 3,047 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 1 RE * 19 |
ソースコード
N = input()
idx = min([i for i in range(len(N)) if N[i] == "8"], default=len(N))
if idx == len(N):
max_non_eight = N
else:
max_non_eight = N[:idx] + "7" + "9" * (len(N) - idx - 1)
print((int(N) - int(max_non_eight.replace("9", "8"), base=9)) % 998244353)