이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gondola.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define pb emplace_back
#define ll long long
#define ld long double
const int INF = 2e9 + 1;
const ll INFLL = 1e18 + 1;
const int mod = 1e9 + 7;
int valid(int n, int inputSeq[]) {
vector<int> a(n);
set<int> lol;
for (int i = 0; i < n; i++) {
a[i] = inputSeq[i];
lol.insert(a[i]);
}
if ((int)lol.size() != n) return 0;
int ind = -1;
for (int i = 0; i < n; i++) {
if (a[i] <= n) ind = i;
}
if (ind == -1) return 1;
int now = a[ind];
for (int i = 0; i < n; i++) {
if (a[ind] <= n && a[ind] != now) return 0;
ind++;
if (ind >= n) ind -= n;
now++;
if (now > n) now = 1;
}
return 1;
}
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... |