Submission #599598

#TimeUsernameProblemLanguageResultExecution timeMemory
599598definitelynotmeeBit Shift Registers (IOI21_registers)C++17
Compilation error
0 ms0 KiB
#include "registers.h"
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix= vector<vector<T>>;
const int T = 10000;

void getbit(int bit, int to){
	append_move(to,0);
	append_left(to,bit);
}

void construct_instructions(int s, int n, int k, int q) {
	getbit(0,1);
	getbit(1,2);
	getbit(2,3);
	getbit(3,4);
	append_and(5,2,4);
	append_or(6,1,3);

	append_xor(7,2,5);
	append_or(7,1,7);
	append_xor(8,4,5);
	append_or(8,3,8);
	append_and(6,6,7);
	append_and(6,6,8);

	append_right(5,1);
	append_move(0,5);
	append_or(0,0,6);
}
// 0: resposta
// 1: a1
// 2: a0
// 3: b1
// 4: b0
// 5: a0 and b0 = r0
// 6: a1 or b1 -> r1
// 7: (a0 xor r0) or a1
// 8: (b0 xor r0) or b1

Compilation message (stderr)

registers.cpp: In function 'void getbit(int, int)':
registers.cpp:16:20: error: too few arguments to function 'void append_left(int, int, int)'
   16 |  append_left(to,bit);
      |                    ^
In file included from registers.cpp:1:
registers.h:9:6: note: declared here
    9 | void append_left(int t, int x, int s);
      |      ^~~~~~~~~~~
registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:34:18: error: too few arguments to function 'void append_right(int, int, int)'
   34 |  append_right(5,1);
      |                  ^
In file included from registers.cpp:1:
registers.h:10:6: note: declared here
   10 | void append_right(int t, int x, int s);
      |      ^~~~~~~~~~~~