Submission #722366

#TimeUsernameProblemLanguageResultExecution timeMemory
722366JohannThe Collection Game (BOI21_swaps)C++14
50 / 100
478 ms620 KiB
// // --- Sample implementation for the task swaps --- // // To compile this program with the sample grader, place: // swaps.h swaps_sample.cpp sample_grader.cpp // in a single folder and run: // g++ swaps_sample.cpp sample_grader.cpp // in this folder. // #include "swaps.h" #include <bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define vb vector<bool> #define vi vector<int> #define vpii vector<pii> #define vvb vector<vb> #define vvi vector<vi> #define vvpii vector<vpii> #define sz(x) (int)(x).size() int N, V; void solve(int _N, int _V) { N = _N, V = _V; vi ans; for (int i = 1; i <= N; ++i) ans.push_back(i); bool offset = 0; for (int foo = 0; foo < V; ++foo) { for (int idx = offset; idx < N - 1; idx += 2) schedule(ans[idx], ans[idx + 1]); vi comp = visit(); for (int idx = offset; idx < N - 1; idx += 2) if (!comp[idx / 2]) swap(ans[idx], ans[idx + 1]); offset = (offset + 1) % 2; } answer(ans); }
#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...