Submission #830266

# Submission time Handle Problem Language Result Execution time Memory
830266 2023-08-19T01:56:22 Z pavement Vision Program (IOI19_vision) C++17
0 / 100
8 ms 4520 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

#define pb push_back

void construct_network(int H, int W, int K) {
	auto conv = [&](int r, int c) {
		return r * W + c;
	};
	vector<int> row(H, -1), col(W, -1);
	int ins = H * W;
	for (int i = 0; i < H; i++) {
		for (int j = i + 1; j < H; j++) {
			vector<int> cur1, cur2;
			for (int k = 0; k < W; k++) {
				cur1.pb(conv(i, k));
				cur2.pb(conv(j, k));
			}
			add_or(cur1);
			add_or(cur2);
			add_and({ins, ins + 1});
			ins += 3;
			row[j - i] = ins - 1;
		}
	}
	{
		vector<int> tmp;
		for (int i = 1; i < H; i++) {
			tmp.pb(row[i]);
		}
		if (tmp.empty()) {
			tmp.resize(H * W);
			iota(tmp.begin(), tmp.end(), 0);
		}
		add_or(tmp);
		add_not({ins});
		ins += 2;
		row[0] = ins - 1;
	}
	for (int i = 0; i < W; i++) {
		for (int j = i + 1; j < W; j++) {
			vector<int> cur1, cur2;
			for (int k = 0; k < H; k++) {
				cur1.pb(conv(k, i));
				cur2.pb(conv(k, j));
			}
			add_or(cur1);
			add_or(cur2);
			add_and({ins, ins + 1});
			ins += 3;
			col[j - i] = ins - 1;
		}
	}
	{
		vector<int> tmp;
		for (int i = 1; i < W; i++) {
			tmp.pb(col[i]);
		}
		if (tmp.empty()) {
			tmp.resize(H * W);
			iota(tmp.begin(), tmp.end(), 0);
		}
		add_or(tmp);
		add_not({ins});
		ins += 2;
		col[0] = ins - 1;
	}
	vector<int> fin;
	for (int i = 0; i <= K; i++) {
		int j = K - i;
		if (0 <= i && i < H && 0 <= j && j < W) {
			add_and({row[i], col[j]});
			fin.pb(ins);
			ins++;
		}
	}
	add_or(fin);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 976 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 2 ms 1488 KB WA in grader: Too many instructions
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 4520 KB WA in grader: Too many inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -