結果

問題 No.2055 12x34...
ユーザー H3PO4H3PO4
提出日時 2022-08-21 13:06:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 222 bytes
コンパイル時間 447 ms
コンパイル使用メモリ 82,508 KB
実行使用メモリ 114,972 KB
最終ジャッジ日時 2024-04-18 12:48:32
合計ジャッジ時間 5,644 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,592 KB
testcase_01 AC 39 ms
54,064 KB
testcase_02 AC 52 ms
68,416 KB
testcase_03 AC 61 ms
77,988 KB
testcase_04 AC 67 ms
85,488 KB
testcase_05 AC 69 ms
86,684 KB
testcase_06 AC 68 ms
84,744 KB
testcase_07 AC 64 ms
79,740 KB
testcase_08 AC 58 ms
74,104 KB
testcase_09 AC 82 ms
94,620 KB
testcase_10 AC 85 ms
97,048 KB
testcase_11 AC 57 ms
74,380 KB
testcase_12 AC 92 ms
100,268 KB
testcase_13 AC 131 ms
110,780 KB
testcase_14 AC 74 ms
87,872 KB
testcase_15 AC 75 ms
88,184 KB
testcase_16 AC 134 ms
113,376 KB
testcase_17 AC 69 ms
83,284 KB
testcase_18 AC 95 ms
96,760 KB
testcase_19 AC 55 ms
71,860 KB
testcase_20 AC 48 ms
65,988 KB
testcase_21 AC 55 ms
71,692 KB
testcase_22 AC 110 ms
99,888 KB
testcase_23 AC 119 ms
101,804 KB
testcase_24 AC 126 ms
114,740 KB
testcase_25 AC 122 ms
106,696 KB
testcase_26 AC 120 ms
106,180 KB
testcase_27 AC 122 ms
114,880 KB
testcase_28 AC 121 ms
109,352 KB
testcase_29 AC 125 ms
114,972 KB
testcase_30 AC 121 ms
106,532 KB
testcase_31 AC 121 ms
106,276 KB
testcase_32 AC 118 ms
106,404 KB
testcase_33 AC 94 ms
98,032 KB
testcase_34 AC 88 ms
97,892 KB
testcase_35 AC 94 ms
98,300 KB
testcase_36 AC 87 ms
98,116 KB
testcase_37 AC 85 ms
97,984 KB
testcase_38 AC 94 ms
98,164 KB
testcase_39 AC 90 ms
97,936 KB
testcase_40 AC 85 ms
97,996 KB
testcase_41 AC 89 ms
97,876 KB
testcase_42 AC 86 ms
98,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

N = int(input())
A = map(int, input().split())

MOD = 998244353

dp = defaultdict(int)
for a in A:
    dp[a] += dp.get(a - 1, 0) + 1
    dp[a] %= MOD
print((sum(dp.values()) - N) % MOD)
0