結果

問題 No.1438 Broken Drawers
ユーザー NatsubiSogan
提出日時 2021-03-26 23:26:51
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 563 ms / 2,000 ms
コード長 240 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 56,756 KB
最終ジャッジ日時 2024-11-29 01:43:16
合計ジャッジ時間 10,157 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
a2 = [(a[i], i) for i in range(n)]
a2.sort()
ans = 0
forbidden = set()
for i in range(n):
    if a2[i][1] not in forbidden:
        ans += 1
        forbidden.add(a2[i][1] - 1)
print(ans)
0