제출 #795894

#제출 시각아이디문제언어결과실행 시간메모리
795894APROHACKVision Program (IOI19_vision)C++17
컴파일 에러
0 ms0 KiB
#include "vision.h" #include <bits/stdc++.h> #define pb push_back using namespace std; int h, w, k; int getPos(int x, int y){ return x*w + y; } void construct_network(int H, int W, int K) { h = H; w = W; k = K; vector<int>todos; for(int i = 0 ; i < H ; i ++){ for(int j = 0 ; j < W ; j ++){ vector<int>cuales; for(int xi = 0 ; xi < H ; xi ++){ for(int xj = 0; xj < W ; xj ++){ if(abs(xi-i) + abs(xj-j) == k)cuales.pb(getPos(xi, xj)); } } if(cuales.empty()){ continue; } int idxOr = add_or(cuales) todos.pb(add_and({idxOr, getPos(i, j)})); } } add_or(todos); }

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:27:4: error: expected ',' or ';' before 'todos'
   27 |    todos.pb(add_and({idxOr, getPos(i, j)}));
      |    ^~~~~
vision.cpp:27:42: error: expected primary-expression before ')' token
   27 |    todos.pb(add_and({idxOr, getPos(i, j)}));
      |                                          ^
vision.cpp:26:8: warning: unused variable 'idxOr' [-Wunused-variable]
   26 |    int idxOr = add_or(cuales)
      |        ^~~~~