結果
問題 | No.2867 NOT FOUND 404 Again |
ユーザー | 寝癖 |
提出日時 | 2024-07-08 12:31:27 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 570 bytes |
コンパイル時間 | 297 ms |
コンパイル使用メモリ | 82,440 KB |
実行使用メモリ | 138,496 KB |
最終ジャッジ日時 | 2024-08-01 13:29:03 |
合計ジャッジ時間 | 5,046 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 37 ms
66,448 KB |
testcase_01 | AC | 42 ms
61,092 KB |
testcase_02 | AC | 34 ms
53,056 KB |
testcase_03 | TLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
N = list(map(int, input())) D = len(N) M = 100 now = [[0] * M for _ in range(2)] now[0][0] = 1 for i, n in enumerate(N): nxt = [[0] * M for _ in range(2)] for smaller in range(2): for j in range(M): if not now[smaller][j]: continue for x in range(10 if smaller else n + 1): if j*10+x == 404: continue nxt[smaller or x < n][(j*10+x)%M] += now[smaller][j] now = [[v % 998244353 for v in row] for row in nxt] print((sum(now[0]) + sum(now[1]) - 1) % 998244353)