結果

問題 No.2055 12x34...
ユーザー rlangevin
提出日時 2022-08-21 17:06:27
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 288 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 82,436 KB
実行使用メモリ 257,536 KB
最終ジャッジ日時 2024-10-10 06:16:18
合計ジャッジ時間 7,381 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 TLE * 1 -- * 24
権限があれば一括ダウンロードができます

ソースコード

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