Submission #1344049

#TimeUsernameProblemLanguageResultExecution timeMemory
1344049tkm_algorithmsGondola (IOI14_gondola)C++20
10 / 100
6 ms1092 KiB
#include "gondola.h"
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using P = pair<int, int>;
#define all(x) x.begin(), x.end()
#define rep(i, l, n) for (int i = l; i < (n); ++i)
#define sz(x) (int)x.size()
const char nl = '\n';

int valid(int n, int a[])
{
	int pos, san = -1;
	rep(i, 0, n)
		if (a[i] <= n)pos = i, san = a[i];
	if (san == -1)return 1;
	vector<int> sb(n+1);
	int x = san+1; sb[san] = pos;
	while (x != san) {
		sb[x] = (pos+1)%n;
		pos += 1, x += 1;
		if (x > n)x -= n;
	}
	
	bool ok = true;
	rep(i, 0, n) {
		if (a[i]>n)continue;
		ok &= sb[a[i]] == i;
	}
	return ok;
}

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

int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
  return -2;
}

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

int countReplacement(int n, int inputSeq[])
{
  return -3;
}



//1 2 3 4 5 6
//6 1 2 3 4 5
//5 6 1 2 3 4
//4 5 6 1 2 3
//3 4 5 6 1 2
//2 3 4 5 6 1
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...