結果

問題 No.365 ジェンガソート
ユーザー dnish
提出日時 2017-05-03 07:06:19
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 282 bytes
コンパイル時間 1,709 ms
コンパイル使用メモリ 166,104 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-14 06:59:00
合計ジャッジ時間 3,292 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i,n,N) for(int i=(n);i<(int)N;i++)
#define p(s) cout<<(s)<<endl
using namespace std;

int main(){
	int N;
	cin>>N;
	int a[100010];
	REP(i,0,N)	cin>>a[i];
	int ans;
	ans=N;
	for(int i=N-1;i>=0;i--){
		if(a[i]==ans) ans--;
	}
	p(ans);
	return 0;
}
0