답안 #986429

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
986429 2024-05-20T13:53:29 Z thinknoexit Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int a[202][202], r[202], c[202];
int n, m;
void construct_network(int H, int W, int K) {
	n = H, m = W;
	for (int i = 0;i < n;i++) {
		for (int j = 0;j < m;j++) {
			a[i][j] = i * m + j;
		}
	}
	for (int i = 0;i < n;i++) {
		vector<int> Q;
		for (int j = 0;j < m;j++) Q.push_back(a[i][j]);
		r[i] = add_xor(Q);
	}
	for (int j = 0;j < m;j++) {
		vector<int> Q;
		for (int i = 0;i < n;i++) Q.push_back(a[i][j]);
		c[j] = add_xor(Q);
	}
	int same_rol = 0, same_col = 0;
	{
		vector<int> Q;
		for (int i = 0;i < n;i++) Q.push_back(r[i]);
		same_rol = add_not(add_or(Q));
	}
	{
		vector<int> Q;
		for (int i = 0;i < m;i++) Q.push_back(c[i]);
		same_col = add_not(add_or(Q));
	}
	int adj_rol = 0, adj_col = 0;
	{
		vector<int> Q;
		for (int i = 0;i < n - 1;i++) Q.push_back(add_and({ r[i], r[i + 1] }));
		adj_rol = add_or(Q);
	}
	{
		vector<int> Q;
		for (int i = 0;i < m - 1;i++) Q.push_back(add_and({ c[i], c[i + 1] }));
		adj_col = add_or(Q);
	}
	add_or({ add_xor(same_rol, adj_col), add_xor(same_col, adj_rol) });
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:46:19: error: could not convert 'same_rol' from 'int' to 'std::vector<int>'
   46 |  add_or({ add_xor(same_rol, adj_col), add_xor(same_col, adj_rol) });
      |                   ^~~~~~~~
      |                   |
      |                   int
vision.cpp:46:47: error: could not convert 'same_col' from 'int' to 'std::vector<int>'
   46 |  add_or({ add_xor(same_rol, adj_col), add_xor(same_col, adj_rol) });
      |                                               ^~~~~~~~
      |                                               |
      |                                               int
vision.cpp:46:67: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   46 |  add_or({ add_xor(same_rol, adj_col), add_xor(same_col, adj_rol) });
      |                                                                   ^
      |                                                                   |
      |                                                                   <brace-enclosed initializer list>