結果

問題 No.2433 Min Increasing Sequence
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-08-18 21:09:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 124 ms / 2,000 ms
コード長 504 bytes
コンパイル時間 273 ms
コンパイル使用メモリ 86,832 KB
実行使用メモリ 102,720 KB
最終ジャッジ日時 2023-08-18 21:10:01
合計ジャッジ時間 4,960 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,360 KB
testcase_01 AC 61 ms
71,232 KB
testcase_02 AC 61 ms
71,400 KB
testcase_03 AC 61 ms
71,220 KB
testcase_04 AC 116 ms
100,340 KB
testcase_05 AC 91 ms
96,560 KB
testcase_06 AC 105 ms
100,320 KB
testcase_07 AC 87 ms
92,364 KB
testcase_08 AC 124 ms
98,516 KB
testcase_09 AC 100 ms
98,024 KB
testcase_10 AC 86 ms
85,600 KB
testcase_11 AC 95 ms
92,776 KB
testcase_12 AC 80 ms
84,180 KB
testcase_13 AC 79 ms
82,060 KB
testcase_14 AC 107 ms
95,200 KB
testcase_15 AC 82 ms
82,080 KB
testcase_16 AC 93 ms
85,508 KB
testcase_17 AC 77 ms
82,132 KB
testcase_18 AC 115 ms
99,668 KB
testcase_19 AC 120 ms
99,928 KB
testcase_20 AC 71 ms
76,556 KB
testcase_21 AC 110 ms
102,720 KB
testcase_22 AC 118 ms
99,908 KB
testcase_23 AC 111 ms
100,220 KB
testcase_24 AC 118 ms
99,824 KB
testcase_25 AC 110 ms
97,936 KB
testcase_26 AC 100 ms
97,308 KB
testcase_27 AC 108 ms
102,508 KB
testcase_28 AC 116 ms
100,436 KB
testcase_29 AC 78 ms
79,144 KB
testcase_30 AC 82 ms
78,976 KB
testcase_31 AC 75 ms
77,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

"""

ある数が代表になるためには

・それより右に小さい数が無い

が必須

"""

import sys
from sys import stdin

N = int(stdin.readline())

A = list(map(int,stdin.readline().split()))

stk = []

for i in range(N):

    tup = (A[i],i)

    while stk and stk[-1][0] > A[i]:
        stk.pop()

    stk.append(tup)

mod = 998244353
ans = 1

#print (stk)
for i in range(len(stk)-1):

    _,l = stk[i]
    _,r = stk[i+1]

    ans *= r-l+1
    ans %= mod

print (ans % mod)
        
0