# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
599598 | definitelynotmee | Bit Shift Registers (IOI21_registers) | C++17 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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