結果

問題 No.2055 12x34...
ユーザー rlangevinrlangevin
提出日時 2022-08-21 17:06:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 174 ms / 2,000 ms
コード長 311 bytes
コンパイル時間 529 ms
コンパイル使用メモリ 82,504 KB
実行使用メモリ 155,776 KB
最終ジャッジ日時 2024-04-18 13:04:16
合計ジャッジ時間 6,585 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,888 KB
testcase_01 AC 40 ms
53,632 KB
testcase_02 AC 56 ms
71,552 KB
testcase_03 AC 69 ms
85,248 KB
testcase_04 AC 80 ms
95,360 KB
testcase_05 AC 90 ms
100,480 KB
testcase_06 AC 83 ms
94,720 KB
testcase_07 AC 72 ms
87,680 KB
testcase_08 AC 66 ms
80,128 KB
testcase_09 AC 94 ms
100,608 KB
testcase_10 AC 95 ms
103,936 KB
testcase_11 AC 63 ms
77,824 KB
testcase_12 AC 124 ms
114,432 KB
testcase_13 AC 160 ms
132,916 KB
testcase_14 AC 92 ms
102,784 KB
testcase_15 AC 91 ms
102,400 KB
testcase_16 AC 174 ms
155,776 KB
testcase_17 AC 75 ms
89,472 KB
testcase_18 AC 102 ms
101,120 KB
testcase_19 AC 56 ms
72,960 KB
testcase_20 AC 49 ms
66,304 KB
testcase_21 AC 61 ms
73,088 KB
testcase_22 AC 128 ms
109,480 KB
testcase_23 AC 125 ms
106,752 KB
testcase_24 AC 133 ms
109,968 KB
testcase_25 AC 128 ms
106,752 KB
testcase_26 AC 128 ms
106,680 KB
testcase_27 AC 133 ms
110,032 KB
testcase_28 AC 131 ms
106,624 KB
testcase_29 AC 140 ms
109,772 KB
testcase_30 AC 131 ms
106,752 KB
testcase_31 AC 131 ms
106,624 KB
testcase_32 AC 129 ms
106,880 KB
testcase_33 AC 102 ms
105,376 KB
testcase_34 AC 101 ms
105,448 KB
testcase_35 AC 100 ms
105,472 KB
testcase_36 AC 104 ms
105,344 KB
testcase_37 AC 102 ms
105,344 KB
testcase_38 AC 102 ms
105,088 KB
testcase_39 AC 100 ms
105,600 KB
testcase_40 AC 101 ms
105,340 KB
testcase_41 AC 104 ms
105,600 KB
testcase_42 AC 102 ms
105,344 KB
権限があれば一括ダウンロードができます

ソースコード

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
        D[A[i]] %= mod
        val += v
        val %= mod
    return val

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