結果

問題 No.1709 Indistinguishable by MEX
ユーザー syunsukesyunsuke
提出日時 2021-11-22 22:04:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 776 ms / 2,000 ms
コード長 367 bytes
コンパイル時間 498 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 110,196 KB
最終ジャッジ日時 2023-09-06 16:52:52
合計ジャッジ時間 12,883 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,280 KB
testcase_01 AC 76 ms
71,276 KB
testcase_02 AC 75 ms
71,520 KB
testcase_03 AC 74 ms
71,192 KB
testcase_04 AC 74 ms
71,328 KB
testcase_05 AC 75 ms
71,352 KB
testcase_06 AC 75 ms
71,424 KB
testcase_07 AC 74 ms
70,976 KB
testcase_08 AC 621 ms
102,992 KB
testcase_09 AC 510 ms
103,020 KB
testcase_10 AC 488 ms
101,396 KB
testcase_11 AC 396 ms
101,756 KB
testcase_12 AC 381 ms
100,032 KB
testcase_13 AC 464 ms
104,356 KB
testcase_14 AC 434 ms
102,708 KB
testcase_15 AC 456 ms
104,552 KB
testcase_16 AC 567 ms
108,612 KB
testcase_17 AC 528 ms
105,832 KB
testcase_18 AC 766 ms
109,280 KB
testcase_19 AC 760 ms
109,500 KB
testcase_20 AC 776 ms
109,348 KB
testcase_21 AC 602 ms
109,576 KB
testcase_22 AC 595 ms
109,660 KB
testcase_23 AC 219 ms
110,164 KB
testcase_24 AC 218 ms
110,196 KB
testcase_25 AC 217 ms
110,068 KB
testcase_26 AC 76 ms
71,512 KB
testcase_27 AC 133 ms
100,884 KB
testcase_28 AC 131 ms
99,912 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
L = list(map(int,input().split()))
l = []
for i in range(N):
    l.append([L[i],i])
    
l.sort()

left = l[0][1]
right = l[0][1]

ans = 1
mod = 998244353

for i in range(1,N):
    if l[i][1] < left:
        left = l[i][1]
    elif l[i][1] > right:
        right = l[i][1]
    else:
        ans *= (right - left - i + 1)
        ans %= mod
print(ans)
0