結果
問題 |
No.3242 Count 8 Included Numbers (Hard)
|
ユーザー |
👑 |
提出日時 | 2025-08-22 21:22:22 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 170 ms |
コンパイル使用メモリ | 82,188 KB |
実行使用メモリ | 53,828 KB |
最終ジャッジ日時 | 2025-08-22 21:22:29 |
合計ジャッジ時間 | 4,332 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 1 TLE * 1 -- * 18 |
ソースコード
import sys sys.set_int_max_str_digits(8888888) 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) trimmed = "".join(["8" if c == "9" else c for c in max_non_eight]) print((int(N) - int(trimmed, base=9)) % 998244353)