結果

問題 No.2055 12x34...
ユーザー 👑 rin204rin204
提出日時 2022-08-23 14:58:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 208 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 120,448 KB
最終ジャッジ日時 2024-04-19 06:09:01
合計ジャッジ時間 5,628 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
51,712 KB
testcase_01 AC 36 ms
52,224 KB
testcase_02 AC 53 ms
70,016 KB
testcase_03 AC 69 ms
83,328 KB
testcase_04 AC 73 ms
92,288 KB
testcase_05 AC 76 ms
95,872 KB
testcase_06 AC 73 ms
92,032 KB
testcase_07 AC 66 ms
85,120 KB
testcase_08 AC 60 ms
77,824 KB
testcase_09 AC 83 ms
97,152 KB
testcase_10 AC 86 ms
101,248 KB
testcase_11 AC 61 ms
75,904 KB
testcase_12 AC 96 ms
105,856 KB
testcase_13 AC 124 ms
104,236 KB
testcase_14 AC 73 ms
89,472 KB
testcase_15 AC 74 ms
90,112 KB
testcase_16 AC 127 ms
106,004 KB
testcase_17 AC 67 ms
86,272 KB
testcase_18 AC 92 ms
101,300 KB
testcase_19 AC 52 ms
70,528 KB
testcase_20 AC 47 ms
64,384 KB
testcase_21 AC 52 ms
70,784 KB
testcase_22 AC 112 ms
109,060 KB
testcase_23 AC 109 ms
108,928 KB
testcase_24 AC 117 ms
118,912 KB
testcase_25 AC 112 ms
112,768 KB
testcase_26 AC 113 ms
118,748 KB
testcase_27 AC 118 ms
119,168 KB
testcase_28 AC 114 ms
120,448 KB
testcase_29 AC 119 ms
115,456 KB
testcase_30 AC 115 ms
118,812 KB
testcase_31 AC 116 ms
120,180 KB
testcase_32 AC 115 ms
120,380 KB
testcase_33 AC 93 ms
104,996 KB
testcase_34 AC 83 ms
103,680 KB
testcase_35 AC 91 ms
105,048 KB
testcase_36 AC 85 ms
103,552 KB
testcase_37 AC 85 ms
103,492 KB
testcase_38 AC 91 ms
104,960 KB
testcase_39 AC 89 ms
103,368 KB
testcase_40 AC 85 ms
103,680 KB
testcase_41 AC 85 ms
103,364 KB
testcase_42 AC 85 ms
103,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353

n = int(input())
A = list(map(int, input().split()))
dp = {}
ans = 0
for a in A:
    x = dp.get(a - 1, 0)
    ans += x
    ans %= MOD
    dp[a] = (dp.get(a, 0) + x + 1) % MOD
print(ans % MOD)
0