제출 #416722

#제출 시각아이디문제언어결과실행 시간메모리
416722peuchVision Program (IOI19_vision)C++17
컴파일 에러
0 ms0 KiB
#include "vision.h" #include<bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { vector<int> finalAnswer; if(H * W <= 200){ for(int i = 0; i < H * W; i++){ for(int j = i + 1; j < H * W; j++){ int xi = i / W, yi = i % W; int xj = j / W, yj = j % W; vector<int> question (2); question[0] = i; question[1] = j; if(abs(xi - xj) + abs(yi - yj) == K) finalAnswer.push_back(add_and(question)); } } } else{ for(int i = 0; i < H * W; i++){ int xi = i / W, yi = i % W; if(xi + yi == k) finalAnswer.push_back(i); } } add_or(finalAnswer); }

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

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:22:18: error: 'k' was not declared in this scope
   22 |    if(xi + yi == k) finalAnswer.push_back(i);
      |                  ^