Submission #434038

# Submission time Handle Problem Language Result Execution time Memory
434038 2021-06-20T14:22:41 Z ScarletS Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K)
{
	vector<int> v;
	for (int i=0;i<h;++i)
		for (int j=0;j<w;++j)
		{
			for (int k=j+1;k<w;++k)
				if (k-j==K)
					v.push_back(add_and({i*W+j,i*W+k}))
			for (int k=i+1;k<h&&k-j<=K;++k)
			{
				if (k-i==K)
					v.push_back(add_and({i*W+j,k*W+j}));
				else
				{
					if (0<=j-K+k-i)
						v.push_back(add_and(i*W+j,k*W+j-K+k-i));
					if (j+K-k+i<w)
						v.push_back(add_and(i*W+j,k*W+j+K-k+i));
				}
			}
		}
	add_or(v);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:7:17: error: 'h' was not declared in this scope
    7 |  for (int i=0;i<h;++i)
      |                 ^
vision.cpp:8:18: error: 'w' was not declared in this scope
    8 |   for (int j=0;j<w;++j)
      |                  ^
vision.cpp:12:18: error: 'add_and' was not declared in this scope
   12 |      v.push_back(add_and({i*W+j,i*W+k}))
      |                  ^~~~~~~
vision.cpp:13:19: error: 'k' was not declared in this scope
   13 |    for (int k=i+1;k<h&&k-j<=K;++k)
      |                   ^
vision.cpp:26:2: error: 'add_or' was not declared in this scope
   26 |  add_or(v);
      |  ^~~~~~