結果
| 問題 | No.1438 Broken Drawers | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2021-03-26 21:26:16 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 280 ms / 2,000 ms | 
| コード長 | 241 bytes | 
| コンパイル時間 | 321 ms | 
| コンパイル使用メモリ | 82,176 KB | 
| 実行使用メモリ | 113,536 KB | 
| 最終ジャッジ日時 | 2024-11-28 21:26:03 | 
| 合計ジャッジ時間 | 5,852 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 25 | 
ソースコード
N = int(input())
A = list(map(int, input().split()))
used = [False] * N
l = [i for i in range(N)]
l.sort(key = lambda x: A[x])
ans = 0
for i in l:
    if i != N - 1 and used[i + 1]:
        continue
    used[i] = True
    ans += 1
print(ans)
            
            
            
        