結果

問題 No.365 ジェンガソート
ユーザー snrnsidy
提出日時 2021-07-18 03:42:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 341 bytes
コンパイル時間 1,811 ms
コンパイル使用メモリ 194,128 KB
最終ジャッジ日時 2025-01-23 03:06:59
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 41
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

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

	int n, t;
	vector <int> v;

	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> t;
		v.push_back(t);
	}
	int res = n;

	for (int i = n - 1; i >= 0; i--)
	{
		if (res == v[i])
		{
			res--;
		}
	}

	cout << res << '\n';
	return 0;
}
0