問題一覧 > 通常問題

No.2433 Min Increasing Sequence

レベル : / AI推定難易度 : 1800 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 73
作問者 : otoshigo / テスター : shobonvip noya2 👑 potato167 tassei903 ponjuice
お気に入りにしたユーザー ProblemId : 10007 / 自分の提出
問題文最終更新日: 2023-08-14 18:16:11
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
traP 作問ハッカソンコンテスト 001 (順位表) の他の問題:

Problem Statement

You are given a sequence $A=(A_1, A_2, \cdots, A_N)$ of length $N$.

There are $2^{N-1}$ ways to split $A$ into some number of non-empty contiguous subarrays. Among them, find the number of splits satisfying the following condition, modulo $998244353$.

  • If $A$ is split into $B_1, B_2, \cdots,B_K$, then $(\min{B_1}, \min{B_2}, \cdots, \min{B_K})$ is a non-decreasing sequence.

Here, for a non-empty sequence $B$, $\min{B}$ denotes the minimum value of its elements.

Constraints

  • $1\leq N\leq 2\times{10}^5$
  • $1\leq A_i\leq {10}^9$
  • All input values are integers.

Input

$N$
$A_1$ $A_2$ $\cdots$ $A_N$

Output

Print the number of splits satisfying the condition, modulo $998244353$.

Sample

Sample 1
Input
3
1 3 2
Output
3

There are $3$ splits satisfying the condition, as follows.

  • $(1, 3, 2)$
  • $(1), (3, 2)$
  • $(1, 3), (2)$
Sample 2
Input
3
3 2 1
Output
1

Sample 3
Input
10
4 1 2 6 1 3 9 10 1 3
Output
40

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。