Submission #1019038

#TimeUsernameProblemLanguageResultExecution timeMemory
1019038preskoGondola (IOI14_gondola)C++14
20 / 100
7 ms1368 KiB
#include<iostream> #include "gondola.h" #define MAXN 300010 bool used[MAXN]; int valid(int n, int inputSeq[]) { for(int i=0;i<n;i++) { if(used[inputSeq[i]])return 0; used[inputSeq[i]]=1; if(inputSeq[i]<=n) { int prev=i-1,valp=inputSeq[i]-1; if(prev<0)prev=n-1; if(valp<1)valp=n; int next=i+1,valn=inputSeq[i]+1; if(next>=n)next=0; if(valn>n)valn=1; if(inputSeq[prev]<=n && inputSeq[prev]!=valp)return 0; if(inputSeq[next]<=n && inputSeq[next]!=valn)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...