#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
bool exist[25000];
int valid(int n, int a[]){
memset(exist, false, sizeof(exist));
int cnt = 0, pre = 0;
for (int i = 0; i < n; ++i){
if (exist[a[i]]) return false;
exist[a[i]] = true;
}
for (int i = 0; i < n; ++i){
if (a[i] <= n && pre != 0){
int x1 = a[pre], x2 = a[i];
if (x1 > x2){
if (pre + (n - x1) + x2 != i) return 0;
}
else if (x1 < x2){
if (i - pre != x2 - x1) return 0;
}
pre = i;
}
}
return true;
}
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... |