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;
#define rep(i, j , k) for(int i = j; i < (int) k; i++)
typedef vector<int> vi;
const int N = 3e5 + 10;
int pos[N];
int valid(int n, int A[])
{
memset(pos , -1, sizeof(pos));
rep(i , 0 , n) {
if (~pos[A[i]]) return 0;
pos[A[i]] = i;
}
int last = -1;
rep(i , 0 , n)
if(~pos[i]) {
if (!~last) {
last = i;
continue;
}
if ((i - last) != (pos[i] - pos[last] + n) % n)
return 0;
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
# | 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... |