답안 #422682

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
422682 2021-06-10T10:19:02 Z SSRS Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K){
  assert(H <= 30 && W <= 30);
  int cnt = H * W;
  vector<int> A;
  for (int x1 = 0; x1 < H; x1++){
    for (int y1 = 0; y1 < W; y1++){
      for (int x2 = 0; x2 < H; x2++){
        for (int y2 = 0; y2 < W; y2++){
          if (abs(x2 - x1) + abs(y2 - y1) == K){
            int a = x1 * H + y1;
            int b = x2 * H + y2;
            if (a < b){
              vector<int> id = {a, b};
              add_and(id);
              cnt++;
            }
          }
        }
      }
    }
  }
  vector<int> id;
  for (int i = H * W; i < cnt; i++){
    id.push_back(i);
  }
  add_or(id);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:16:15: error: 'add_and' was not declared in this scope
   16 |               add_and(id);
      |               ^~~~~~~
vision.cpp:28:3: error: 'add_or' was not declared in this scope
   28 |   add_or(id);
      |   ^~~~~~