답안 #297372

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
297372 2020-09-11T14:17:56 Z mode149256 Vision Program (IOI19_vision) C++14
52 / 100
147 ms 9840 KB
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
#define x first
#define y second

using vi = vector<int>;
using ll = long long;
using vii = vector<vi>;
using pi = pair<int, int>;

const int MX_IN = 10000;
int j = 0;
int h, w, k;

int con(pi a) {
	return a.x * w + a.y;
}
pi con(int a) {
	return {a / w, a % w};
}

int valid(pi a) {
	return int(0 <= a.x and a.x < h and 0 <= a.y and a.y < w);
}

int valid(int a) {
	return valid(con(a));
}

void findKit(int i, vi &kit) {
	pi prad = con(i);
	pi c = prad;
	c.y += k;
	if (valid(c)) kit.emplace_back(con(c));

	for (int i = 0; i <= k; ++i)
	{
		pi nc = prad;
		nc.y += i;
		nc.x += k - i;
		if (valid(nc))
			kit.emplace_back(con(nc));

		nc = prad;

		if (i != k) {
			nc.y -= i;
			nc.x += k - i;
			if (valid(nc))
				kit.emplace_back(con(nc));
		}
	}
}

void construct_network(int H, int W, int K) {
	h = H;
	w = W;
	k = K;
	vi andai;

	for (int i = 0; i < H * W; ++i)
	{
		vi kit;
		findKit(i, kit);
		if (kit.empty()) continue;

		if (j + 2 + 1 <= MX_IN) {
			int n = add_or(kit);
			andai.emplace_back(add_and({i, n}));
			j += 2;
		}
	}

	add_or(andai);
	// std::vector<int> Ns;
	// Ns = {0, 1};
	// int a = add_and(Ns);
	// Ns = {0, a};
	// int b = add_or(Ns);
	// Ns = {0, 1, b};
	// int c = add_xor(Ns);
	// add_not(c);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 1 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 1 ms 384 KB Output is correct
19 Correct 0 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 384 KB Output is correct
24 Correct 1 ms 384 KB Output is correct
25 Correct 1 ms 512 KB Output is correct
26 Correct 0 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 1 ms 384 KB Output is correct
19 Correct 0 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 384 KB Output is correct
24 Correct 1 ms 384 KB Output is correct
25 Correct 1 ms 512 KB Output is correct
26 Correct 0 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
28 Correct 4 ms 640 KB Output is correct
29 Correct 1 ms 256 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 256 KB Output is correct
32 Correct 2 ms 384 KB Output is correct
33 Correct 2 ms 512 KB Output is correct
34 Correct 3 ms 512 KB Output is correct
35 Correct 3 ms 512 KB Output is correct
36 Correct 1 ms 384 KB Output is correct
37 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 1 ms 384 KB Output is correct
19 Correct 0 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 384 KB Output is correct
24 Correct 1 ms 384 KB Output is correct
25 Correct 1 ms 512 KB Output is correct
26 Correct 0 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
28 Correct 4 ms 640 KB Output is correct
29 Correct 1 ms 256 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 256 KB Output is correct
32 Correct 2 ms 384 KB Output is correct
33 Correct 2 ms 512 KB Output is correct
34 Correct 3 ms 512 KB Output is correct
35 Correct 3 ms 512 KB Output is correct
36 Correct 1 ms 384 KB Output is correct
37 Correct 1 ms 256 KB Output is correct
38 Incorrect 73 ms 4460 KB on inputs (58, 84), (89, 65), expected 1, but computed 0
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 384 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 384 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 384 KB Output is correct
6 Correct 1 ms 384 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 1 ms 512 KB Output is correct
11 Correct 1 ms 384 KB Output is correct
12 Correct 1 ms 384 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 1 ms 384 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 1 ms 384 KB Output is correct
18 Correct 1 ms 256 KB Output is correct
19 Correct 1 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 0 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 288 KB Output is correct
3 Correct 5 ms 892 KB Output is correct
4 Correct 12 ms 1276 KB Output is correct
5 Correct 8 ms 896 KB Output is correct
6 Correct 6 ms 512 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 9 ms 1272 KB Output is correct
9 Correct 32 ms 2808 KB Output is correct
10 Correct 23 ms 2168 KB Output is correct
11 Correct 9 ms 1020 KB Output is correct
12 Correct 3 ms 256 KB Output is correct
13 Correct 1 ms 384 KB Output is correct
14 Correct 1 ms 384 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 256 KB Output is correct
17 Correct 1 ms 384 KB Output is correct
18 Correct 1 ms 384 KB Output is correct
19 Correct 1 ms 288 KB Output is correct
20 Correct 11 ms 1272 KB Output is correct
21 Correct 79 ms 5744 KB Output is correct
22 Correct 53 ms 4064 KB Output is correct
23 Correct 21 ms 256 KB Output is correct
24 Correct 11 ms 1304 KB Output is correct
25 Correct 73 ms 5104 KB Output is correct
26 Correct 12 ms 256 KB Output is correct
27 Correct 14 ms 1272 KB Output is correct
28 Correct 138 ms 8432 KB Output is correct
29 Correct 147 ms 9840 KB Output is correct
30 Correct 91 ms 3312 KB Output is correct
31 Correct 68 ms 256 KB Output is correct
32 Correct 2 ms 256 KB Output is correct
33 Correct 1 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 14 ms 1272 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 256 KB Output is correct
2 Correct 1 ms 384 KB Output is correct
3 Correct 1 ms 256 KB Output is correct
4 Correct 1 ms 256 KB Output is correct
5 Correct 1 ms 256 KB Output is correct
6 Correct 1 ms 256 KB Output is correct
7 Correct 1 ms 256 KB Output is correct
8 Correct 1 ms 256 KB Output is correct
9 Correct 1 ms 256 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Correct 1 ms 256 KB Output is correct
12 Correct 1 ms 256 KB Output is correct
13 Correct 1 ms 256 KB Output is correct
14 Correct 1 ms 256 KB Output is correct
15 Correct 1 ms 256 KB Output is correct
16 Correct 1 ms 384 KB Output is correct
17 Correct 0 ms 256 KB Output is correct
18 Correct 1 ms 384 KB Output is correct
19 Correct 0 ms 256 KB Output is correct
20 Correct 1 ms 256 KB Output is correct
21 Correct 1 ms 256 KB Output is correct
22 Correct 0 ms 256 KB Output is correct
23 Correct 1 ms 384 KB Output is correct
24 Correct 1 ms 384 KB Output is correct
25 Correct 1 ms 512 KB Output is correct
26 Correct 0 ms 256 KB Output is correct
27 Correct 1 ms 256 KB Output is correct
28 Correct 4 ms 640 KB Output is correct
29 Correct 1 ms 256 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 1 ms 256 KB Output is correct
32 Correct 2 ms 384 KB Output is correct
33 Correct 2 ms 512 KB Output is correct
34 Correct 3 ms 512 KB Output is correct
35 Correct 3 ms 512 KB Output is correct
36 Correct 1 ms 384 KB Output is correct
37 Correct 1 ms 256 KB Output is correct
38 Incorrect 73 ms 4460 KB on inputs (58, 84), (89, 65), expected 1, but computed 0
39 Halted 0 ms 0 KB -