結果

問題 No.2055 12x34...
ユーザー ytftytft
提出日時 2022-08-23 13:52:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 239 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 82,544 KB
実行使用メモリ 109,424 KB
最終ジャッジ日時 2024-04-19 04:51:09
合計ジャッジ時間 7,003 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
51,968 KB
testcase_01 AC 36 ms
51,956 KB
testcase_02 AC 55 ms
72,132 KB
testcase_03 AC 72 ms
85,672 KB
testcase_04 AC 80 ms
95,444 KB
testcase_05 AC 84 ms
99,000 KB
testcase_06 AC 84 ms
94,712 KB
testcase_07 AC 72 ms
87,460 KB
testcase_08 AC 65 ms
80,528 KB
testcase_09 AC 90 ms
100,676 KB
testcase_10 AC 97 ms
103,880 KB
testcase_11 AC 64 ms
78,996 KB
testcase_12 AC 97 ms
106,536 KB
testcase_13 AC 133 ms
104,208 KB
testcase_14 AC 76 ms
90,796 KB
testcase_15 AC 75 ms
90,408 KB
testcase_16 AC 135 ms
106,272 KB
testcase_17 AC 77 ms
89,488 KB
testcase_18 AC 103 ms
100,932 KB
testcase_19 AC 58 ms
73,520 KB
testcase_20 AC 52 ms
67,396 KB
testcase_21 AC 60 ms
74,816 KB
testcase_22 AC 128 ms
109,120 KB
testcase_23 AC 124 ms
108,240 KB
testcase_24 AC 128 ms
109,120 KB
testcase_25 AC 128 ms
108,164 KB
testcase_26 AC 126 ms
108,492 KB
testcase_27 AC 132 ms
108,940 KB
testcase_28 AC 129 ms
108,240 KB
testcase_29 AC 134 ms
109,424 KB
testcase_30 AC 127 ms
108,140 KB
testcase_31 AC 125 ms
108,192 KB
testcase_32 AC 127 ms
108,184 KB
testcase_33 AC 101 ms
104,988 KB
testcase_34 AC 102 ms
104,992 KB
testcase_35 AC 101 ms
105,068 KB
testcase_36 AC 102 ms
104,956 KB
testcase_37 AC 105 ms
105,064 KB
testcase_38 AC 101 ms
105,012 KB
testcase_39 AC 103 ms
105,220 KB
testcase_40 AC 102 ms
105,132 KB
testcase_41 AC 103 ms
104,912 KB
testcase_42 AC 100 ms
105,024 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod=998244353
dp={}
ans=0
N=int(input())
A=list(map(int,input().split()))
for i in range(N-1,-1,-1):
	if not A[i] in dp:
		dp[A[i]]=0
	if A[i]+1 in dp:
		ans=(ans+dp[A[i]+1])%mod
		dp[A[i]]+=dp[A[i]+1]
	dp[A[i]]=(dp[A[i]]+1)%mod
print(ans)
0