Submission #402476

#TimeUsernameProblemLanguageResultExecution timeMemory
402476dooweyThe Collection Game (BOI21_swaps)C++14
50 / 100
67 ms500 KiB
#include <bits/stdc++.h> #include "swaps.h" using namespace std; typedef long long ll; typedef pair<int, int> pii; #define fi first #define se second #define mp make_pair #define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0); void solve(int n, int q) { vector<int> ord; for(int i = 0 ; i < n; i ++ ) ord.push_back(i + 1); int cc; for(int go = 0; go < n; go ++ ){ if(go % 2 == 0){ for(int i = 0 ; i + 1 < n; i += 2){ schedule(ord[i], ord[i + 1]); } vector<int> cha = visit(); cc = 0; for(int i = 0; i + 1 < n; i += 2){ if(cha[cc] == 0) swap(ord[i], ord[i + 1]); cc ++ ; } } else{ for(int i = 1 ; i + 1 < n; i += 2){ schedule(ord[i], ord[i + 1]); } vector<int> cha = visit(); cc = 0; for(int i = 1; i + 1 < n; i += 2){ if(cha[cc] == 0) swap(ord[i], ord[i + 1]); cc ++ ; } } } answer(ord); }
#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...