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>
using namespace std;
int n;
int fix(int i)
{
return i % n;
}
int right(int i)
{
return fix(i+1);
}
int valid(int nn, int v[])
{
n = nn;
for (int i = 0; i < n; i++)
v[i]--;
int mi = 0;
for (int i = 1; i < n; i++)
if (v[i] < v[mi])
mi = i;
if (v[mi] >= n)
return 1;
int si = fix(mi - v[mi]);
if (v[si] != 0 && v[si] < n)
return 0;
for (int j = right(si), i = 1; j != si; j=right(j), i++)
if (v[j] != i && v[j] < n)
return 0;
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return 0;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |