제출 #152140

#제출 시각아이디문제언어결과실행 시간메모리
152140stefdascaVision Program (IOI19_vision)C++14
컴파일 에러
0 ms0 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { /* vector<int> Ns; Ns = {0, 1}; int a = add_and(Ns); Ns = {0, a}; int b = add_or(Ns); Ns = {0, 1, b}; int c = add_xor(Ns); add_not(c); */ int fi = H * W; int lst = H * W - 1; for(int i = 0; i < H; ++i) for(int j = 0; j < W; ++j) add_not(i * W + j), ++lst; int fi2 = lst + 1; int lst2 = lst; for(int i = 0; i < H; ++i) for(int j = 0; j < W; ++j) { vector<int>vec; for(int q = 0; q < H; ++q) for(int z = 0; z < W; ++z) if(abs(i - q) + abs(j - z) == K) vec.pb(q * W + z); add_and({add_and(i * W + j), add_and(vec)}); ++lst2; } vector<int>s; for(int i = fi2; i <= lst2; ++i) s.push_back(i); add_or(s); }

컴파일 시 표준 에러 (stderr) 메시지

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:29: error: 'class std::vector<int>' has no member named 'pb'
                         vec.pb(q * W + z);
                             ^~
vision.cpp:31:36: error: could not convert '((i * W) + j)' from 'int' to 'std::vector<int>'
             add_and({add_and(i * W + j), add_and(vec)});
                              ~~~~~~^~~
vision.cpp:31:55: error: could not convert '{<expression error>, add_and(std::vector<int>(vec))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
             add_and({add_and(i * W + j), add_and(vec)});
                                                       ^
vision.cpp:16:6: warning: unused variable 'fi' [-Wunused-variable]
  int fi = H * W;
      ^~