結果

問題 No.2055 12x34...
ユーザー ああいいああいい
提出日時 2022-08-21 17:27:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 316 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 82,848 KB
実行使用メモリ 136,764 KB
最終ジャッジ日時 2024-04-18 13:05:06
合計ジャッジ時間 5,905 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,268 KB
testcase_01 AC 43 ms
54,332 KB
testcase_02 AC 57 ms
72,800 KB
testcase_03 AC 71 ms
86,148 KB
testcase_04 AC 82 ms
95,624 KB
testcase_05 AC 88 ms
100,720 KB
testcase_06 AC 79 ms
95,096 KB
testcase_07 AC 73 ms
89,108 KB
testcase_08 AC 66 ms
81,376 KB
testcase_09 AC 89 ms
101,028 KB
testcase_10 AC 95 ms
104,196 KB
testcase_11 AC 62 ms
79,304 KB
testcase_12 AC 122 ms
109,000 KB
testcase_13 AC 162 ms
132,868 KB
testcase_14 AC 97 ms
104,148 KB
testcase_15 AC 97 ms
104,532 KB
testcase_16 AC 172 ms
136,764 KB
testcase_17 AC 76 ms
89,376 KB
testcase_18 AC 103 ms
101,272 KB
testcase_19 AC 59 ms
73,496 KB
testcase_20 AC 51 ms
66,432 KB
testcase_21 AC 58 ms
74,408 KB
testcase_22 AC 124 ms
108,884 KB
testcase_23 AC 124 ms
106,368 KB
testcase_24 AC 134 ms
109,804 KB
testcase_25 AC 129 ms
106,536 KB
testcase_26 AC 128 ms
106,492 KB
testcase_27 AC 133 ms
109,728 KB
testcase_28 AC 129 ms
106,936 KB
testcase_29 AC 133 ms
109,492 KB
testcase_30 AC 124 ms
107,024 KB
testcase_31 AC 127 ms
106,548 KB
testcase_32 AC 125 ms
106,636 KB
testcase_33 AC 99 ms
105,512 KB
testcase_34 AC 100 ms
105,064 KB
testcase_35 AC 98 ms
104,972 KB
testcase_36 AC 98 ms
105,504 KB
testcase_37 AC 100 ms
105,256 KB
testcase_38 AC 100 ms
105,028 KB
testcase_39 AC 100 ms
105,544 KB
testcase_40 AC 99 ms
104,960 KB
testcase_41 AC 101 ms
105,300 KB
testcase_42 AC 98 ms
105,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

from collections import defaultdict
ans = 0
P = 998244353

d = defaultdict(int)

for a in A:
    ans += d[a-1]
    d[a] += 1 + d[a-1]
    d[a] %= P
"""
d = defaultdict(int)
for a in A:
    ans += d[a + 1]
    d[a] += d[a + 1] + 1
    d[a] %= P
"""
print(ans % P)
0