Submission #617881

# Submission time Handle Problem Language Result Execution time Memory
617881 2022-08-01T16:15:21 Z Minindu2006 Vision Program (IOI19_vision) C++14
0 / 100
242 ms 972 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int h, w, k;
void solve()
{
	vector<int> allops;
	for (int i = 0; i < h; i++)
	{
		for (int j = 0; j < w; j++)
		{
			vector<int> kDis;
			for (int x = 0; x < h; x++)
			{
				for (int y = 0; y < w; y++)
				{
					if (abs(x - i) + abs(y - i) == k)
						kDis.push_back(x * w + y);
				}
			}
			allops.push_back(add_and({i * w + j, add_or(kDis)}));
		}
	}
	add_or(allops);
}

void solve6()
{
	vector<int> kDis;
	for (int x = 0; x < h; x++)
	{
		for (int y = 0; y < w; y++)
		{
			if (abs(x - 0) + abs(y - 0) == k)
				kDis.push_back(x * w + y);
		}
	}
	add_and({0, add_or(kDis)});
}
void construct_network(int H, int W, int K)
{
	h = H, w = W, k = K;
	if(!add_not(0))
		solve6();
	solve();
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 3), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 0), (1, 0), expected 0, but computed 1
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 242 ms 972 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB on inputs (0, 1), (0, 2), expected 0, but computed 1
3 Halted 0 ms 0 KB -