結果

問題 No.2055 12x34...
ユーザー AEnAEn
提出日時 2022-11-20 14:51:54
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 153 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 155,504 KB
最終ジャッジ日時 2023-10-21 13:37:22
合計ジャッジ時間 8,045 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,504 KB
testcase_01 AC 32 ms
53,504 KB
testcase_02 AC 50 ms
73,508 KB
testcase_03 AC 59 ms
87,220 KB
testcase_04 AC 72 ms
95,908 KB
testcase_05 AC 77 ms
100,196 KB
testcase_06 AC 69 ms
95,512 KB
testcase_07 AC 64 ms
89,212 KB
testcase_08 AC 53 ms
81,604 KB
testcase_09 AC 77 ms
100,572 KB
testcase_10 AC 81 ms
103,884 KB
testcase_11 AC 53 ms
80,168 KB
testcase_12 AC 105 ms
111,644 KB
testcase_13 AC 140 ms
132,788 KB
testcase_14 AC 86 ms
104,300 KB
testcase_15 AC 84 ms
104,460 KB
testcase_16 AC 153 ms
155,504 KB
testcase_17 AC 65 ms
89,776 KB
testcase_18 AC 92 ms
101,168 KB
testcase_19 AC 50 ms
74,900 KB
testcase_20 AC 44 ms
68,644 KB
testcase_21 AC 51 ms
74,936 KB
testcase_22 AC 108 ms
109,312 KB
testcase_23 AC 106 ms
106,436 KB
testcase_24 AC 115 ms
109,592 KB
testcase_25 AC 111 ms
106,532 KB
testcase_26 AC 111 ms
106,400 KB
testcase_27 AC 121 ms
109,600 KB
testcase_28 AC 112 ms
106,472 KB
testcase_29 AC 116 ms
109,608 KB
testcase_30 AC 110 ms
106,472 KB
testcase_31 AC 112 ms
106,472 KB
testcase_32 AC 110 ms
106,460 KB
testcase_33 AC 87 ms
105,040 KB
testcase_34 AC 91 ms
105,040 KB
testcase_35 AC 89 ms
105,040 KB
testcase_36 AC 87 ms
105,040 KB
testcase_37 AC 87 ms
105,040 KB
testcase_38 AC 87 ms
105,040 KB
testcase_39 AC 86 ms
105,040 KB
testcase_40 AC 87 ms
105,040 KB
testcase_41 AC 87 ms
105,040 KB
testcase_42 AC 85 ms
105,040 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict

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

d = defaultdict(int)
res = 0
for i in range(N):
    res += d[A[i]-1]
    res %= mod
    d[A[i]] += 1+d[A[i]-1]
    d[A[i]] %= mod
print(res)
0