Submission #638384

#TimeUsernameProblemLanguageResultExecution timeMemory
638384ggohGondola (IOI14_gondola)C++14
20 / 100
14 ms1364 KiB
#include<gondola.h> #include<bits/stdc++.h> using namespace std; typedef long long lint; int valid(int n, int inputSeq[]) { vector<int>check(n+1); vector<int>copy(n); for(int i=0;i<n;i++) { copy[i]=inputSeq[i]; if(inputSeq[i]<=n)check[inputSeq[i]]=i+1; } sort(copy.begin(),copy.end()); for(int i=0;i<n;i++)if(copy[i]==copy[i+1])return 0; int c=0,ans=1,pos,t; for(int i=1;i<=n;i++) { if(check[i]) { if(!c)c=i,pos=check[i]; else { t=check[i]-pos; if(t<=0)t+=n; if(t!=i-c)ans=0; } } } return ans; } 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...