Submission #905271

#TimeUsernameProblemLanguageResultExecution timeMemory
905271MinaRagy06The Collection Game (BOI21_swaps)C++17
50 / 100
351 ms1928 KiB
#include <bits/stdc++.h> #include "swaps.h" #ifdef MINA #include "grader.cpp" #endif using namespace std; typedef int64_t ll; void solve(int n, int v) { vector<int> a(n); for (int i = 0; i < n; i++) { a[i] = i + 1; } for (int cur = 0; cur < v; cur++) { for (int i = (cur & 1); i + 1 < n; i += 2) { schedule(a[i], a[i + 1]); } vector<int> ret = visit(); int idx = 0; for (int i = (cur & 1); i + 1 < n; i += 2) { if (!ret[idx]) { swap(a[i], a[i + 1]); } idx++; } } answer(a); }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...