Submission #575821

#TimeUsernameProblemLanguageResultExecution timeMemory
575821CSQ31The Collection Game (BOI21_swaps)C++17
50 / 100
58 ms532 KiB
#include "swaps.h" #include <bits/stdc++.h> #define sz(a) (int)(a.size()) using namespace std; void solve(int n,int V){ vector<int>ans; for(int i=1;i<=n;i++)ans.push_back(i); for(int i=0;i<n;i++){ int c = 0; if(i&1){ for(int j=0;j+1<n;j+=2)schedule(ans[j],ans[j+1]); vector<int>res = visit(); for(int j=0;j+1<n;j+=2){ if(res[c])swap(ans[j],ans[j+1]); c++; } }else{ for(int j=1;j+1<n;j+=2)schedule(ans[j],ans[j+1]); vector<int>res = visit(); for(int j=1;j+1<n;j+=2){ if(res[c])swap(ans[j],ans[j+1]); c++; } } } reverse(ans.begin(),ans.end()); 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...