# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
367421 | KoD | Gondola (IOI14_gondola) | C++17 | 0 ms | 0 KiB |
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 <iostream>
#include <numeric>
#include <vector>
#include <algorithm>
#include <utility>
#ifndef LOCAL
#include "gondola.h"
#endif
using i32 = std::int32_t;
using i64 = std::int64_t;
using u32 = std::uint32_t;
using u64 = std::uint64_t;
using isize = std::ptrdiff_t;
using usize = std::size_t;
template <class T>
using Vec = std::vector<T>;
int valid(int n, int inputSeq[]) {
Vec<int> rep;
for (int i = 0; i < n; ++i) {
inputSeq[i] -= 1;
if (inputSeq[i] >= n) {
rep.push_back(inputSeq[i]);
}
}
std::sort(rep.begin(), rep.end());
if (std::unique(rep.begin(), rep.end()) != rep.end()) {
return 0;
}
if (rep.front() != n) {
return 0;
}
for (int i = 0; i < n; ++i) {
if (inputSeq[i] < n) {
for (int j = 0; j < n; ++j) {
const auto x = inputSeq[(i + j) % n];
if (x < n && x != (inputSeq[i] + j) % n) {
return 0;
}
}
return 1;
}
}
return 1;
}
int replacement(int n, int gondolaSeq, int replacementSeq[]) {
return 0;
}
int countReplacement(int n, int inputSeq[i]) {
return 0;
}
#ifdef LOCAL
int main() {
return 0;
}
#endif