Submission #1053422

# Submission time Handle Problem Language Result Execution time Memory
1053422 2024-08-11T11:34:04 Z Tob Vision Program (IOI19_vision) C++14
12 / 100
1 ms 416 KB
#include <bits/stdc++.h>

#include "vision.h"

#define F first
#define S second
#define pb push_back

using namespace std;

typedef pair <int, int> pii;

void construct_network(int h, int w, int k) {
	int cnt = h*w;
	if (min(h, w) == 1) {
		vector <int> v;
		for (int i = 0; i < max(h, w)-k; i++) v.pb(add_and({i, i+k}));
		add_or(v);
		return;
	}
	if (max(h, w) <= 100) {
		vector <int> v;
		for (int i = 0; i < h; i++) {
			for (int j = 0; j < w; j++) {
				if (i+j == h+w-2) continue;
				int x = i, y = j-k;
				vector <int> vv;
				while (y < j) {
					x++;
					y++;
					if (x < h && y >= 0) vv.pb(x*w+y);
				}
				while (x > i) {
					x--;
					y++;
					if (x < h && y < w) vv.pb(x*w+y);
				}
				v.pb(add_or(vv));
				vv.pb(i*w+j);
				v.pb(add_or(vv));
			}
		}
		add_xor(v);
		return;
	}
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:14:6: warning: unused variable 'cnt' [-Wunused-variable]
   14 |  int cnt = h*w;
      |      ^~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 416 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 416 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 416 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 416 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 0 ms 348 KB Output is correct
12 Correct 0 ms 348 KB Output is correct
13 Correct 0 ms 348 KB Output is correct
14 Correct 0 ms 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 348 KB Output is correct
18 Correct 0 ms 348 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 344 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Integer parameter [name=num_gates] equals to 0, violates the range [1, 10000]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 416 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Incorrect 0 ms 348 KB on inputs (0, 0), (1, 1), expected 0, but computed 1
6 Halted 0 ms 0 KB -