結果
| 問題 |
No.2055 12x34...
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-28 16:16:15 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 269 bytes |
| コンパイル時間 | 269 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 214,924 KB |
| 最終ジャッジ日時 | 2024-11-23 17:19:25 |
| 合計ジャッジ時間 | 7,688 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 36 |
ソースコード
from collections import defaultdict
N=int(input())
A=list(map(int,input().split()))
d=defaultdict(int)
cnt=defaultdict(int)
mod=998244353
for i in range(N):
cnt[A[i]]+=1
cnt[A[i]]%=mod
d[A[i]]+=d[A[i]-1]+cnt[A[i]-1]
d[A[i]]%=mod
print(sum(d.values()))