Submission #388846

# Submission time Handle Problem Language Result Execution time Memory
388846 2021-04-13T07:00:53 Z SuhaibSawalha1 Vision Program (IOI19_vision) C++17
0 / 100
200 ms 992 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

int dist (array<int, 2> a, array<int, 2> b) {
	return abs(a[0] - b[0]) + abs(a[1] - b[1]);
}

void construct_network(int n, int m, int k) {
	auto val = [&] (int i, int j) {
		return i * m + j;
	};
	vector<int> OR;
	int cur = n * m;
	for (int i = 0; i < n; ++i) {
		for (int j = 0; j < m; ++j) {
			for (int h = i; h < n; ++h) {
				for (int w = j + 1; w < m; ++w) {
					if (dist({i, j}, {h, w}) == k) {
						add_and({val(i, j), val(h, w)});
						OR.push_back(cur++);
					}
				}
			}
		}
	}
	add_or(OR);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB on inputs (0, 0), (1, 0), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 200 ms 992 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
4 Halted 0 ms 0 KB -