結果

問題 No.2055 12x34...
ユーザー ecotteaecottea
提出日時 2024-02-26 22:48:28
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 281 ms / 2,000 ms
コード長 259 bytes
コンパイル時間 153 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 55,708 KB
最終ジャッジ日時 2024-02-26 22:48:39
合計ジャッジ時間 9,730 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
9,856 KB
testcase_01 AC 26 ms
9,856 KB
testcase_02 AC 64 ms
11,136 KB
testcase_03 AC 121 ms
12,600 KB
testcase_04 AC 155 ms
13,604 KB
testcase_05 AC 162 ms
14,260 KB
testcase_06 AC 152 ms
13,552 KB
testcase_07 AC 131 ms
12,728 KB
testcase_08 AC 92 ms
11,856 KB
testcase_09 AC 172 ms
14,312 KB
testcase_10 AC 183 ms
14,436 KB
testcase_11 AC 82 ms
11,776 KB
testcase_12 AC 179 ms
33,544 KB
testcase_13 AC 264 ms
37,248 KB
testcase_14 AC 126 ms
23,684 KB
testcase_15 AC 133 ms
23,660 KB
testcase_16 AC 281 ms
55,708 KB
testcase_17 AC 118 ms
19,204 KB
testcase_18 AC 193 ms
26,652 KB
testcase_19 AC 61 ms
14,636 KB
testcase_20 AC 40 ms
11,648 KB
testcase_21 AC 64 ms
14,644 KB
testcase_22 AC 262 ms
31,868 KB
testcase_23 AC 255 ms
34,364 KB
testcase_24 AC 257 ms
41,408 KB
testcase_25 AC 256 ms
33,116 KB
testcase_26 AC 245 ms
32,892 KB
testcase_27 AC 274 ms
41,404 KB
testcase_28 AC 254 ms
32,892 KB
testcase_29 AC 258 ms
41,412 KB
testcase_30 AC 259 ms
32,892 KB
testcase_31 AC 265 ms
32,892 KB
testcase_32 AC 263 ms
34,368 KB
testcase_33 AC 221 ms
31,352 KB
testcase_34 AC 221 ms
32,232 KB
testcase_35 AC 221 ms
32,360 KB
testcase_36 AC 217 ms
32,232 KB
testcase_37 AC 231 ms
32,360 KB
testcase_38 AC 218 ms
32,232 KB
testcase_39 AC 225 ms
32,232 KB
testcase_40 AC 225 ms
32,232 KB
testcase_41 AC 234 ms
32,232 KB
testcase_42 AC 230 ms
32,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

n = int(input())
a = list(map(int, input().split()))

MOD = 998244353

res = 0

d = defaultdict(int)

for i in range(n):
    c = d[a[i] - 1]
    res += c
    nc = (d[a[i]] + c + 1) % MOD
    d[a[i]] = nc

print(res % MOD)
0