# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
586200 | SeDunion | Gondola (IOI14_gondola) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "gondola.h"
#include<iostream>
using namespace std;
int valid(int n, int inputSeq[]) {
int id = -1;
for (int i = 0 ; i < n ; ++ i) {
if (inputSeq[i] <= n) id = i;
}
if (id == -1) return 1;
int x = inputSeq[i];
for (int i = 0 ; i + x <= n ; ++ i) {
int j = (i + id) % n;
if (inputSeq[j] != i + x) return 0;
}
for (int i = 0 ; i < x ; ++ i) {
int j = (id - i + n) % n;
if (inputSeq[j] != x - i) return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}