이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gondola.h"
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int freq[3*MAXN];
int nseq[2*MAXN];
int valid(int n, int inputSeq[])
{
// int ult = 0;
for(int i = 0; i < n; i++){
nseq[i+1] = nseq[i+n+1] = inputSeq[i];
freq[inputSeq[i]]++;
if(freq[inputSeq[i]] == 2) return 0;
}
int ini = 0, auxi = n + 1;
for(int i = 1; i <= n; i++){
if(nseq[i] <= n && nseq[i] < auxi) ini = i, auxi = nseq[i];
// printf("%d %d\n", nseq[i], auxi);
}
//printf("\n");
//printf("%d\n",ini);
if(!ini) return 1;
int ult = auxi, ultaux = ini;
for(int i = ini+1; i < ini + n; i++){
if(nseq[i] <= n){
// printf("%d %d\n", nseq[i], ult );
if(nseq[i] <= ult ||nseq[i] - ult != i - ultaux) return 0;
ult = nseq[i];
ultaux = i;
}
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
for(int i = 0; i < n; i++){
nseq[i+1] = nseq[i+n+1] = gondolaSeq[i];
freq[gondolaSeq[i]]++;
}
if(freq[n+1] == 0) return 0;
for(int i = 1; i <= n; i++){
if(freq[i] == 0) replacementSeq[0] = i;
}
return 1;
}
//----------------------
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... |