제출 #821586

#제출 시각아이디문제언어결과실행 시간메모리
821586prvocisloVision Program (IOI19_vision)C++17
44 / 100
17 ms4444 KiB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int h, w;
int withdist(int x, int y, int k) // mame aspon jeden ktory ma vzdialenost najviac k od policka x
{
	vector<int> v;
	for (int xi = 0; xi < h; xi++) for (int yi = 0; yi < w; yi++) if (abs(x - xi) + abs(y - yi) <= k) v.push_back(xi * w + yi);
	return add_or(v);
}
int more(int k) // je to aspon k
{
	vector<int> a; // tie andy tych regionov
	for (int i = 0; i + k <= h + w - 2; i++)
	{
		vector<int> o1 = { withdist(0, 0, i), withdist(h - 1, w - 1, h - 1 + w - 1 - (i + k)) };
		a.push_back(add_and(o1));

		vector<int> o2 = { withdist(0, w - 1, i), withdist(h - 1, 0, h - 1 + w - 1 - (i + k)) };
		a.push_back(add_and(o2));
	}
	return add_or(a);
}
void construct_network(int H, int W, int k)
{
	h = H, w = W;
	if (k >= h + w - 2) more(k);
	else add_xor({ more(k), more(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...