Submission #752733

#TimeUsernameProblemLanguageResultExecution timeMemory
752733adrilen곤돌라 (IOI14_gondola)C++17
0 / 100
1 ms316 KiB
#include "gondola.h" #include<bits/stdc++.h> using namespace std; using ll = long long; typedef pair<int, int> pii; constexpr int max_sub_1 = 2.5e5 + 5; bool seen[max_sub_1] = { 0 }; int valid(int n, int inputSeq[]) { auto it = min_element(inputSeq, inputSeq + n); int val = *it, pos = it - inputSeq; int start_pos = pos; while (pos != start_pos || val == *it) { cout << val << " " << inputSeq[pos] << "\n"; if (inputSeq[pos] == val) { val++, pos++; if (pos >= n) pos -= n; val = min(val, n); continue; } if (inputSeq[pos] > n) { if (seen[inputSeq[pos]]) return 0; seen[inputSeq[pos]] = true; val++, pos++; if (pos >= n) pos -= n; val = min(val, n); continue; } 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...