結果

問題 No.2055 12x34...
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2022-08-24 09:08:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 220 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,316 KB
実行使用メモリ 137,064 KB
最終ジャッジ日時 2024-04-20 00:15:29
合計ジャッジ時間 6,864 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
51,968 KB
testcase_01 AC 37 ms
52,224 KB
testcase_02 AC 48 ms
70,016 KB
testcase_03 AC 62 ms
83,840 KB
testcase_04 AC 71 ms
93,952 KB
testcase_05 AC 72 ms
97,408 KB
testcase_06 AC 69 ms
93,440 KB
testcase_07 AC 63 ms
86,016 KB
testcase_08 AC 56 ms
78,336 KB
testcase_09 AC 78 ms
99,072 KB
testcase_10 AC 88 ms
103,680 KB
testcase_11 AC 56 ms
76,544 KB
testcase_12 AC 120 ms
126,464 KB
testcase_13 AC 165 ms
132,732 KB
testcase_14 AC 93 ms
101,376 KB
testcase_15 AC 92 ms
101,376 KB
testcase_16 AC 172 ms
137,064 KB
testcase_17 AC 70 ms
88,576 KB
testcase_18 AC 92 ms
101,248 KB
testcase_19 AC 52 ms
72,192 KB
testcase_20 AC 48 ms
65,408 KB
testcase_21 AC 52 ms
72,192 KB
testcase_22 AC 112 ms
109,136 KB
testcase_23 AC 117 ms
108,652 KB
testcase_24 AC 125 ms
111,104 KB
testcase_25 AC 117 ms
110,976 KB
testcase_26 AC 118 ms
111,744 KB
testcase_27 AC 123 ms
110,848 KB
testcase_28 AC 117 ms
111,616 KB
testcase_29 AC 130 ms
110,976 KB
testcase_30 AC 119 ms
111,360 KB
testcase_31 AC 118 ms
111,488 KB
testcase_32 AC 116 ms
111,488 KB
testcase_33 AC 91 ms
104,960 KB
testcase_34 AC 90 ms
104,960 KB
testcase_35 AC 90 ms
104,960 KB
testcase_36 AC 88 ms
104,960 KB
testcase_37 AC 91 ms
105,112 KB
testcase_38 AC 94 ms
105,088 KB
testcase_39 AC 93 ms
105,088 KB
testcase_40 AC 91 ms
105,088 KB
testcase_41 AC 93 ms
104,832 KB
testcase_42 AC 91 ms
105,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from _collections import defaultdict
n=int(input())
a=list(map(int,input().split()))
ans=0
mod=998244353
dp=defaultdict(int)
for x in a:
    dp[x]+=1+dp[x-1]
    dp[x]%=mod
for x in dp:ans+=dp[x]
ans-=n
print(ans%mod)

0