結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  s_shohei | 
| 提出日時 | 2020-05-04 19:36:39 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 59 ms / 2,000 ms | 
| コード長 | 160 bytes | 
| コンパイル時間 | 261 ms | 
| コンパイル使用メモリ | 82,164 KB | 
| 実行使用メモリ | 81,852 KB | 
| 最終ジャッジ日時 | 2024-06-24 21:24:41 | 
| 合計ジャッジ時間 | 3,395 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 41 | 
ソースコード
n = int(input())
a = list(map(int, input().split()))
a.reverse()
now=n
cnt=0
for i in range(n):
    if a[i] == now:
        cnt+=1
        now-=1
print(n-cnt)
            
            
            
        