이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> c;
vector<int> x;
vector<int> y;
vector<vector<int>> cons;
void create_circuit(int m, std::vector<int> a) {
cons.resize(m+1);
c.resize(m+1, -1);
int maxPow = ceil(log2(a.size()));
if ( log2(a.size()) == maxPow ) {
maxPow++;
}
a.resize( pow(2,maxPow), -1 );
a.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++]-1];
x[j] = a[ord[cnt++]-1];
}
answer(c,x,y);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |