Submission #284194

#TimeUsernameProblemLanguageResultExecution timeMemory
284194Bill_00Gondola (IOI14_gondola)C++14
20 / 100
16 ms2688 KiB
#include <stdlib.h> #include "gondola.h" #include <bits/stdc++.h> using namespace std; 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 a[], int replacementSeq[]) { int y[100000]={0}; for(int i=0;i<n;i++){ if(a[i]<=n){ y[(a[i]-i+n)%n]++; } } int e=0; for(int i=0;i<n;i++){ e=max(e,y[i]); } return n-e; } //---------------------- 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...