답안 #989285

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
989285 2024-05-27T21:22:24 Z PagodePaiva Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>

using namespace std;

void construct_network(int h, int w, int k) {
	vector <int> linha;
	for(int i = 0;i < h;i++){
		vector <int> v;
		for(int j = 0;j < w;j++){		
			v.push_back(i*w+j);
		}
		linha.push_back(add_xor(v));
	}
	vector <int> coluna;
	for(int j = 0;j < w;j++){
		vector <int> v;
		for(int i = 0;i < h;i++){
			v.push_back(i*w+j);
		}
		coluna.push_back(add_xor(v));
	}
	int l = add_not(add_or(linha));
	int c = add_not(add_or(coluna));
	vector <int> aux;
	for(int i = 0;i < w-1;i++){
		aux.push_back(add_and({coluna[i], coluna[i+1]}));
	}
	int ll = add_or(aux);
	aux.clear();
	for(int i = 0;i < w-1;i++){
		aux.push_back(add_and({linjha[i], linha[i+1]}));
	}
	int cc = add_or(aux);
	add_or({add_and({l, ll}), add_and({c, cc})});
	return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:32:26: error: 'linjha' was not declared in this scope; did you mean 'linha'?
   32 |   aux.push_back(add_and({linjha[i], linha[i+1]}));
      |                          ^~~~~~
      |                          linha
vision.cpp:32:48: error: could not convert '{<expression error>, linha.std::vector<int>::operator[](((std::vector<int>::size_type)(i + 1)))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   32 |   aux.push_back(add_and({linjha[i], linha[i+1]}));
      |                                                ^
      |                                                |
      |                                                <brace-enclosed initializer list>