Submission #702398

#TimeUsernameProblemLanguageResultExecution timeMemory
702398jamezzzThe Collection Game (BOI21_swaps)C++17
50 / 100
449 ms588 KiB
#include "swaps.h" #include <bits/stdc++.h> using namespace std; vector<int> v; void solve(int N,int V){ for(int i=1;i<=N;++i){ v.push_back(i); } int par=0; for(int it=0;it<V;++it){ for(int i=par;i+1<N;i+=2){ schedule(v[i],v[i+1]); } auto res=visit(); reverse(res.begin(),res.end()); for(int i=par;i+1<N;i+=2){ if(res.back()==0)swap(v[i],v[i+1]); res.pop_back(); } par=1-par; } answer(v); }
#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...