結果

問題 No.365 ジェンガソート
ユーザー nahcnuj
提出日時 2016-04-29 22:52:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 476 ms
コンパイル使用メモリ 59,524 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 18:32:38
合計ジャッジ時間 1,930 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int N;
	vector<int> a;
	
	cin >> N;
	int res = N;
	for (int i = 0, x, left; i < N; ++i) {
		cin >> x;
		a.push_back(x);
		
		if (i == 0) left = x;
		else if (x == left + 1) ++left, --res;
		else left = x, res = N;
	}
	
	cout << res << endl;
	
	return 0;
}
0