제출 #100291

#제출 시각아이디문제언어결과실행 시간메모리
100291Dr_Cow자동 인형 (IOI18_doll)C++14
0 / 100
5 ms4556 KiB
#include <bits/stdc++.h> #include "doll.h" using namespace std; void create_circuit(int M, std::vector<int> A) { int l=A.size(); vector <int> C (M+1,0); vector <int> X,Y (263000,0); int d[263000]; // ## create_tree for (int i=1;i<l;i++){ X[i]=-2*i;Y[i]=-(2*i+1); } // ## create_bot d[0]=1;int k=1; for (int i=1;i<l;i*=2) { k*=2; for (int j=0;j<i;j++) { d[j+i]=d[j]*2; d[j]=d[j]*2-1; } } // ## transfer_bot for (int i=0;i<k;i++) { if (l>d[i]-1) { if ((k+i)%2==0) X[(k+i)/2]=A[d[i]-1]; else Y[(k+i)/2]=A[d[i]-1]; C[d[i]-1]=-1; } } // ## }
#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...