Submission #466016

#TimeUsernameProblemLanguageResultExecution timeMemory
466016Rafi22The Collection Game (BOI21_swaps)C++14
50 / 100
687 ms564 KiB
#include <bits/stdc++.h> #include "swaps.h" using namespace std; #define endl '\n' #define st first #define nd second #define pb push_back #define sz(x) (int)(x).size() #define ll long long ll mod=1000000007; int inf=1000000007; ll infl=1000000000000000007; void solve(int n,int v) { vector<int>ans(n); for(int i=0;i<n;i++) ans[i]=i+1; bool flag=0; while(v--) { for(int i=1+flag;i<n;i+=2) schedule(ans[i-1],ans[i]); vector<int>vec=visit(); int it=0; for(int i=1+flag;i<n;i+=2) if(!vec[it++]) swap(ans[i-1],ans[i]); flag=!flag; } 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...