Submission #618194

# Submission time Handle Problem Language Result Execution time Memory
618194 2022-08-02T02:31:02 Z joelau Vision Program (IOI19_vision) C++14
44 / 100
15 ms 4612 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
	vector<int> A;
	for (int i = 0; i < H; ++i) for (int j = 0; j < W; ++j) {
		vector<int> V;
		if (i+K < H) V.push_back((i+K)*W+j);
		if (i-K >= 0) V.push_back((i-K)*W+j);
		if (j+K < W) V.push_back(i*W+j+K);
		if (j-K >= 0) V.push_back(i*W+j-K);
		for (int x = 1; x < K; ++x) {
			int y = K-x;
			if (i+x < H && j+y < W) V.push_back((i+x)*W+j+y);
			if (i+x < H && j-y >= 0) V.push_back((i+x)*W+j-y);
			if (i-x >= 0 && j+y < W) V.push_back((i-x)*W+j+y);
			if (i-x >= 0 && j-y >= 0) V.push_back((i-x)*W+j-y);
		}
		if (!V.empty()) {
			add_or(V);
			A.push_back(i*W+j);
		}
	}
	for (int i = 0; i < A.size(); ++i) add_and({A[i],H*W+i});
	vector<int> V;
	for (int i = 0; i < A.size(); ++i) V.push_back(H*W+A.size()+i);
	add_or(V);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:25:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |  for (int i = 0; i < A.size(); ++i) add_and({A[i],H*W+i});
      |                  ~~^~~~~~~~~~
vision.cpp:27:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |  for (int i = 0; i < A.size(); ++i) V.push_back(H*W+A.size()+i);
      |                  ~~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 324 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 304 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 0 ms 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 324 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 304 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 0 ms 300 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 324 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 304 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 0 ms 300 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 2 ms 432 KB Output is correct
34 Correct 4 ms 596 KB Output is correct
35 Correct 4 ms 468 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 324 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 304 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 0 ms 300 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 2 ms 432 KB Output is correct
34 Correct 4 ms 596 KB Output is correct
35 Correct 4 ms 468 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Incorrect 11 ms 4612 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 296 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 340 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 340 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 1 ms 212 KB Output is correct
15 Correct 1 ms 300 KB Output is correct
16 Correct 1 ms 340 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 1 ms 340 KB Output is correct
19 Correct 1 ms 296 KB Output is correct
20 Correct 0 ms 212 KB Output is correct
21 Correct 1 ms 212 KB Output is correct
22 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 4 ms 848 KB Output is correct
4 Correct 15 ms 1888 KB Output is correct
5 Correct 11 ms 1360 KB Output is correct
6 Correct 6 ms 768 KB Output is correct
7 Correct 1 ms 212 KB Output is correct
8 Incorrect 3 ms 1064 KB WA in grader: Too many instructions
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1060 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 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 0 ms 212 KB Output is correct
7 Correct 0 ms 304 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
9 Correct 1 ms 340 KB Output is correct
10 Correct 1 ms 300 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 0 ms 212 KB Output is correct
13 Correct 1 ms 324 KB Output is correct
14 Correct 1 ms 296 KB Output is correct
15 Correct 1 ms 296 KB Output is correct
16 Correct 1 ms 304 KB Output is correct
17 Correct 1 ms 304 KB Output is correct
18 Correct 0 ms 300 KB Output is correct
19 Correct 0 ms 212 KB Output is correct
20 Correct 1 ms 212 KB Output is correct
21 Correct 0 ms 212 KB Output is correct
22 Correct 1 ms 212 KB Output is correct
23 Correct 1 ms 212 KB Output is correct
24 Correct 1 ms 212 KB Output is correct
25 Correct 1 ms 212 KB Output is correct
26 Correct 1 ms 212 KB Output is correct
27 Correct 1 ms 212 KB Output is correct
28 Correct 4 ms 596 KB Output is correct
29 Correct 1 ms 212 KB Output is correct
30 Correct 1 ms 212 KB Output is correct
31 Correct 0 ms 212 KB Output is correct
32 Correct 1 ms 340 KB Output is correct
33 Correct 2 ms 432 KB Output is correct
34 Correct 4 ms 596 KB Output is correct
35 Correct 4 ms 468 KB Output is correct
36 Correct 1 ms 340 KB Output is correct
37 Correct 1 ms 212 KB Output is correct
38 Incorrect 11 ms 4612 KB WA in grader: Too many inputs
39 Halted 0 ms 0 KB -