結果

問題 No.365 ジェンガソート
ユーザー SutoraRen
提出日時 2016-06-30 17:37:49
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 1,198 ms
コンパイル使用メモリ 157,664 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-12 02:28:23
合計ジャッジ時間 2,559 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

const int MAX_N=1e5;

const int INF=1e8;

int N;
int a[MAX_N];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin>>N;
	REP(i,N){
		cin>>a[i];
	}
	int x=N;
	for (int i=N-1;i>=0;i--){
		if (a[i]==x){
			x--;
		}
	}
	cout<<x<<"\n";
	return 0;
}
0