結果

問題 No.2055 12x34...
ユーザー rlangevinrlangevin
提出日時 2022-08-21 17:06:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 288 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 82,164 KB
実行使用メモリ 155,644 KB
最終ジャッジ日時 2024-04-18 13:04:07
合計ジャッジ時間 7,450 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,136 KB
testcase_01 AC 42 ms
53,376 KB
testcase_02 AC 64 ms
75,904 KB
testcase_03 AC 85 ms
90,112 KB
testcase_04 AC 99 ms
97,404 KB
testcase_05 AC 100 ms
100,444 KB
testcase_06 AC 93 ms
97,408 KB
testcase_07 AC 87 ms
92,288 KB
testcase_08 AC 75 ms
86,784 KB
testcase_09 AC 101 ms
100,836 KB
testcase_10 AC 110 ms
103,904 KB
testcase_11 AC 74 ms
85,248 KB
testcase_12 AC 116 ms
125,568 KB
testcase_13 AC 152 ms
132,904 KB
testcase_14 AC 94 ms
100,736 KB
testcase_15 AC 89 ms
101,120 KB
testcase_16 AC 161 ms
155,644 KB
testcase_17 AC 1,413 ms
155,520 KB
testcase_18 TLE -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

def calc(A):
    D = defaultdict(int)
    mod = 998244353
    val = 0
    for i in range(N):
        v = D[A[i] - 1]
        D[A[i]] += v + 1
        val += v
        val %= mod
    return val

N = int(input())
A = list(map(int, input().split()))
print(calc(A))
0