Submission #296174

#TimeUsernameProblemLanguageResultExecution timeMemory
296174arayiGondola (IOI14_gondola)C++17
20 / 100
21 ms2424 KiB
#include <bits/stdc++.h> #include "gondola.h" #define ad push_back using namespace std; const int N = 3e5 + 20; bool col[N]; int valid(int n, int inputSeq[]) { vector <int> a; for (int i = 0; i < n; i++) a.ad(inputSeq[i]); for (int i = 0; i < n; i++) a.ad(inputSeq[i]); int i1 = -1; for (int i = 0; i < n; i++) { if(col[a[i]]) return 0; col[a[i]] = true; if(a[i] <= n) { i1 = (i - a[i] + 1 + n) % n; } } if(i1 == -1) return 1; for (int i = i1; i < i1 + n; i++) { if(a[i] > n) continue; if(i - i1 + 1 != a[i]) 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...