Submission #416721

#TimeUsernameProblemLanguageResultExecution timeMemory
416721peuchVision 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> 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(i); } } add_or(finalAnswer); }

Compilation message (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(i);
      |                  ^
vision.cpp:22:33: error: 'class std::vector<int>' has no member named 'push'
   22 |    if(xi + yi == k) finalAnswer.push(i);
      |                                 ^~~~