Submission #424075

# Submission time Handle Problem Language Result Execution time Memory
424075 2021-06-11T16:03:29 Z madlogic Vision Program (IOI19_vision) C++17
Compilation error
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 - 1) * W + W - 1;
    vector<int> v;
    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)) {
              add_and(xx, yy);
              ++cur;
              v.push_back(cur);
            }
          }
        }
      }
    }
    if (!v.empty())
      add_or(v);
  }

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:15:23: error: could not convert 'xx' from 'int' to 'std::vector<int>'
   15 |               add_and(xx, yy);
      |                       ^~
      |                       |
      |                       int