Submission #1025390

# Submission time Handle Problem Language Result Execution time Memory
1025390 2024-07-17T01:25:48 Z byakko Vision Program (IOI19_vision) C++17
0 / 100
11 ms 2024 KB
#include "vision.h"
using namespace std;

void construct_network(int H, int W, int K) {
	vector<int> row(H), rowp(H);
	vector<int> col(W), colp(W);
	for(int i = 0; i < H; i++) {
		vector<int> cur;
		for(int j = 0; j < W; j++) cur.push_back(i*W + j);
		row[i] = add_or(cur);
		rowp[i] = add_not(add_xor(cur));
	}
	for(int j = 0; j < W; j++) {
		vector<int> cur;
		for(int i = 0; i < W; i++) cur.push_back(i*W + j);
		col[j] = add_or(cur);
		colp[j] = add_not(add_xor(cur));
	}
	vector<int> dist_i(K, -1), dist_j(K, -1);
	for(int d = 0; d <= min(K, H - 1); d++) {
		vector<int> cur;
		for(int i = 0; i + d < H; i++) {
			if(d > 0)
				cur.push_back(add_and({row[i], row[i + d]}));
			else {
				cur.push_back(add_and({row[i], rowp[i]}));
			}
		}
		dist_i[d] = add_or(cur);
	}
	for(int d = 0; d <= min(K, W - 1); d++) {
		vector<int> cur;
		for(int j = 0; j + d < W; j++) {
			if(d > 0)
				cur.push_back(add_and({col[j], col[j + d]}));
			else {
				cur.push_back(add_and({col[j], colp[j]}));
			}
		}
		dist_j[d] = add_or(cur);
	}

	vector<int> all;
	for(int i = 0; i <= K; i++) {
		if(dist_i[i] == -1) break;
		int j = K - i;
		if(dist_j[j] == -1) continue;
		all.push_back(add_and({dist_i[i], dist_j[j]}));
	}
	add_or(all);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 0 ms 348 KB on inputs (0, 0), (0, 1), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 11 ms 2024 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Incorrect 1 ms 348 KB on inputs (96, 18), (96, 19), expected 1, but computed 0
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB WA in grader: Invalid index
2 Halted 0 ms 0 KB -