Submission #603022

# Submission time Handle Problem Language Result Execution time Memory
603022 2022-07-23T14:24:23 Z Clan328 Vision Program (IOI19_vision) C++17
0 / 100
23 ms 2644 KB
#include <bits/stdc++.h>

using namespace std;

#define pb push_back

int add_and(std::vector<int> Ns);

int add_or(std::vector<int> Ns);

int add_xor(std::vector<int> Ns);

int add_not(int N);

int transformCoords(int W, int i, int j) {
	return i*W+j;
}

bool isValid(int H, int W, int i, int j) {
	if (i < 0 || j < 0 || i >= H || j >= W) return false;
	return true;
}

int idx;

int calc1(int H, int W) {
	vector<int> Ns;
	// int idx = H*W;
	for (int i = 0; i < H; i++) {
		vector<int> arr;
		for (int j = 0; j < W; j++) arr.pb(i*W+j);
		add_or(arr);
		idx++;
	}

	int og = idx;
	for (int i = 0; i < H-1; i++) {
		add_and({og-H+i, og-H+i+1});
		Ns.pb(idx);
		idx++;
	}
	int consecOr1 = add_or(Ns);
	idx++;

	Ns = vector<int>();
	for (int i = 0; i < W; i++) {
		vector<int> arr;
		for (int j = 0; j < H; j++) arr.pb(j*W+i);
		add_or(arr);
		add_xor(arr);
		add_xor({idx, idx+1});
		Ns.pb(idx+2);
		idx+=3;
	}

	int consecXor1 = add_or(Ns);
	// for (int i = 0; i < Ns.size(); i++) cout << Ns[i] << " ";
	// 	cout << endl;
	idx += 2;
	return add_and({consecOr1, consecXor1});
}

int calc2(int H, int W) {
	vector<int> Ns;
	// int idx = H*W;
	for (int i = 0; i < W; i++) {
		vector<int> arr;
		for (int j = 0; j < H; j++) arr.pb(j*W+i);
		add_or(arr);
		idx++;
	}

	int og = idx;
	for (int i = 0; i < W-1; i++) {
		add_and({og-W+i, og-W+i+1});
		Ns.pb(idx);
		idx++;
	}
	int consecOr1 = add_or(Ns);
	idx++;

	Ns = vector<int>();
	for (int i = 0; i < H; i++) {
		vector<int> arr;
		for (int j = 0; j < W; j++) arr.pb(i*W+j);
		add_or(arr);
		add_xor(arr);
		add_xor({idx, idx+1});
		Ns.pb(idx+2);
		idx+=3;
	}

	int consecXor1 = add_or(Ns);
	idx += 2;
	return add_and({consecOr1, consecXor1});
}

void construct_network(int H, int W, int K) {
	idx = H*W;
	add_or({calc1(H, W) , calc2(H, W)});
	// cout << idx << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 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 23 ms 2644 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 3 ms 468 KB Output is correct
4 Correct 6 ms 624 KB Output is correct
5 Incorrect 0 ms 212 KB WA in grader: Instruction with no inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -