Submission #424846

# Submission time Handle Problem Language Result Execution time Memory
424846 2021-06-12T10:51:04 Z donentseto Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

void construct_network (int h, int w, int k){

	vector <int> idx, idx1, last;
	int curr, curr1;

	for (int i = 0; i < h; i ++){
		for (int j = 0; j < w; j ++) idx.push_back (i * w + j);
		add_or (idx);
		idx.clear ();
	}
	for (int i = 0; i < h; i ++) idx.push_back (h * w + i);
	idx1.push_back (add_xor (idx));
	idx.clear ();
	for (int i = 0; i < h - k; i ++){
		for (int j = 0; j <= k; j ++) idx.push_back (h * w + i + j);
		add_or (idx);
		add_xor (idx);
		curr = add_not (add_xor (idx));
		idx1.push_back (add_and ({curr - 2, curr}));
		idx.clear ();
	}
	curr1 = add_or (idx1);
	last.push_back (curr1);
	idx1.clear ();

	for (int i = 0; i < w; i ++){
		for (int j = 0; j < h; j ++) idx.push_back (j * w + i);
		add_or (idx);
		idx.clear ();
	}
	for (int i = 0; i < w; i ++) idx.push_back (curr1 + i);
	idx1.push_back (add_xor (idx));
	idx.clear ();
	for (int i = 0; i < w - k; i ++){
		for (int j = 0; j <= k; j ++) idx.push_back (curr1 + i + j);
		add_or (idx);
		add_xor (idx);
		curr = add_not (add_xor (idx));
		idx1.push_back (add_and ({curr - 2, curr}));
		idx.clear ();
	}
	curr1 = add_or (idx1);
	last.push_back (curr1);
	idx1.clear ();

	for (int i = 1 - w; i < h; i ++){
		for (int j = 0; j < h; j ++) if (j - i >= 0 && j - i < w) idx.push_back (j * w + j - i);
		add_or (idx);
		idx.clear ();
	}
	int n = h + w - 1;
	for (int i = 0; i < n - k; i ++){
		idx1.push_back (add_and ({curr1 + i, curr1 + i + k}));
	}
	curr1 = add_or (idx1);
	idx1.clear ();

	for (int i = 0; i < n; i ++){
		for (int j = 0; j < h; j ++) if (i - j >= 0 && i - j < w) idx.push_back (j * w + i - j);
		add_or (idx);
		idx.clear ();
	}
	for (int i = 0; i < n - k; i ++){
		idx1.push_back (add_and ({curr1 + i, curr1 + i + k}));
	}
	last.push_back (add_or ({curr1, add_or (idx1)}));
	add_and (last);

}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:3: error: 'add_or' was not declared in this scope
   11 |   add_or (idx);
      |   ^~~~~~
vision.cpp:15:18: error: 'add_xor' was not declared in this scope
   15 |  idx1.push_back (add_xor (idx));
      |                  ^~~~~~~
vision.cpp:19:3: error: 'add_or' was not declared in this scope
   19 |   add_or (idx);
      |   ^~~~~~
vision.cpp:21:10: error: 'add_not' was not declared in this scope
   21 |   curr = add_not (add_xor (idx));
      |          ^~~~~~~
vision.cpp:22:19: error: 'add_and' was not declared in this scope
   22 |   idx1.push_back (add_and ({curr - 2, curr}));
      |                   ^~~~~~~
vision.cpp:25:10: error: 'add_or' was not declared in this scope
   25 |  curr1 = add_or (idx1);
      |          ^~~~~~
vision.cpp:41:10: error: 'add_not' was not declared in this scope
   41 |   curr = add_not (add_xor (idx));
      |          ^~~~~~~
vision.cpp:42:19: error: 'add_and' was not declared in this scope
   42 |   idx1.push_back (add_and ({curr - 2, curr}));
      |                   ^~~~~~~
vision.cpp:56:19: error: 'add_and' was not declared in this scope
   56 |   idx1.push_back (add_and ({curr1 + i, curr1 + i + k}));
      |                   ^~~~~~~
vision.cpp:67:19: error: 'add_and' was not declared in this scope
   67 |   idx1.push_back (add_and ({curr1 + i, curr1 + i + k}));
      |                   ^~~~~~~
vision.cpp:70:2: error: 'add_and' was not declared in this scope
   70 |  add_and (last);
      |  ^~~~~~~