답안 #424057

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
424057 2021-06-11T15:58:46 Z madlogic Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
  int cur = H * (W - 1) + W - 1;
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      for (int k = 0; k < H; k++) {
        for (int x = 0; x < W; x++) {
          int xx = i * W + j;
          int yy = k * W + x;
          if ((abs(i - k) + abs(j - x) == K)) {
            int val = add_and({xx, yy});
            ++cur;
            if (val == 1) {
              v.push_back(cur);
            }
          }
        }
      }
    }
  }
  add_or(v);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:17:15: error: 'v' was not declared in this scope
   17 |               v.push_back(cur);
      |               ^
vision.cpp:24:10: error: 'v' was not declared in this scope
   24 |   add_or(v);
      |          ^