結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  佐藤淳平 | 
| 提出日時 | 2019-09-10 14:07:55 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 11 ms / 2,000 ms | 
| コード長 | 336 bytes | 
| コンパイル時間 | 1,297 ms | 
| コンパイル使用メモリ | 157,396 KB | 
| 実行使用メモリ | 5,376 KB | 
| 最終ジャッジ日時 | 2024-07-02 16:15:25 | 
| 合計ジャッジ時間 | 3,739 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 41 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int arr[N];
    int ans = N;
    for (int i = 0; i < N; i++) cin >> arr[i];
    for (int i = (N-1); i >= 0; --i) {
        if (arr[i] == ans) --ans;
    }
    cout << ans << endl;
    return 0;
}
            
            
            
        