結果
| 問題 |
No.2055 12x34...
|
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2025-06-04 04:45:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 165 ms / 2,000 ms |
| コード長 | 238 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 156,104 KB |
| 最終ジャッジ日時 | 2025-06-04 04:45:46 |
| 合計ジャッジ時間 | 6,288 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 41 |
ソースコード
from collections import defaultdict
MOD = 998244353
N = int(input())
A = list(map(int, input().split()))
dp = defaultdict(int)
ans = 0
for a in A:
ans += dp[a-1]
ans %= MOD
dp[a] += dp[a-1] + 1
dp[a] %= MOD
print(ans)
norioc