제출 #1244859

#제출 시각아이디문제언어결과실행 시간메모리
1244859j_vdd16자동 인형 (IOI18_doll)C++20
0 / 100
0 ms324 KiB
#include <iostream> #include <vector> #include <queue> #include "doll.h" using namespace std; #define loop(X, N) for (int X = 0; X < (N); X++) typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; typedef vector<ii> vii; typedef vector<vii> vvii; int numBits = 0; int rev(int n) { int out = 0; for (int i = 0; i < numBits; i++) { if (n & (1 << i)) out |= 1 << (numBits - 1 - i); } return out; } void create_circuit(int m, vi a) { vi c; //exits vi x, y; int n = a.size(); c.push_back(a[0]); int pow = 1; while (pow < n) { numBits++; pow *= 2; } if (pow > 1) { vi exits(pow); for (int j = 0; j < n - 1; j++) { exits[rev(j)] = a[j + 1]; } for (int j = n - 1; j < pow - 1; j++) { exits[rev(j)] = -1; } exits[rev(pow - 1)] = 0; for (int j = 1; j < pow / 2; j++) { x.push_back(-2 * j); y.push_back(-2 * j - 1); } for (int j = 0; j < pow / 2; j++) { x.push_back(exits[j * 2]); y.push_back(exits[j * 2 + 1]); } for (int i = 0; i < n; i++) c.push_back(-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...