結果

問題 No.2055 12x34...
ユーザー lloyzlloyz
提出日時 2022-09-18 01:32:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 347 ms / 2,000 ms
コード長 278 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 10,516 KB
実行使用メモリ 54,080 KB
最終ジャッジ日時 2023-08-23 17:58:18
合計ジャッジ時間 9,250 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,380 KB
testcase_01 AC 19 ms
8,504 KB
testcase_02 AC 49 ms
9,720 KB
testcase_03 AC 87 ms
11,164 KB
testcase_04 AC 115 ms
12,012 KB
testcase_05 AC 120 ms
12,828 KB
testcase_06 AC 110 ms
12,312 KB
testcase_07 AC 88 ms
11,128 KB
testcase_08 AC 69 ms
10,300 KB
testcase_09 AC 128 ms
12,752 KB
testcase_10 AC 145 ms
12,784 KB
testcase_11 AC 66 ms
10,632 KB
testcase_12 AC 211 ms
32,632 KB
testcase_13 AC 326 ms
36,304 KB
testcase_14 AC 144 ms
22,432 KB
testcase_15 AC 142 ms
22,540 KB
testcase_16 AC 347 ms
54,080 KB
testcase_17 AC 101 ms
17,708 KB
testcase_18 AC 174 ms
25,200 KB
testcase_19 AC 52 ms
13,328 KB
testcase_20 AC 33 ms
10,380 KB
testcase_21 AC 54 ms
13,436 KB
testcase_22 AC 222 ms
30,160 KB
testcase_23 AC 234 ms
31,388 KB
testcase_24 AC 264 ms
39,436 KB
testcase_25 AC 243 ms
31,496 KB
testcase_26 AC 246 ms
31,216 KB
testcase_27 AC 260 ms
39,524 KB
testcase_28 AC 249 ms
31,320 KB
testcase_29 AC 265 ms
39,428 KB
testcase_30 AC 239 ms
31,272 KB
testcase_31 AC 248 ms
31,348 KB
testcase_32 AC 243 ms
31,356 KB
testcase_33 AC 185 ms
29,724 KB
testcase_34 AC 178 ms
30,000 KB
testcase_35 AC 182 ms
29,864 KB
testcase_36 AC 179 ms
29,896 KB
testcase_37 AC 183 ms
29,916 KB
testcase_38 AC 180 ms
29,820 KB
testcase_39 AC 182 ms
29,808 KB
testcase_40 AC 181 ms
29,784 KB
testcase_41 AC 178 ms
29,816 KB
testcase_42 AC 178 ms
29,972 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n = int(input())
A = list(map(int, input().split()))
mod = 998244353

ans = 0
DP = defaultdict(int)
for a in A:
    DP[a] += DP[a - 1] + 1
    DP[a] %= mod
for cnt in DP.values():
    ans += cnt
    ans %= mod
ans -= n
ans %= mod
print(ans)
0