結果
| 問題 | No.365 ジェンガソート | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-05-28 09:05:28 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 20 ms / 2,000 ms | 
| コード長 | 482 bytes | 
| コンパイル時間 | 1,864 ms | 
| コンパイル使用メモリ | 195,156 KB | 
| 最終ジャッジ日時 | 2025-02-21 17:02:09 | 
| ジャッジサーバーID (参考情報) | judge5 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 41 | 
ソースコード
#include <bits/stdc++.h>
#define INF 1000000001LL
#define MOD 1000000007LL
#define long long long
#define all(x) x.begin(),x.end()
using namespace std;
int main()
{
	ios_base::sync_with_stdio(0); 
    cin.tie(0);
	int n;
    cin >> n;
    int ind = n;
    vector<int> arr(n);
    for(int i = 0; i<n; i++)
        cin >> arr[i];
    reverse(all(arr));
    for(int i = 0; i<n; i++)
    {
        if(arr[i] == ind)
            ind--;
    }
    cout << ind << endl;
    return 0;
}
            
            
            
        