Submission #854386

#TimeUsernameProblemLanguageResultExecution timeMemory
854386mychecksedadThe Collection Game (BOI21_swaps)C++17
50 / 100
46 ms1668 KiB
// #include <swaps.h> #include <bits/stdc++.h> using namespace std; #define ll long long int #define MOD (1000000000+7) #define MOD1 (998244353) #define pb push_back #define all(x) x.begin(), x.end() #define en cout << '\n' void schedule(int, int); vector<int> visit(); void answer(std::vector<int>); vector<int> B; void solve(int N, int V){ for(int i = 1; i <= N; ++i) B.pb(i); for(int i = 0; i < 500; ++i){ if(i&1){ for(int j = 2; j < N; j += 2) schedule(B[j - 1], B[j]); }else{ for(int j = 1; j < N; j += 2) schedule(B[j - 1], B[j]); } vector<int> vv = visit(); if(i&1){ for(int j = 2, k = 0; j < N; j += 2, ++k) if(!vv[k]) swap(B[j - 1], B[j]); }else{ for(int j = 1, k = 0; j < N; j += 2, ++k) if(!vv[k]) swap(B[j - 1], B[j]); } } answer(B); }
#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...