Submission #418504

#TimeUsernameProblemLanguageResultExecution timeMemory
418504FlippenFazMechanical Doll (IOI18_doll)C++11
10 / 100
1 ms204 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<int> c; vector<int> x; vector<int> y; vector<vector<int>> cons; void answer(vector<int> one, vector<int> two, vector<int> three); void create_circuit(int m, vector<int> a) { cons.resize(m+1); c.resize(m+1, -1); c[0] = a[0]; int maxPow = ceil(log2(a.size()-1)); a.resize( pow(2,maxPow), -1 ); if (a.back() == -1) { a.back() = 0; } a.push_back(0); for (int j = 1; j < pow(2,maxPow); j++) { x.push_back(-j*2 ); y.push_back(-j*2 - 1); } vector<int> ord; ord.push_back( pow(2,maxPow) ); int curPow = pow(2,maxPow-1); while (curPow > 0) { int curSize = ord.size(); for (int i = 0; i < curSize; i++) { ord.push_back(ord[i] - curPow); } curPow/=2; } int cnt = 0; for (int j = pow(2,maxPow)-2; j >= pow(2,maxPow-1)-1; j--) { y[j] = a[ord[cnt++]]; x[j] = a[ord[cnt++]]; } answer(c,x,y); }
#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...