# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
953587 | emad234 | 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 <bits/stdc++.h>
#define ll long long
#define F first
#define S second
#define pii pair<ll, ll>
const ll mod = 1e9 + 7;
const ll mxN = 1e6 + 5;
using namespace std;
int valid(int n, int inputSeq[])
{
int st = 0;
int val = 1;
for (int i = 0; i < n; i++)
{
if (inputSeq[i] <= n)
{
st = i;
val = inputSeq[i];
break;
}
}
int og = st;
while (1)
{
st++;
val++;
if (st >= n)
st = 0;
if (val > n)
val = 1;
if (st == og)
break;
if (inputSeq[st] != val && inputSeq[st] <= n)
return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}