Submission #267199

# Submission time Handle Problem Language Result Execution time Memory
267199 2020-08-16T01:03:41 Z ggooroo Vision Program (IOI19_vision) C++14
0 / 100
2 ms 1148 KB
#include "vision.h"
#include <cstdio>
#include <iostream>
#include <queue>
#define N 205
using namespace std;

int h, w, k, T, en, v[N][N];
int dr[4] = {-1, 0, 0, 1}, dc[4] = {0, -1, 1, 0};
queue<int> qr, qc, qe;
int pq_num(int p, int q) {
	return p * w + q;
}

void pu(int p, int q, int e) {
	if (p < 0 || p >= h || q < 0 || q >= w || v[p][q] == T) return;
	v[p][q] = T;
	qr.push(p);
	qc.push(q);
	qe.push(e);
}

void f(int p, int q, int k) {
	int i, tr, tc, te, re;
	pu(p, q, 0);
	while (!qr.empty()) {
		tr = qr.front(); qr.pop();
		tc = qc.front(); qc.pop();
		te = qe.front(); qe.pop();
		if (te == k) {
			re = add_and({pq_num(p, q), pq_num(tr, tc)});
			if (re == 1) {en = 1; return;}
		} else {
			for (i = 0; i < 4; i++) {
				pu(tr + dr[i], tc + dc[i], te + 1);
			}
		}
	}
}

void construct_network(int hh, int ww, int kk) {
	int i, j;
	h = hh;
	w = ww;
	k = kk;
	std::vector<int> Ns;
	for (i = 0; i < h; i++) {
		for (j = 0; j < w; j++) {
			T++;
			f(i, j, k);
			if (en == 1) return;
		}
	}
//	Ns = {0, 1};
//	int a = add_and(Ns);
//	Ns = {0, a};
//	int b = add_or(Ns);
//	Ns = {0, 1, b};
//	int c = add_xor(Ns);
//	add_not(c);

}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 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 1 ms 256 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 1 ms 256 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 1 ms 256 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 1 ms 384 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 1 ms 256 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 1148 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 256 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -