Submission #86925

#TimeUsernameProblemLanguageResultExecution timeMemory
86925antimirageGondola (IOI14_gondola)C++17
20 / 100
21 ms2176 KiB
#include "gondola.h"
#include <bits/stdc++.h>

using namespace std;

const int N = 3e5 + 5;

int n, u[N];

int valid(int N, int x[])
{
	n = N;
	for (int i = 0; i < n; i++)
	{
		if (u[x[i]] > 0)
			return 0;
		u[x[i]] = i + 1;
	}
	for (int i = 1; i < n; i++)
	{
		if ( u[i] != 0 && u[i + 1] != 0 && ((u[i] - 1) + 1) % n != u[i + 1] - 1)
			return 0;
	}
	if ( u[n] != 0 && u[1] != 0 && ((u[n] - 1) + 1) % n != u[1] - 1)
		return 0;
		
	return 1;
}	

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

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


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

int countReplacement(int n, int inputSeq[])
{
  return -3;
}
/**
1
30
16 26 18 19 20 13 22 21 24 25 17 27 28 29 30 1 2 3 11 5 6 8 7 9 10 12 4 23 14 15
**/
#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...