#include <bits/stdc++.h>
#define pb push_back
using namespace std;
#include "gondola.h"
int valid(int n, int inputSeq[])
{
int ind = -1;
for(int i = 0; i < n; i++){
if(inputSeq[i] <= n) ind = i;
}
if(ind == -1) return 1;
vector<int> alternate(n);
for(int i = ind; i < n; i++){
alternate[i] = inputSeq[ind] + (i - ind);
if(alternate[i] > n) alternate[i] -= n;
}
for(int i = 0; i < ind; i++){
alternate[i] = alternate[n-1] + i + 1;
if(alternate[i] > n) alternate[i] -= n;
}
bool ok = 1;
map<int, int> vis;
for(int i = 0; i < n; i++){
if(vis[inputSeq[i]]) ok = 0;
vis[inputSeq[i]] = 1;
if(inputSeq[i] > n || inputSeq[i] == alternate[i]) continue;
ok = 0;
}
return ok;
}
//----------------------
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... |