# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
771609 | ttamx | 자동 인형 (IOI18_doll) | C++14 | 89 ms | 11040 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
void create_circuit(int m,vector<int> a) {
int n = a.size();
vector<int> c(m+1);
vector<int> lg(n+1);
for(int i=2;i<=n;i++)lg[i]=lg[i/2]+1;
vector<int> x,y;
auto add=[&](int u,int v){
x.emplace_back(u);
y.emplace_back(v);
return -x.size();
};
a.push_back(0);
int sz=n;
int lv=lg[sz-1]+1;
vector<int> res;
int cnt=1<<(lv-1);
int tar=-(x.size()+(1<<lv)-1);
int st=(1<<lv)-sz+1;
vector<int> pos(1<<lv);
for(int j=0;j<1<<lv;j++){
for(int k=0;k<lv;k++)if((j>>k)&1)pos[j]+=1<<(lv-k-1);
pos[j]++;
}
for(int k=0;k<cnt;k++){
int u=pos[k*2],v=pos[k*2+1];
Compilation message (stderr)
# | 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... |