Submission #1064614

#TimeUsernameProblemLanguageResultExecution timeMemory
1064614NemanjaSo2005Gondola (IOI14_gondola)C++17
10 / 100
7 ms1936 KiB
#include "gondola.h" #include<bits/stdc++.h> #define ll long long using namespace std; const int maxn=1e5+5; int N,niz[maxn],niz2[maxn]; void adjust(){ int najm=1; for(int i=1;i<=N;i++) if(niz[i]<niz[najm]) najm=i; for(int i=1;i<=N;i++){ if(i+najm-1<=N) niz2[i]=niz[i+najm-1]; else niz2[i]=niz[i+najm-N-1]; } for(int i=1;i<=N;i++) niz[i]=niz2[i]; } int valid(int n, int inputSeq[]){ N=n; for(int i=1;i<=N;i++) niz[i]=inputSeq[i-1]; adjust();/* for(int i=1;i<=N;i++) cout<<niz[i]<<" "; cout<<endl;*/ if(niz[1]>=N) return 1; int treba=niz[1]; for(int i=2;i<=N;i++){ treba++; if(treba==N+1) treba=1; if(niz[i]>N) continue; if(niz[i]!=treba) return 0; } return 1; } int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } int countReplacement(int n, int inputSeq[]) { return -3; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...