제출 #144347

#제출 시각아이디문제언어결과실행 시간메모리
144347johuthaVision Program (IOI19_vision)C++14
58 / 100
91 ms8312 KiB
#include <vector> #include "vision.h" #include <iostream> using namespace std; int H, W; int getv(int x, int y) { return y*W + x; } bool notin(int x, int y) { return x < 0 || x >= W || y < 0 || y >= H; } int smaller(int K) { vector<vector<int>> topd; vector<vector<int>> botd; for (int i = -H + 1; i < W; i++) { vector<int> d; for (int j = 0; j < H; j++) { int x = i + j; int y = H - 1 - j; if (notin(x, y)) continue; d.push_back(getv(x, y)); } topd.push_back(d); } for (int i = 0; i < W + H - 1; i++) { vector<int> d; for (int j = 0; j < H; j++) { int x = i - j; int y = H - 1 - j; if (notin(x, y)) continue; d.push_back(getv(x, y)); } botd.push_back(d); } vector<int> dia1; vector<int> dia2; for (int i = 0; i < (int)botd.size() - K; i++) { vector<int> allt; vector<int> allb; for (int j = i; j <= i + K; j++) { for (int x : botd[j]) { allb.push_back(x); } for (int x : topd[j]) { allt.push_back(x); } } int or1 = add_or(allt); int xor1 = add_xor(allt); int bothin1 = add_xor({or1, xor1}); int or2 = add_or(allb); int xor2 = add_xor(allb); int bothin2 = add_xor({or2, xor2}); dia1.push_back(bothin1); dia2.push_back(bothin2); } int or1 = add_or(dia1); int or2 = add_or(dia2); return add_and({or1, or2}); } void construct_network(int iH, int iW, int K) { H = iH; W = iW; add_xor({smaller(K), smaller(K - 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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...