Submission #768311

#TimeUsernameProblemLanguageResultExecution timeMemory
768311tigarGondola (IOI14_gondola)C++14
20 / 100
7 ms1196 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; bool check[2500050]; int valid(int n, int* inputSeq) { int last=-1, pos=-1; for(int i=0; i<n; i++) { if(inputSeq[i]<=n and last==-1){last=inputSeq[i]; pos=i;} else if(inputSeq[i]<=n) { if((last+i-pos)%n==(inputSeq[i])%n){last=inputSeq[i]; pos=i;} else {return 0;} } else if(check[inputSeq[i]])return 0; check[inputSeq[i]]=true; } return 1; } int replacement(int n, int* gondolaSeq, int* replacementSeq) { return 2005; } int countReplacement(int n, int* inputSeq) { return 24; } /*int main() { int n; cin>>n; int gondole[n]; for(int i=0; i<n; i++)cin>>gondole[i]; cout<<valid(n, gondole); }*/
#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...