# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
741404 | Alan | 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 <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);
}
}