Submission #403594

#TimeUsernameProblemLanguageResultExecution timeMemory
403594b00n0rpThe Collection Game (BOI21_swaps)C++17
0 / 100
1 ms328 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<bits/stdc++.h> #include "swaps.h" using namespace std; void solve(int N, int V) { // // TODO implement this function // schedule(1, 2); // std::vector<int> v = visit(); // if (v[0] == 1) // answer({1, 2, 3, 4}); // else // answer({2, 1, 3, 4}); for(int k = 2; k <= N; k *= 2){ for(int j = k/2; j >= 1; j/= 2){ for(int i = 0; i < N; i ++){ int l = (i^j); if(l > i){ if((i&k) == 0){ schedule(i+1,l+1); } else{ schedule(l+1,i+1); } } } vector<int> gg = visit(); for(auto x:gg) assert(x); } } vector<int> ans; for(int i = 1; i <= N; i ++) ans.push_back(i); 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...