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;
const int MAXN = 100010;
int correct[MAXN];
int valid(int n, int seq[])
{
int id = 0;
for(int i = 0; i < n; i++)
if(seq[i] <= n)
{ id = i; break; }
correct[id] = seq[id];
for(int i = id + 1; i < n; i++)
{
correct[i] = correct[i - 1] + 1;
if(correct[i] > n) correct[i] = 1;
}
for(int i = id - 1; i >= 0; i--)
{
correct[i] = correct[i + 1] - 1;
if(correct[i] < 1) correct[i] = n;
}
for(int i = 0; i < n; i++)
if(seq[i] <= n && correct[i] != seq[i])
return 0;
return 1;
}
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -1;
}
int countReplacement(int n, int inputSeq[])
{
return -1;
}
/*
int N, SEQ[MAXN];
int main ()
{
scanf("%d", &N);
for(int i = 0; i < N; i++) scanf("%d", &SEQ[i]);
printf("%d\n", valid(N, SEQ));
}
*/
# | 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... |