Submission #284188

#TimeUsernameProblemLanguageResultExecution timeMemory
284188Bill_00Gondola (IOI14_gondola)C++14
20 / 100
18 ms3072 KiB
#include <stdlib.h> #include "gondola.h" int valid(int n, int a[]) { int k[250000]={0}; int y[250000]={0},d=0; for(int i=0;i<n;i++){ k[a[i]]++; } for(int i=0;i<n;i++){ if(k[a[i]]>1) return 0; } for(int i=0;i<n;i++){ if(a[i]<=n){ if(y[(a[i]-i+n)%n]==0) d++; y[(a[i]-i+n)%n]++; } } if(d<=1) return 1; return 0; } //---------------------- 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...