Submission #847344

#TimeUsernameProblemLanguageResultExecution timeMemory
847344Ahmed57The Collection Game (BOI21_swaps)C++17
0 / 100
1 ms344 KiB
#include <bits/stdc++.h> using namespace std; #include "swaps.h" void solve(int n,int v){ int rnks[n+1]; for(int i = 1;i<=n;i++)rnks[i] = i; bool odd = 0; int its = n/2; while(its--){ int st = odd+1; for(;st<n;st+=2){ schedule(rnks[st+1],rnks[st]); } vector<int> vis = visit(); st = odd+1;int ind = 0; for(;st<n;st+=2){ if(vis[ind])swap(rnks[st],rnks[st+1]); ind++; } odd = !odd; }vector<int> lol; for(int i = 1;i<=n;i++){ lol.push_back(rnks[i]); } answer(lol); }
#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...