제출 #463711

#제출 시각아이디문제언어결과실행 시간메모리
463711tomsyd자동 인형 (IOI18_doll)C++17
0 / 100
1 ms204 KiB
#include "doll.h" #include<bits/stdc++.h> using namespace std; void create_circuit(int M, vector<int> A) { /* if (M == A.size()){ vector<int> C(M + 1); C[0] = A[0]; int N = A.size(); for (int i = 0; i<N-1; ++i) { C[A[i]] = A[i+1]; } C[A[N-1]] = 0; vector<int> X,Y; answer(C, X, Y); } */ if (M == 1){ int pow2 = 1, N = A.size(); while (pow2 < N) pow2 <<= 1; vector<int> X(2*pow2),Y(2*pow2); for (int i=0; i<pow2; ++i){ X[i] = -(2*(i+1)+1); Y[i] = -(2*(i+1)+2); } while (pow2 > N+1){ pow2--; X.pop_back(); Y.pop_back(); } vector<int> C(M+1); C[0] = 1; C[1] = -1; X[X.size()-1] = 1; Y[Y.size()-1] = 0; int idx = X.size()-2, crt = N-1; while (crt > 0){ X[idx] = 1; Y[idx] = 1; idx--; crt -= 2; } 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...