답안 #915245

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
915245 2024-01-23T14:51:55 Z ByeWorld 곤돌라 (IOI14_gondola) C++14
10 / 100
9 ms 3376 KB
#include "gondola.h"
#include <bits/stdc++.h>
#define bupol __builtin_popcount
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
using namespace std;
const int MAXN = 3e5+10;
const int MAXK = 205;
const int LOG = 20;
const int MOD = 1e9+7;
const int SQRT = 520;
const int INF = 1e9+10;
typedef pair<int,int> pii;
typedef pair<int, pii> ipii;

int n;
int a[MAXN], idx = -1;
vector <int> vec;
bool use[MAXN];
int mn = INF, mx = -1;

int valid(int N, int inputSeq[])
{
	n = N;
	for(int i=1; i<=n; i++) a[i] = inputSeq[i-1];

	for(int i=1; i<=n; i++){
		if(mn > a[i]){
			mn = a[i]; idx = i;
		}
	}
	assert(idx != -1); 
	vec.pb(-1);
	for(int i=idx; i<=n; i++) vec.pb(a[i]);
	for(int i=1; i<=idx-1; i++) vec.pb(a[i]);

	for(int i=1; i<=n; i++){
		if(use[vec[i]]) return 0; // ngedobel
		use[vec[i]] = 1;

		if(vec[i] >= n+1) continue; // gpp gk dicek
 
		if(mx >= vec[i]) return 0; // loh kok turun
		mx = max(mx, vec[i]);
	}
 	return 1;
}

//----------------------

int replacement(int N, int gondolaSeq[], int replacementSeq[])
{
	n = N;
	for(int i=1; i<=n; i++) a[i] = gondolaSeq[i-1];
 	return -2;
}

//----------------------

int countReplacement(int N, int inputSeq[])
{
	n = N;
	for(int i=1; i<=n; i++) a[i] = inputSeq[i-1];
 	return -3;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 4 ms 2908 KB Output is correct
7 Correct 9 ms 3288 KB Output is correct
8 Correct 6 ms 3284 KB Output is correct
9 Correct 3 ms 2904 KB Output is correct
10 Correct 8 ms 3284 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 2476 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 3 ms 2908 KB Output is correct
7 Correct 8 ms 3288 KB Output is correct
8 Correct 6 ms 3288 KB Output is correct
9 Correct 4 ms 2652 KB Output is correct
10 Correct 9 ms 3376 KB Output is correct
11 Correct 1 ms 2396 KB Output is correct
12 Incorrect 1 ms 2396 KB Output isn't correct
13 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Integer -2 violates the range [0, 350000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2392 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2396 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 2392 KB Integer -3 violates the range [0, 1000000008]
2 Halted 0 ms 0 KB -