Submission #558571

#TimeUsernameProblemLanguageResultExecution timeMemory
558571JomnoiGondola (IOI14_gondola)C++17
10 / 100
8 ms1108 KiB
#include <bits/stdc++.h> #include "gondola.h" using namespace std; int valid(int n, int inputSeq[]) { int pos = -1; for(int i = 0; i < n; i++) { if(inputSeq[i] <= n) { pos = i; } } if(pos == -1) { return 1; } int start = (inputSeq[pos] - pos - 1 + 2 * n) % n + 1; for(int i = 0; i < n; i++) { if(inputSeq[i] <= n and inputSeq[i] != (start + i - 1) % n + 1) { return 0; } } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { if(valid(n, inputSeq) == 0) { return 0; } // otherwise 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...