Submission #66360

#TimeUsernameProblemLanguageResultExecution timeMemory
66360KubalionzzaleGondola (IOI14_gondola)C++14
0 / 100
3 ms672 KiB
#include "gondola.h" #include <iostream> #include <algorithm> int valid(int n, int a[]) { bool visited[250010] = { 0 }; int remember = -1; for (int i = 0; i < n; ++i) { if (visited[a[i]]) return 0; else visited[a[i]] = 1; if (a[i] <= n) { if (remember == -1) remember = i; else { int val1 = a[remember]; int val2 = a[i]; if (val1 > val2) std::swap(val1, val2); if (i == remember + (val2 - val1)) continue; else 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...