이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "gondola.h"
using namespace std;
typedef long long ll;
#define pb push_back
#define f first
#define s second
#define all(x) x.begin(), x.end()
const int MOD = 1'000'000'007;
const int MX = 100'005;
//long double PI = 3.14159265358979323846264338327950;
int valid(int n, int inputSeq[])
{
//return -1;
int a[n+1];
memset(a,0,sizeof(a));
for(int i=0; i<n; i++){
if(inputSeq[i]>=n){
if(a[inputSeq[i]]!=0){
return 0;
}
a[inputSeq[i]]=i;
}
}
for(int i=1; i<=n; i++){
if(a[i]!=0&&a[i-1]){
if((a[i]+1)%n!=a[i]%n){
return 0;
}
}
}
return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
/*void caso_teste(){
}*/
/*int main(){
cin.tie(0);ios_base::sync_with_stdio(0);
//freopen ("in.txt","r",stdin);
int n_casos=1; //cin>>n_casos;
//while(n_casos--) caso_teste();
int a[5]={10, 4, 3, 11, 12};
cout<<valid(5, a);
}*/
# | 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... |