제출 #414601

#제출 시각아이디문제언어결과실행 시간메모리
414601schse자동 인형 (IOI18_doll)C++17
0 / 100
67 ms6956 KiB
#include "doll.h" #ifndef EVAL #include "grader.cpp" #endif #include <bits/stdc++.h> using namespace std; vector<int> C, X(1 << 18), Y(1 << 18); vector<bool> tree((1 << 18) + 5, false); void rec(int index, int value) { if (index >= 1 << 17) { if (tree[index]) X[index - 1] = value; else Y[index - 1] = value; } else if (tree[index]) rec(index * 2, value); else rec(index * 2 + 1, value); tree[index] = !tree[index]; } void create_circuit(int M, std::vector<int> A) { int N = A.size(); fill(tree.begin(), tree.end(), true); C.resize(M + 1); for (int i = 1; i < 1 << 17; i++) { X[i - 1] = i * -2; Y[i - 1] = i * -2 - 1; } for (int i = 1; i < N; i++) rec(1, A[i]); rec(1, 0); fill(C.begin(), C.end(), -1); C[0] = A[0]; 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...