답안 #1044043

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1044043 2024-08-05T06:39:10 Z yanb Sky Walking (IOI19_walk) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "vision.h"

using namespace std;

void def(int Y, int X, int K) {
	vector<int> ox(X);
	for (int i = 0; i < X; i++) {
		vector<int> Ns(Y);
		for (int j = 0; j < Y; j++) {
			Ns[j] = j * X + i;
		}
		ox[i] = add_or(Ns);
	}

	vector<int> oy(Y);
	for (int i = 0; i < Y; i++) {
		vector<int> Ns(X);
		for (int j = 0; j < X; j++) {
			Ns[j] = j + i * X;
		}
		oy[i] = add_or(Ns);
	}

	vector<int> dx(X);
	vector<int> Ns;
	for (int i = 0; i < X; i++) Ns.push_back(ox[i]);
	dx[0] = add_xor(Ns);
	for (int d = 1; d < X; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < X; i++) {
			Ns.push_back(add_and({ox[i], ox[i + d]}));
		}
		dx[d] = add_or(Ns);
	}

	vector<int> dy(Y);
	Ns.clear();
	for (int i = 0; i < Y; i++) Ns.push_back(oy[i]);
	dy[0] = add_xor(Ns);
	for (int d = 1; d < Y; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < Y; i++) {
			Ns.push_back(add_and({oy[i], oy[i + d]}));
		}
		dy[d] = add_or(Ns);
	}

	Ns.clear();
	for (int x = 0; x < X; x++) {
		for (int y = 0; y < Y; y++) {
			if (x + y == K) {
				Ns.push_back(add_and({dx[x], dy[y]}));
			}
		}
	}

	add_or(Ns);
}

void hw1(int Y, int X, int K) {
	vector<int> Ns;
	for (int i = 0; i + K < X * Y; i++) {
		Ns.push_back(add_and({i, i + K}));
	}
	add_or(Ns);
}

void k1(int Y, int X, int K) {
	vector<int> ox(X);
	for (int i = 0; i < X; i++) {
		vector<int> Ns(Y);
		for (int j = 0; j < Y; j++) {
			Ns[j] = j * X + i;
		}
		ox[i] = add_or(Ns);
	}

	vector<int> oy(Y);
	for (int i = 0; i < Y; i++) {
		vector<int> Ns(X);
		for (int j = 0; j < X; j++) {
			Ns[j] = j + i * X;
		}
		oy[i] = add_or(Ns);
	}

	vector<int> dx(X);
	vector<int> Ns;
	for (int i = 0; i < X; i++) Ns.push_back(ox[i]);
	dx[0] = add_xor(Ns);
	for (int d = 1; d < 2 && d < X; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < X; i++) {
			Ns.push_back(add_and({ox[i], ox[i + d]}));
		}
		dx[d] = add_or(Ns);
	}

	vector<int> dy(Y);
	Ns.clear();
	for (int i = 0; i < Y; i++) Ns.push_back(oy[i]);
	dy[0] = add_xor(Ns);
	for (int d = 1; d < 2 && d < Y; d++) {
		vector<int> Ns;
		for (int i = 0; i + d < Y; i++) {
			Ns.push_back(add_and({oy[i], oy[i + d]}));
		}
		dy[d] = add_or(Ns);
	}

	Ns.clear();
	for (int x = 0; x < X; x++) {
		for (int y = 0; y < Y; y++) {
			if (x + y == K) {
				Ns.push_back(add_and({dx[x], dy[y]}));
			}
		}
	}

	add_or(Ns);
}

void construct_network(int Y, int X, int K) {
	if (K == 1) k1(Y, X, K);
	else if (Y == 1 || X == 1) hw1(Y, X, K);
	else def(Y, X, K);
}

Compilation message

walk.cpp:2:10: fatal error: vision.h: No such file or directory
    2 | #include "vision.h"
      |          ^~~~~~~~~~
compilation terminated.