結果

問題 No.365 ジェンガソート
ユーザー femto
提出日時 2016-08-21 00:11:26
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 76,852 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-07 21:40:27
合計ジャッジ時間 2,254 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;

int a[100000];

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	for(int i = 0; i < N; i++) {
		cin >> a[i];
	}

	int m = N;
	for(int i = N - 1; i >= 0; i--) {
		if(a[i] == m) {
			m--;
		}
	}

	cout << m << endl;
}
0