Submission #989285

#TimeUsernameProblemLanguageResultExecution timeMemory
989285PagodePaivaVision Program (IOI19_vision)C++17
Compilation error
0 ms0 KiB
#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 (stderr)

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>