제출 #414205

#제출 시각아이디문제언어결과실행 시간메모리
414205sofapuden자동 인형 (IOI18_doll)C++14
37 / 100
111 ms10280 KiB
#include "doll.h" #include<bits/stdc++.h> using namespace std; vector<int> X, Y; void fin(int x, int n, int par, bool ok, int val, vector<int> &A, bool flag){ if((x|val) >= n){ if(ok)X[par] = A[x]; else Y[par] = A[x]; } else{ int no = X.size(); if(!flag){ if(ok)X[par] = -no-1; else Y[par] = -no-1; } X.push_back(0); Y.push_back(0); fin(x,n,no,1,val<<1,A,0); fin(x|val,n,no,0,val<<1,A,0); } } void create_circuit(int m, vector<int> A) { A.push_back(-1); int n = A.size(); while((int)A.size() < (1<<(int)ceil(log2(n)))){ A.push_back(-1); } A.back() = 0; n = A.size(); vector<int> C(m + 1,-1); vector<int> H(m + 1); fin(0,n,-1,0,1,A,1); 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...