# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
367421 | KoD | 곤돌라 (IOI14_gondola) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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