제출 #767725

#제출 시각아이디문제언어결과실행 시간메모리
767725t6twotwoVision Program (IOI19_vision)C++17
66 / 100
10 ms1140 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { if (max(H, W) <= 30 || min(H, W) == 1) { vector<int> cand; for (int i = 0; i < H; i++) { for (int j = 0; j < W; j++) { vector<int> v; for (int x = 0; x < H; x++) { for (int y = 0; y < W; y++) { if (abs(x - i) + abs(y - j) == K) { v.push_back(x * W + y); } } } if (!v.empty()) { cand.push_back(add_and({i * W + j, add_or(v)})); } } } add_or(cand); return; } if (K == 1) { vector<int> x(H); for (int i = 0; i < H; i++) { vector<int> v; for (int j = 0; j < W; j++) { v.push_back(i * W + j); } x[i] = add_or(v); } vector<int> y(W); for (int j = 0; j < W; j++) { vector<int> v; for (int i = 0; i < H; i++) { v.push_back(i * W + j); } y[j] = add_or(v); } vector<int> cand, u, v; for (int i = 0; i + 1 < H; i++) { u.push_back(add_and({x[i], x[i + 1]})); } for (int i = 0; i + 1 < W; i++) { v.push_back(add_and({y[i], y[i + 1]})); } add_or({add_and({add_or(u), add_xor(y)}), add_and({add_or(v), add_xor(x)})}); return; } vector<int> v; for (int i = 0; i < H; i++) { if (K - i < W) { v.push_back(i * W + K - i); } } add_and({0, add_or(v)}); }
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...