結果
問題 | No.2055 12x34... |
ユーザー |
👑 ![]() |
提出日時 | 2022-08-25 19:37:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 184 ms / 2,000 ms |
コード長 | 198 bytes |
コンパイル時間 | 189 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 155,404 KB |
最終ジャッジ日時 | 2024-10-13 01:19:41 |
合計ジャッジ時間 | 7,211 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 41 |
ソースコード
from collections import defaultdict N=int(input()) A=list(map(int,input().split())) DP=defaultdict(int) X=0; Mod=998244353 for a in A: X+=DP[a-1] DP[a]=(DP[a]+DP[a-1]+1)%Mod print(X%Mod)