# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
140146 | ggoh | Gondola (IOI14_gondola) | C11 | 0 ms | 0 KiB |
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"
int ch[100005],i;
int valid(int n, int inputSeq[])
{
int ST=-1,st,C=0;
for(i=0;i<n;i++)ch[i]=0;
for(i=0;i<n;i++)
{
if(ch[inputSeq[i]]==1){C=1;break;}
ch[inputSeq[i]]=1;
}
for(i=0;i<n;i++)
{
if(inputSeq[i]<=n){st=i-inputSeq[i]+1;st=(st+n)%n;
if(ST==-1)ST=st;
else if(ST!=st){C=1;break;}
}
}
if(C)return 0;
else return 1;
}
//----------------------
int replacement(int n, int gondolaSeq[], int replacementSeq[])
{
return -2;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}