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 "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;
for(int i = ini+1; i < ini + n; i++){
if(nseq[i] <= n){
// printf("%d %d\n", nseq[i], ult );
if(nseq[i] <= ult) return 0;
ult = nseq[i];
}
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
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... |