Submission #267273

# Submission time Handle Problem Language Result Execution time Memory
267273 2020-08-16T02:30:18 Z ggooroo Vision Program (IOI19_vision) C++14
44 / 100
794 ms 39544 KB
#include "vision.h"
#include <cstdio>
#include <iostream>
#include <queue>
#include <set>
#include <map>
#define N 205
using namespace std;

int h, w, k, T, en, mn = 2e9, mx, v[N][N];
int dr[4] = {-1, 0, 0, 1}, dc[4] = {0, -1, 1, 0};
set<int> vi[40005];
vector<int> ans;
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);
}

vector<int> in;
void f(int p, int q, int k) {
	int i, tr, tc, te, re, x1, x2, t1, t2;
	x1 = pq_num(p, q);
	pu(p, q, 0);
	in.clear();
	while (!qr.empty()) {
		tr = qr.front(); qr.pop();
		tc = qc.front(); qc.pop();
		te = qe.front(); qe.pop();
		if (te == k) {
			x2 = pq_num(tr, tc);
			if (vi[x1].count(x2) == 1) continue;
			vi[x1].insert(x2);
			vi[x2].insert(x1);
			in.push_back(x2);
//			in.push_back(x1);
//			in.push_back(x2);
//			re = add_and(in);
//			mn = min(mn, re);
//			mx = max(mx, re);
		} else {
			for (i = 0; i < 4; i++) {
				pu(tr + dr[i], tc + dc[i], te + 1);
			}
		}
	}
	if (!in.empty()) {
		t1 = add_or(in);
		t2 = add_and({t1, x1});
		ans.push_back(t2);
	}
}

void construct_network(int hh, int ww, int kk) {
	int i, j;
	h = hh;
	w = ww;
	k = kk;
	for (i = 0; i < h; i++) {
		for (j = 0; j < w; j++) {
			T++;
			f(i, j, k);
		}
	}
	add_or(ans);
//	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);

}

Compilation message

vision.cpp: In function 'void f(int, int, int)':
vision.cpp:29:21: warning: unused variable 're' [-Wunused-variable]
   29 |  int i, tr, tc, te, re, x1, x2, t1, t2;
      |                     ^~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2176 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 2 ms 2176 KB Output is correct
4 Correct 2 ms 2176 KB Output is correct
5 Correct 2 ms 2176 KB Output is correct
6 Correct 2 ms 2176 KB Output is correct
7 Correct 2 ms 2176 KB Output is correct
8 Correct 2 ms 2176 KB Output is correct
9 Correct 2 ms 2176 KB Output is correct
10 Correct 2 ms 2176 KB Output is correct
11 Correct 2 ms 2304 KB Output is correct
12 Correct 2 ms 2176 KB Output is correct
13 Correct 3 ms 2176 KB Output is correct
14 Correct 2 ms 2176 KB Output is correct
15 Correct 2 ms 2176 KB Output is correct
16 Correct 2 ms 2176 KB Output is correct
17 Correct 2 ms 2176 KB Output is correct
18 Correct 2 ms 2176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2176 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 2 ms 2176 KB Output is correct
4 Correct 2 ms 2176 KB Output is correct
5 Correct 2 ms 2176 KB Output is correct
6 Correct 2 ms 2176 KB Output is correct
7 Correct 2 ms 2176 KB Output is correct
8 Correct 2 ms 2176 KB Output is correct
9 Correct 2 ms 2176 KB Output is correct
10 Correct 2 ms 2176 KB Output is correct
11 Correct 2 ms 2304 KB Output is correct
12 Correct 2 ms 2176 KB Output is correct
13 Correct 3 ms 2176 KB Output is correct
14 Correct 2 ms 2176 KB Output is correct
15 Correct 2 ms 2176 KB Output is correct
16 Correct 2 ms 2176 KB Output is correct
17 Correct 2 ms 2176 KB Output is correct
18 Correct 2 ms 2176 KB Output is correct
19 Correct 2 ms 2176 KB Output is correct
20 Correct 2 ms 2176 KB Output is correct
21 Correct 2 ms 2176 KB Output is correct
22 Correct 2 ms 2176 KB Output is correct
23 Correct 2 ms 2176 KB Output is correct
24 Correct 2 ms 2208 KB Output is correct
25 Correct 2 ms 2304 KB Output is correct
26 Correct 2 ms 2176 KB Output is correct
27 Correct 2 ms 2176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2176 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 2 ms 2176 KB Output is correct
4 Correct 2 ms 2176 KB Output is correct
5 Correct 2 ms 2176 KB Output is correct
6 Correct 2 ms 2176 KB Output is correct
7 Correct 2 ms 2176 KB Output is correct
8 Correct 2 ms 2176 KB Output is correct
9 Correct 2 ms 2176 KB Output is correct
10 Correct 2 ms 2176 KB Output is correct
11 Correct 2 ms 2304 KB Output is correct
12 Correct 2 ms 2176 KB Output is correct
13 Correct 3 ms 2176 KB Output is correct
14 Correct 2 ms 2176 KB Output is correct
15 Correct 2 ms 2176 KB Output is correct
16 Correct 2 ms 2176 KB Output is correct
17 Correct 2 ms 2176 KB Output is correct
18 Correct 2 ms 2176 KB Output is correct
19 Correct 2 ms 2176 KB Output is correct
20 Correct 2 ms 2176 KB Output is correct
21 Correct 2 ms 2176 KB Output is correct
22 Correct 2 ms 2176 KB Output is correct
23 Correct 2 ms 2176 KB Output is correct
24 Correct 2 ms 2208 KB Output is correct
25 Correct 2 ms 2304 KB Output is correct
26 Correct 2 ms 2176 KB Output is correct
27 Correct 2 ms 2176 KB Output is correct
28 Correct 18 ms 3840 KB Output is correct
29 Correct 2 ms 2176 KB Output is correct
30 Correct 2 ms 2176 KB Output is correct
31 Correct 9 ms 2176 KB Output is correct
32 Correct 3 ms 2432 KB Output is correct
33 Correct 3 ms 2560 KB Output is correct
34 Correct 18 ms 3840 KB Output is correct
35 Correct 26 ms 3328 KB Output is correct
36 Correct 26 ms 2432 KB Output is correct
37 Correct 26 ms 2176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2176 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 2 ms 2176 KB Output is correct
4 Correct 2 ms 2176 KB Output is correct
5 Correct 2 ms 2176 KB Output is correct
6 Correct 2 ms 2176 KB Output is correct
7 Correct 2 ms 2176 KB Output is correct
8 Correct 2 ms 2176 KB Output is correct
9 Correct 2 ms 2176 KB Output is correct
10 Correct 2 ms 2176 KB Output is correct
11 Correct 2 ms 2304 KB Output is correct
12 Correct 2 ms 2176 KB Output is correct
13 Correct 3 ms 2176 KB Output is correct
14 Correct 2 ms 2176 KB Output is correct
15 Correct 2 ms 2176 KB Output is correct
16 Correct 2 ms 2176 KB Output is correct
17 Correct 2 ms 2176 KB Output is correct
18 Correct 2 ms 2176 KB Output is correct
19 Correct 2 ms 2176 KB Output is correct
20 Correct 2 ms 2176 KB Output is correct
21 Correct 2 ms 2176 KB Output is correct
22 Correct 2 ms 2176 KB Output is correct
23 Correct 2 ms 2176 KB Output is correct
24 Correct 2 ms 2208 KB Output is correct
25 Correct 2 ms 2304 KB Output is correct
26 Correct 2 ms 2176 KB Output is correct
27 Correct 2 ms 2176 KB Output is correct
28 Correct 18 ms 3840 KB Output is correct
29 Correct 2 ms 2176 KB Output is correct
30 Correct 2 ms 2176 KB Output is correct
31 Correct 9 ms 2176 KB Output is correct
32 Correct 3 ms 2432 KB Output is correct
33 Correct 3 ms 2560 KB Output is correct
34 Correct 18 ms 3840 KB Output is correct
35 Correct 26 ms 3328 KB Output is correct
36 Correct 26 ms 2432 KB Output is correct
37 Correct 26 ms 2176 KB Output is correct
38 Incorrect 794 ms 39544 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2304 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 2 ms 2176 KB Output is correct
4 Correct 3 ms 2176 KB Output is correct
5 Correct 2 ms 2432 KB Output is correct
6 Correct 3 ms 2432 KB Output is correct
7 Correct 3 ms 2432 KB Output is correct
8 Correct 3 ms 2304 KB Output is correct
9 Correct 2 ms 2304 KB Output is correct
10 Correct 2 ms 2304 KB Output is correct
11 Correct 3 ms 2176 KB Output is correct
12 Correct 3 ms 2176 KB Output is correct
13 Correct 3 ms 2176 KB Output is correct
14 Correct 3 ms 2176 KB Output is correct
15 Correct 2 ms 2432 KB Output is correct
16 Correct 3 ms 2432 KB Output is correct
17 Correct 3 ms 2432 KB Output is correct
18 Correct 3 ms 2432 KB Output is correct
19 Correct 3 ms 2432 KB Output is correct
20 Correct 4 ms 2304 KB Output is correct
21 Correct 2 ms 2176 KB Output is correct
22 Correct 2 ms 2176 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2176 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 7 ms 3324 KB Output is correct
4 Correct 139 ms 9588 KB Output is correct
5 Correct 240 ms 6648 KB Output is correct
6 Correct 277 ms 3720 KB Output is correct
7 Correct 264 ms 2304 KB Output is correct
8 Incorrect 6 ms 3836 KB WA in grader: Too many instructions
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 3836 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 2176 KB Output is correct
2 Correct 2 ms 2176 KB Output is correct
3 Correct 2 ms 2176 KB Output is correct
4 Correct 2 ms 2176 KB Output is correct
5 Correct 2 ms 2176 KB Output is correct
6 Correct 2 ms 2176 KB Output is correct
7 Correct 2 ms 2176 KB Output is correct
8 Correct 2 ms 2176 KB Output is correct
9 Correct 2 ms 2176 KB Output is correct
10 Correct 2 ms 2176 KB Output is correct
11 Correct 2 ms 2304 KB Output is correct
12 Correct 2 ms 2176 KB Output is correct
13 Correct 3 ms 2176 KB Output is correct
14 Correct 2 ms 2176 KB Output is correct
15 Correct 2 ms 2176 KB Output is correct
16 Correct 2 ms 2176 KB Output is correct
17 Correct 2 ms 2176 KB Output is correct
18 Correct 2 ms 2176 KB Output is correct
19 Correct 2 ms 2176 KB Output is correct
20 Correct 2 ms 2176 KB Output is correct
21 Correct 2 ms 2176 KB Output is correct
22 Correct 2 ms 2176 KB Output is correct
23 Correct 2 ms 2176 KB Output is correct
24 Correct 2 ms 2208 KB Output is correct
25 Correct 2 ms 2304 KB Output is correct
26 Correct 2 ms 2176 KB Output is correct
27 Correct 2 ms 2176 KB Output is correct
28 Correct 18 ms 3840 KB Output is correct
29 Correct 2 ms 2176 KB Output is correct
30 Correct 2 ms 2176 KB Output is correct
31 Correct 9 ms 2176 KB Output is correct
32 Correct 3 ms 2432 KB Output is correct
33 Correct 3 ms 2560 KB Output is correct
34 Correct 18 ms 3840 KB Output is correct
35 Correct 26 ms 3328 KB Output is correct
36 Correct 26 ms 2432 KB Output is correct
37 Correct 26 ms 2176 KB Output is correct
38 Incorrect 794 ms 39544 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -