Submission #741404

# Submission time Handle Problem Language Result Execution time Memory
741404 2023-05-14T03:43:29 Z Alan Bit Shift Registers (IOI21_registers) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;

void fill (vector<bool>& v) {
	while ((int) v.size() < 2000) v.push_back(0);
}

void construct_instructions(int s, int n, int k, int q) {
	if (s == 0) {
		vector<bool> AND, v1 {1};
		for (int i = 0; i < k; i++) AND.push_back(1);
		fill(AND);
		fill(v1);
		append_store(4, AND);
		append_store(5, v1);
		append_and(1, 0, 4);
		append_right(0, 0, k);
		if (k == 2) {
			append_right(2, 1, 1);
			append_and(3, 1, 5);
			append_xor(3, 2, 3);
			append_xor(2, 0, 1);
			append_add(2, 2, 5);
			append_right(2, 2, 2);
			append_add(2, 2, 3);
			append_right(2, 2, 1);
		}
		append_and(0, 0, 1);
		append_add(0, 0, 2);
	}
}

Compilation message

registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:14:3: error: 'append_store' was not declared in this scope
   14 |   append_store(4, AND);
      |   ^~~~~~~~~~~~
registers.cpp:16:3: error: 'append_and' was not declared in this scope
   16 |   append_and(1, 0, 4);
      |   ^~~~~~~~~~
registers.cpp:17:3: error: 'append_right' was not declared in this scope
   17 |   append_right(0, 0, k);
      |   ^~~~~~~~~~~~
registers.cpp:21:4: error: 'append_xor' was not declared in this scope
   21 |    append_xor(3, 2, 3);
      |    ^~~~~~~~~~
registers.cpp:23:4: error: 'append_add' was not declared in this scope
   23 |    append_add(2, 2, 5);
      |    ^~~~~~~~~~
registers.cpp:29:3: error: 'append_add' was not declared in this scope
   29 |   append_add(0, 0, 2);
      |   ^~~~~~~~~~