Submission #434192

#TimeUsernameProblemLanguageResultExecution timeMemory
434192illyakrGondola (IOI14_gondola)C++14
20 / 100
12 ms716 KiB
#include <bits/stdc++.h> #include "gondola.h" using namespace std; bool used[301010]; int valid(int n, int inputSeq[]) { int mn = 1010101010, sv = -1; for (int i = 0; i < n; i++) { if (used[inputSeq[i]])return 0; used[inputSeq[i]] = true; if (mn > inputSeq[i]) { mn = inputSeq[i]; sv = i; } } if (mn > n)return 1; int go = mn; for (int i = sv - 1; i >= 0; i--) { go--; if (go < 1)go += n; if (inputSeq[i] > n)continue; if (inputSeq[i] != go)return 0; } for (int i = n - 1; i > sv; i--) { go--; if (go < 1)go += n; if (inputSeq[i] > n)continue; if (inputSeq[i] != go)return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; } /** 1 7 1 2 3 4 5 6 7 1 6 3 4 5 6 1 2 1 7 1 5 3 4 2 7 6 1 4 4 3 2 1 1 7 1 2 3 4 5 6 5 1 7 2 3 4 9 6 7 1 1 5 10 4 3 11 12 */
#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...