結果

問題 No.2433 Min Increasing Sequence
ユーザー sotanishysotanishy
提出日時 2023-08-18 22:19:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 258 bytes
コンパイル時間 1,441 ms
コンパイル使用メモリ 86,748 KB
実行使用メモリ 103,220 KB
最終ジャッジ日時 2023-08-18 22:19:09
合計ジャッジ時間 5,390 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,316 KB
testcase_01 AC 75 ms
71,376 KB
testcase_02 AC 71 ms
71,204 KB
testcase_03 AC 70 ms
71,136 KB
testcase_04 AC 151 ms
99,684 KB
testcase_05 AC 94 ms
90,180 KB
testcase_06 AC 110 ms
100,428 KB
testcase_07 AC 98 ms
92,108 KB
testcase_08 AC 119 ms
98,448 KB
testcase_09 AC 107 ms
97,148 KB
testcase_10 AC 91 ms
84,984 KB
testcase_11 AC 103 ms
92,064 KB
testcase_12 AC 88 ms
83,720 KB
testcase_13 AC 114 ms
81,788 KB
testcase_14 AC 113 ms
94,612 KB
testcase_15 AC 84 ms
81,648 KB
testcase_16 AC 90 ms
85,060 KB
testcase_17 AC 86 ms
81,608 KB
testcase_18 AC 124 ms
99,848 KB
testcase_19 AC 125 ms
99,500 KB
testcase_20 AC 75 ms
76,224 KB
testcase_21 AC 110 ms
103,028 KB
testcase_22 AC 120 ms
99,668 KB
testcase_23 AC 120 ms
100,032 KB
testcase_24 AC 125 ms
99,368 KB
testcase_25 AC 118 ms
98,028 KB
testcase_26 AC 104 ms
97,020 KB
testcase_27 AC 115 ms
103,220 KB
testcase_28 AC 108 ms
99,556 KB
testcase_29 AC 81 ms
78,788 KB
testcase_30 AC 79 ms
78,512 KB
testcase_31 AC 77 ms
77,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

mod = 998244353
N = int(input())
A = list(map(int, input().split()))
x = A[-1]
j = N-1
ans = 1
for i in range(N-1)[::-1]:
    if A[i] <= x:
        ans = ans * (j - i + 1) % mod
        x = A[i]
        j = i
print(ans)
0