답안 #986426

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
986426 2024-05-20T13:43:45 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;
bool in(int i, int j) {
	return 0 <= i && i < n && 0 <= j && j < 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);
	}
	vector<int> ans;
	for (int i = 0;i < n - 1;i++) ans.push_back(add_and(r[i], r[i + 1]));
	for (int i = 0;i < m - 1;i++) ans.push_back(add_and(c[i], c[i + 1]));
	add_or(ans);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:28:57: error: could not convert 'r[i]' from 'int' to 'std::vector<int>'
   28 |  for (int i = 0;i < n - 1;i++) ans.push_back(add_and(r[i], r[i + 1]));
      |                                                      ~~~^
      |                                                         |
      |                                                         int
vision.cpp:29:57: error: could not convert 'c[i]' from 'int' to 'std::vector<int>'
   29 |  for (int i = 0;i < m - 1;i++) ans.push_back(add_and(c[i], c[i + 1]));
      |                                                      ~~~^
      |                                                         |
      |                                                         int