結果

問題 No.2055 12x34...
ユーザー ShirotsumeShirotsume
提出日時 2022-08-28 02:19:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 389 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 124,784 KB
最終ジャッジ日時 2024-04-23 03:45:15
合計ジャッジ時間 6,760 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,536 KB
testcase_01 AC 42 ms
54,132 KB
testcase_02 AC 58 ms
74,272 KB
testcase_03 AC 71 ms
88,152 KB
testcase_04 AC 89 ms
97,752 KB
testcase_05 AC 90 ms
100,844 KB
testcase_06 AC 85 ms
97,792 KB
testcase_07 AC 74 ms
90,884 KB
testcase_08 AC 64 ms
83,076 KB
testcase_09 AC 93 ms
100,996 KB
testcase_10 AC 95 ms
104,312 KB
testcase_11 AC 64 ms
80,560 KB
testcase_12 AC 102 ms
98,208 KB
testcase_13 AC 135 ms
104,256 KB
testcase_14 AC 89 ms
97,292 KB
testcase_15 AC 86 ms
97,336 KB
testcase_16 AC 142 ms
124,784 KB
testcase_17 AC 81 ms
91,828 KB
testcase_18 AC 103 ms
101,332 KB
testcase_19 AC 61 ms
75,564 KB
testcase_20 AC 53 ms
68,688 KB
testcase_21 AC 61 ms
75,792 KB
testcase_22 AC 133 ms
109,792 KB
testcase_23 AC 122 ms
107,084 KB
testcase_24 AC 129 ms
109,812 KB
testcase_25 AC 128 ms
106,732 KB
testcase_26 AC 126 ms
106,748 KB
testcase_27 AC 131 ms
109,736 KB
testcase_28 AC 133 ms
106,984 KB
testcase_29 AC 137 ms
109,840 KB
testcase_30 AC 127 ms
106,848 KB
testcase_31 AC 127 ms
106,876 KB
testcase_32 AC 125 ms
106,832 KB
testcase_33 AC 102 ms
105,496 KB
testcase_34 AC 99 ms
105,468 KB
testcase_35 AC 104 ms
105,524 KB
testcase_36 AC 99 ms
105,308 KB
testcase_37 AC 98 ms
105,396 KB
testcase_38 AC 103 ms
105,396 KB
testcase_39 AC 103 ms
105,472 KB
testcase_40 AC 99 ms
105,612 KB
testcase_41 AC 99 ms
105,692 KB
testcase_42 AC 100 ms
105,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
import sys
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353


n = ii()

a = li()

dp = Counter()

for v in a:
    dp[v] += 1
    dp[v] += dp[v - 1]
    dp[v] %= mod
ans = -n
for v, c in dp.items():
    ans += c
    ans %= mod
print(ans)
0