답안 #390628

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
390628 2021-04-16T12:19:21 Z SuhaibSawalha1 Vision Program (IOI19_vision) C++17
14 / 100
17 ms 1228 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
 
void construct_network(int n, int m, int k) {
	vector<int> OR;
	if (k == 1) {
		vector<int> row(n), col(m);
		for (int i = 0; i < n; ++i) {
			vector<int> p;
			for (int j = 0; j < m; ++j) {
				p.push_back(i * m + j);
			}
			row[i] = add_or(p);
		}
		for (int j = 0; j < m; ++j) {
			vector<int> p;
			for (int i = 0; i < n; ++i) {
				p.push_back(i * m + j);
			}
			col[j] = add_or(p);
		}
		int xor_for_rows = add_xor(row), xor_for_cols = add_xor(col);
		for (int i = 1; i < n; ++i) {
			OR.push_back(add_and({row[i - 1], row[i], xor_for_cols}));
		}
		for (int i = 1; i < m; ++i) {
			OR.push_back(add_and({col[i - 1], col[i], xor_for_rows}));
		}
	}
	else {
		int q = 1e4 - 1;
		for (int i = 0; i < n; ++i) {
			for (int j = 0; j < m; ++j) {
				vector<int> ask;
				for (int r = k; ~r; --r) {
					for (int dj : {j + k - r, j - k + r}) {
						if (i + r < n && dj < m && dj > -1) {
							ask.push_back((i + r) * m + dj);
						}
					}
				}
				if (ask.size() && q > 1) {
					q -= 2;
					OR.push_back(add_and({i * m + j, add_xor(ask)}));
				}
			}
		}
	}
	add_or(OR);
}
# 결과 실행 시간 메모리 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 Incorrect 1 ms 204 KB on inputs (0, 0), (2, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 Incorrect 1 ms 204 KB on inputs (0, 0), (2, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 Incorrect 1 ms 204 KB on inputs (0, 0), (2, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 Incorrect 1 ms 204 KB on inputs (0, 0), (2, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Incorrect 1 ms 332 KB on inputs (0, 0), (2, 0), expected 1, but computed 0
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 356 KB Output is correct
4 Incorrect 13 ms 1228 KB on inputs (0, 0), (31, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 1100 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 2 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
7 Correct 5 ms 716 KB Output is correct
8 Correct 6 ms 716 KB Output is correct
9 Correct 17 ms 1100 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 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 Incorrect 1 ms 204 KB on inputs (0, 0), (2, 0), expected 1, but computed 0
5 Halted 0 ms 0 KB -