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<bits/stdc++.h>
#include "gondola.h"
#define MAXN 500007
using namespace std;
int n;
int s[MAXN],last;
bool li[MAXN];
int valid(int N, int inputSeq[]){
n=N;
int mins=1;
for(int i=1;i<=n;i++){
s[i]=inputSeq[i-1];
s[i+n]=s[i];
if(s[i]<s[mins]){
mins=i;
}
}
if(s[mins]>n)return 1;
for(int i=mins+1;i<mins+n;i++){
if(s[i]<=n and s[i]!=s[mins]+i-mins)return 0;
if(s[i]>n){
if(li[s[i]])return 0;
li[s[i]]=true;
}
}
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... |