제출 #398569

#제출 시각아이디문제언어결과실행 시간메모리
398569ly20Vision Program (IOI19_vision)C++17
컴파일 에러
0 ms0 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; vector <int> resp; vector <int> col[MAXN], ln[MAXN]; int d0c, d0l; int idc[MAXN], idl[MAXN]; int d1l, d1c; void construct_network(int h, int w, int k) { for(int i = 0; i < h; i++) { for(int j = 0; j < w; j++) { int id = i * w + j; col[j].push_back(id); ln[i].push_back(id); } } for(int i = 0; i < h; i++) idl[i] = add_or(ln[i]); for(int i = 0; i < w; i++) idc[i] = add_or(col[i]); vector <int> cl, l; for(int i = 0; i < h; i++) l.push_back(idl[i]); for(int i = 0; i < w; i++) cl.push_back(idc[i]); d0c = add_not(add_xor(cl)); d0l = add_not(add_xor(l)); cl.clear(); l.clear(); for(int i = 0; i < h - 1; i++) { vector <int> t; t.push_back(idl[i]); t.push_back(idl[i + 1]); l.push_back(add_and(t)); } d1l = add_or(l); for(int i = 0; i < w - 1; i++) { vector <int> t; t.push_back(idc[i]); t.push_back(idc[i + 1]); cl.push_back(add_and(t)); } add_or({add_and(d0c, d1l), add_and(d0l, d1c)}); }

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

vision.cpp:5:18: error: 'MAXN' was not declared in this scope
    5 | vector <int> col[MAXN], ln[MAXN];
      |                  ^~~~
vision.cpp:5:28: error: 'MAXN' was not declared in this scope
    5 | vector <int> col[MAXN], ln[MAXN];
      |                            ^~~~
vision.cpp:7:9: error: 'MAXN' was not declared in this scope
    7 | int idc[MAXN], idl[MAXN];
      |         ^~~~
vision.cpp:7:20: error: 'MAXN' was not declared in this scope
    7 | int idc[MAXN], idl[MAXN];
      |                    ^~~~
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:13:4: error: 'col' was not declared in this scope; did you mean 'cosl'?
   13 |    col[j].push_back(id);
      |    ^~~
      |    cosl
vision.cpp:14:4: error: 'ln' was not declared in this scope; did you mean 'yn'?
   14 |    ln[i].push_back(id);
      |    ^~
      |    yn
vision.cpp:17:29: error: 'idl' was not declared in this scope
   17 |  for(int i = 0; i < h; i++) idl[i] = add_or(ln[i]);
      |                             ^~~
vision.cpp:17:45: error: 'ln' was not declared in this scope; did you mean 'yn'?
   17 |  for(int i = 0; i < h; i++) idl[i] = add_or(ln[i]);
      |                                             ^~
      |                                             yn
vision.cpp:18:29: error: 'idc' was not declared in this scope
   18 |  for(int i = 0; i < w; i++) idc[i] = add_or(col[i]);
      |                             ^~~
vision.cpp:18:45: error: 'col' was not declared in this scope; did you mean 'cosl'?
   18 |  for(int i = 0; i < w; i++) idc[i] = add_or(col[i]);
      |                                             ^~~
      |                                             cosl
vision.cpp:20:41: error: 'idl' was not declared in this scope
   20 |  for(int i = 0; i < h; i++) l.push_back(idl[i]);
      |                                         ^~~
vision.cpp:21:42: error: 'idc' was not declared in this scope
   21 |  for(int i = 0; i < w; i++) cl.push_back(idc[i]);
      |                                          ^~~
vision.cpp:26:15: error: 'idl' was not declared in this scope
   26 |   t.push_back(idl[i]); t.push_back(idl[i + 1]);
      |               ^~~
vision.cpp:32:15: error: 'idc' was not declared in this scope
   32 |   t.push_back(idc[i]); t.push_back(idc[i + 1]);
      |               ^~~
vision.cpp:35:18: error: could not convert 'd0c' from 'int' to 'std::vector<int>'
   35 |  add_or({add_and(d0c, d1l), add_and(d0l, d1c)});
      |                  ^~~
      |                  |
      |                  int
vision.cpp:35:37: error: could not convert 'd0l' from 'int' to 'std::vector<int>'
   35 |  add_or({add_and(d0c, d1l), add_and(d0l, d1c)});
      |                                     ^~~
      |                                     |
      |                                     int
vision.cpp:35:47: error: could not convert '{<expression error>, <expression error>}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
   35 |  add_or({add_and(d0c, d1l), add_and(d0l, d1c)});
      |                                               ^
      |                                               |
      |                                               <brace-enclosed initializer list>