結果

問題 No.2055 12x34...
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-08-21 14:01:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 82,080 KB
実行使用メモリ 118,912 KB
最終ジャッジ日時 2024-04-18 12:56:53
合計ジャッジ時間 6,724 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
51,712 KB
testcase_01 AC 35 ms
51,712 KB
testcase_02 AC 53 ms
69,888 KB
testcase_03 AC 66 ms
82,944 KB
testcase_04 AC 74 ms
92,160 KB
testcase_05 AC 79 ms
95,616 KB
testcase_06 AC 84 ms
92,160 KB
testcase_07 AC 67 ms
84,992 KB
testcase_08 AC 62 ms
77,696 KB
testcase_09 AC 80 ms
96,896 KB
testcase_10 AC 87 ms
101,164 KB
testcase_11 AC 59 ms
75,776 KB
testcase_12 AC 93 ms
105,600 KB
testcase_13 AC 122 ms
104,064 KB
testcase_14 AC 71 ms
89,600 KB
testcase_15 AC 71 ms
89,472 KB
testcase_16 AC 128 ms
105,860 KB
testcase_17 AC 69 ms
86,272 KB
testcase_18 AC 96 ms
101,120 KB
testcase_19 AC 54 ms
70,528 KB
testcase_20 AC 47 ms
64,512 KB
testcase_21 AC 53 ms
70,656 KB
testcase_22 AC 118 ms
109,084 KB
testcase_23 AC 115 ms
108,448 KB
testcase_24 AC 124 ms
118,784 KB
testcase_25 AC 117 ms
112,256 KB
testcase_26 AC 117 ms
118,648 KB
testcase_27 AC 127 ms
118,656 KB
testcase_28 AC 123 ms
118,912 KB
testcase_29 AC 121 ms
115,072 KB
testcase_30 AC 116 ms
118,528 KB
testcase_31 AC 117 ms
118,564 KB
testcase_32 AC 120 ms
118,784 KB
testcase_33 AC 95 ms
104,832 KB
testcase_34 AC 91 ms
103,680 KB
testcase_35 AC 95 ms
104,832 KB
testcase_36 AC 87 ms
103,680 KB
testcase_37 AC 95 ms
103,424 KB
testcase_38 AC 96 ms
104,832 KB
testcase_39 AC 86 ms
103,680 KB
testcase_40 AC 89 ms
103,744 KB
testcase_41 AC 88 ms
103,676 KB
testcase_42 AC 89 ms
103,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))
mod = 998244353
ans = 0

dic = {}
for a in A:
    ans += dic.get(a-1,0)
    ans %= mod
    dic[a] = (dic.get(a,0)+dic.get(a-1,0)+1)%mod
print(ans)
0