結果
| 問題 | No.2055 12x34... |
| コンテスト | |
| ユーザー |
taiga0629kyopro
|
| 提出日時 | 2022-08-24 09:08:10 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 137 ms / 2,000 ms |
| + 917µs | |
| コード長 | 220 bytes |
| 記録 | |
| コンパイル時間 | 546 ms |
| コンパイル使用メモリ | 81,024 KB |
| 実行使用メモリ | 157,696 KB |
| 最終ジャッジ日時 | 2026-09-14 04:36:14 |
| 合計ジャッジ時間 | 6,719 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 41 |
ソースコード
from _collections import defaultdict
n=int(input())
a=list(map(int,input().split()))
ans=0
mod=998244353
dp=defaultdict(int)
for x in a:
dp[x]+=1+dp[x-1]
dp[x]%=mod
for x in dp:ans+=dp[x]
ans-=n
print(ans%mod)
taiga0629kyopro