Submission #899939

# Submission time Handle Problem Language Result Execution time Memory
899939 2024-01-07T10:30:47 Z rxlfd314 Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ari2 = array<int, 2>;
using ari3 = array<int, 3>;
using arl2 = array<ll, 2>;
using arl3 = array<ll, 3>;

#define vt vector
#define size(x) (int((x).size()))
#define all(x) begin(x), end(x)

#define REP(a, b, c, d) for (int a = (b); (d) > 0 ? a <= (c) : a >= (c); a += (d))
#define FOR(a, b, c) REP(a, b, c, 1)
#define ROF(a, b, c) REP(a, b, c, -1)

void ST6(int H, int W, int K) {
  vt<int> v;
  FOR(i, 0, H-1)
    FOR(j, 0, W-1)
      if (i + j == K)
        v.push_back(i * W + j);
  if (size(v) == 1) {
    add_and({0, v[0]});
    return;
  }
  add_or({v[0], v[1]});
  int cur = H * W;
  FOR(i, 2, size(v)-1)
    add_or({v[i], cur++});
}

void construct_network(int H, int W, int K) {
  /*
  if (min(H, W) == 1) {
    int cur = H * W;
    FOR(i, K, H*W-1) {
      add_and({i, i-K});
      cur++;
    }
    if (K == max(H, W) - 1)
      return;
    int cur2 = cur;
    add_or({H*W, H*W+1});
    FOR(i, H*W+2, cur-1) {
      add_or({i, cur2});
      cur2++;
    }
    return;
  }//*/
  ST6();
  return;
  int cnt = H * W;
  FOR(i, 0, H-1)
    FOR(j, 0, W-1)
      FOR(ii, i, H-1)
        FOR(jj, 0, W-1)
          if (abs(i - ii) + abs(j - jj) == K)
            add_and({i * W + j, ii * W + jj}), cnt++;
  if (cnt == H*W+1)
    return;
  add_or({H*W, H*W+1});
  int cur = cnt;
  FOR(i, H*W+2, cnt-1) {
    add_or({i, cur});
    cur++;
  }
  return;
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:52:7: error: too few arguments to function 'void ST6(int, int, int)'
   52 |   ST6();
      |       ^
vision.cpp:18:6: note: declared here
   18 | void ST6(int H, int W, int K) {
      |      ^~~