結果

問題 No.2055 12x34...
ユーザー shirokumashirokuma
提出日時 2022-10-04 23:32:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 229 bytes
コンパイル時間 401 ms
コンパイル使用メモリ 86,848 KB
実行使用メモリ 163,532 KB
最終ジャッジ日時 2023-08-28 23:21:23
合計ジャッジ時間 11,045 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
71,572 KB
testcase_01 AC 89 ms
71,516 KB
testcase_02 AC 109 ms
82,256 KB
testcase_03 AC 114 ms
91,500 KB
testcase_04 AC 123 ms
99,044 KB
testcase_05 AC 127 ms
101,800 KB
testcase_06 AC 121 ms
98,404 KB
testcase_07 AC 116 ms
93,572 KB
testcase_08 AC 109 ms
87,972 KB
testcase_09 AC 125 ms
102,052 KB
testcase_10 AC 132 ms
105,620 KB
testcase_11 AC 108 ms
86,492 KB
testcase_12 AC 161 ms
129,136 KB
testcase_13 AC 201 ms
163,532 KB
testcase_14 AC 138 ms
107,980 KB
testcase_15 AC 136 ms
107,724 KB
testcase_16 AC 207 ms
157,820 KB
testcase_17 AC 121 ms
93,444 KB
testcase_18 AC 144 ms
110,868 KB
testcase_19 AC 107 ms
82,056 KB
testcase_20 AC 101 ms
77,520 KB
testcase_21 AC 105 ms
81,660 KB
testcase_22 AC 152 ms
113,932 KB
testcase_23 AC 167 ms
128,168 KB
testcase_24 AC 177 ms
142,652 KB
testcase_25 AC 172 ms
130,904 KB
testcase_26 AC 171 ms
133,256 KB
testcase_27 AC 176 ms
142,416 KB
testcase_28 AC 178 ms
136,848 KB
testcase_29 AC 181 ms
138,928 KB
testcase_30 AC 177 ms
130,956 KB
testcase_31 AC 179 ms
130,780 KB
testcase_32 AC 176 ms
133,720 KB
testcase_33 AC 136 ms
106,728 KB
testcase_34 AC 137 ms
106,784 KB
testcase_35 AC 135 ms
106,776 KB
testcase_36 AC 136 ms
106,692 KB
testcase_37 AC 137 ms
106,852 KB
testcase_38 AC 135 ms
106,728 KB
testcase_39 AC 136 ms
106,708 KB
testcase_40 AC 136 ms
106,700 KB
testcase_41 AC 137 ms
106,812 KB
testcase_42 AC 136 ms
106,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki2055

from collections import defaultdict

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

dp = defaultdict(int)

for a in A:
    dp[a] += dp[a-1] + 1
    dp[a] %= mod

print((sum(dp.values()) - N)%mod)
0