이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gondola.h"
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i = 0; i < ((int) n); i++)
#define all(a) a.begin(), a.end()
using namespace std;
int N =1e5+1;
signed valid(signed n, signed inputSeq[])
{
int minn = 251000, mini=-1;
rep(i,n) if((int)inputSeq[i]<minn) {minn=inputSeq[i]; mini=i;}
vector<int>x(n);
rep(i,n) x[(i+minn-1+n)%n]=inputSeq[(i+mini)%n];
rep(i,n) if(x[i]!=i+1&&x[i]<=n) return 0;
vector<int>doub;
rep(i,n) if(x[i]>n) doub.push_back(x[i]);
sort(all(doub));
rep(i,doub.size()-1) if(doub[i]==doub[i+1]) return 0;
return 1;
}
//----------------------
signed replacement(signed n, signed gondolaSeq[], signed replacementSeq[])
{
return -2;
}
//----------------------
signed countReplacement(signed n, signed 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... |