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>
#define fi first
#define se second
#define eb emplace_back
#define em emplace
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
const int MAX = 101010;
const int INF = INT_MAX >> 1;
const ll LINF = LLONG_MAX >> 1;
int valid(int n, int arr[]) {
vector <bool> chk(250050);
int idx = -1, val;
for(int i = 0; i < n; i++) {
if(arr[i] <= n) {
idx = i;
val = arr[i];
break;
}
}
if(idx == -1) return 1;
for(int i = 0; i < n; i++) {
if(chk[arr[i]]) return 0;
chk[arr[i]] = true;
if(arr[(idx+i)%n] <= n && arr[(idx+i)%n] % n != (val + i) % 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... |