Submission #1044053

# Submission time Handle Problem Language Result Execution time Memory
1044053 2024-08-05T06:48:22 Z yanb Vision Program (IOI19_vision) C++14
8 / 100
8 ms 1116 KB
#include <bits/stdc++.h>
#include "vision.h"

using namespace std;

int easy(int Y, int X, int K) {
	vector<int> ox(X);
	for (int i = 0; i < X; i++) {
		vector<int> Ns(Y);
		for (int j = 0; j < Y; j++) {
			Ns[j] = j * X + i;
		}
		ox[i] = add_or(Ns);
	}

	vector<int> oy(Y);
	for (int i = 0; i < Y; i++) {
		vector<int> Ns(X);
		for (int j = 0; j < X; j++) {
			Ns[j] = j + i * X;
		}
		oy[i] = add_or(Ns);
	}

	vector<int> dx(X);
	vector<int> Ns;
	for (int i = 0; i < X; i++) Ns.push_back(ox[i]);
	dx[0] = add_xor(Ns);
	for (int d = 1; d < X; d++) {
		vector<int> Ns;
		for (int i = 0; i < 1; i++) {
			Ns.push_back(add_and({ox[i], ox[i + d]}));
		}
		dx[d] = add_or(Ns);
	}

	vector<int> dy(Y);
	Ns.clear();
	for (int i = 0; i < Y; i++) Ns.push_back(oy[i]);
	dy[0] = add_xor(Ns);
	for (int d = 1; d < Y; d++) {
		vector<int> Ns;
		for (int i = 0; i < 1; i++) {
			Ns.push_back(add_and({oy[i], oy[i + d]}));
		}
		dy[d] = add_or(Ns);
	}

	Ns.clear();
	for (int x = 0; x < X; x++) {
		for (int y = 0; y < Y; y++) {
			if (x + y == K) {
				Ns.push_back(add_and({dx[x], dy[y]}));
			}
		}
	}

	return add_or(Ns);
}

void def(int Y, int X, int K) {
	vector<int> ox(X);
	for (int i = 0; i < X; i++) {
		vector<int> Ns(Y);
		for (int j = 0; j < Y; j++) {
			Ns[j] = j * X + i;
		}
		ox[i] = add_or(Ns);
	}

	vector<int> oy(Y);
	for (int i = 0; i < Y; i++) {
		vector<int> Ns(X);
		for (int j = 0; j < X; j++) {
			Ns[j] = j + i * X;
		}
		oy[i] = add_or(Ns);
	}

	vector<int> dx(X);
	vector<int> Ns;
	for (int i = 0; i < X; i++) Ns.push_back(ox[i]);
	dx[0] = add_xor(Ns);
	for (int d = 1; d < X; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < X; i++) {
			Ns.push_back(add_and({ox[i], ox[i + d]}));
		}
		dx[d] = add_or(Ns);
	}

	vector<int> dy(Y);
	Ns.clear();
	for (int i = 0; i < Y; i++) Ns.push_back(oy[i]);
	dy[0] = add_xor(Ns);
	for (int d = 1; d < Y; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < Y; i++) {
			Ns.push_back(add_and({oy[i], oy[i + d]}));
		}
		dy[d] = add_or(Ns);
	}

	Ns.clear();
	for (int x = 0; x < X; x++) {
		for (int y = 0; y < Y; y++) {
			if (x + y == K) {
				Ns.push_back(add_and({dx[x], dy[y]}));
			}
		}
	}
}

void hw1(int Y, int X, int K) {
	vector<int> Ns;
	for (int i = 0; i + K < X * Y; i++) {
		Ns.push_back(add_and({i, i + K}));
	}
	add_or(Ns);
}

void k1(int Y, int X, int K) {
	vector<int> ox(X);
	for (int i = 0; i < X; i++) {
		vector<int> Ns(Y);
		for (int j = 0; j < Y; j++) {
			Ns[j] = j * X + i;
		}
		ox[i] = add_or(Ns);
	}

	vector<int> oy(Y);
	for (int i = 0; i < Y; i++) {
		vector<int> Ns(X);
		for (int j = 0; j < X; j++) {
			Ns[j] = j + i * X;
		}
		oy[i] = add_or(Ns);
	}

	vector<int> dx(X);
	vector<int> Ns;
	for (int i = 0; i < X; i++) Ns.push_back(ox[i]);
	dx[0] = add_xor(Ns);
	for (int d = 1; d < 2 && d < X; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < X; i++) {
			Ns.push_back(add_and({ox[i], ox[i + d]}));
		}
		dx[d] = add_or(Ns);
	}

	vector<int> dy(Y);
	Ns.clear();
	for (int i = 0; i < Y; i++) Ns.push_back(oy[i]);
	dy[0] = add_xor(Ns);
	for (int d = 1; d < 2 && d < Y; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < Y; i++) {
			Ns.push_back(add_and({oy[i], oy[i + d]}));
		}
		dy[d] = add_or(Ns);
	}

	Ns.clear();
	for (int x = 0; x < X; x++) {
		for (int y = 0; y < Y; y++) {
			if (x + y == K) {
				Ns.push_back(add_and({dx[x], dy[y]}));
			}
		}
	}

	add_or(Ns);
}

void construct_network(int Y, int X, int K) {
	easy(Y, X, K);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 488 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 1 ms 348 KB Output is correct
9 Correct 1 ms 344 KB Output is correct
10 Correct 2 ms 348 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 1 ms 348 KB Output is correct
13 Correct 1 ms 348 KB Output is correct
14 Correct 1 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 1 ms 436 KB Output is correct
20 Correct 3 ms 860 KB Output is correct
21 Correct 2 ms 860 KB Output is correct
22 Correct 2 ms 860 KB Output is correct
23 Correct 2 ms 860 KB Output is correct
24 Correct 5 ms 720 KB Output is correct
25 Correct 3 ms 860 KB Output is correct
26 Correct 2 ms 860 KB Output is correct
27 Correct 4 ms 1116 KB Output is correct
28 Correct 4 ms 1116 KB Output is correct
29 Correct 8 ms 1116 KB Output is correct
30 Correct 4 ms 1116 KB Output is correct
31 Correct 4 ms 1116 KB Output is correct
32 Correct 0 ms 348 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 1116 KB on inputs (80, 199), (81, 199), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB on inputs (0, 1), (0, 2), expected 1, but computed 0
2 Halted 0 ms 0 KB -