結果

問題 No.365 ジェンガソート
ユーザー severrabaenseverrabaen
提出日時 2019-04-19 13:46:44
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 30 ms / 2,000 ms
コード長 903 bytes
コンパイル時間 2,186 ms
コンパイル使用メモリ 164,496 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-23 17:29:40
合計ジャッジ時間 3,402 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 2 ms
4,348 KB
testcase_15 AC 2 ms
4,348 KB
testcase_16 AC 22 ms
4,348 KB
testcase_17 AC 27 ms
4,348 KB
testcase_18 AC 4 ms
4,348 KB
testcase_19 AC 27 ms
4,348 KB
testcase_20 AC 10 ms
4,348 KB
testcase_21 AC 8 ms
4,348 KB
testcase_22 AC 22 ms
4,348 KB
testcase_23 AC 13 ms
4,348 KB
testcase_24 AC 21 ms
4,348 KB
testcase_25 AC 7 ms
4,348 KB
testcase_26 AC 17 ms
4,348 KB
testcase_27 AC 28 ms
4,348 KB
testcase_28 AC 17 ms
4,348 KB
testcase_29 AC 26 ms
4,348 KB
testcase_30 AC 18 ms
4,348 KB
testcase_31 AC 9 ms
4,348 KB
testcase_32 AC 8 ms
4,348 KB
testcase_33 AC 28 ms
4,348 KB
testcase_34 AC 6 ms
4,348 KB
testcase_35 AC 22 ms
4,348 KB
testcase_36 AC 29 ms
4,348 KB
testcase_37 AC 30 ms
4,348 KB
testcase_38 AC 29 ms
4,348 KB
testcase_39 AC 29 ms
4,348 KB
testcase_40 AC 29 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//↓template↓

#include "bits/stdc++.h"
using namespace std;
#define Would
#define you
#define all(n)  n.begin(),n.end()
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0 }, dy[] = { 0,1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

long long mod_pow(long long a, long long b) {
	long long res = 1;
	while (b) {
		if (b & 1) { res = res * a%MOD; }
		a = a * a%MOD;
		b >>= 1;
	}
	return res;
}

void addedge(int from, int to, int cost) {
	G[from].push_back({ to,cost });
	G[to].push_back({ from,cost });
}

//↑template↑

int n, k[100005], ans;
int main() {
	cin >> n;
	ans = n;
	for (int i = 0; i < n; ++i) { cin >> k[i]; }
	for (int i = n - 1; i >= 0; --i) {
		if (k[i] == ans) { --ans; }
	}
	cout << ans << endl;
}
0