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;
void construct_instructions(int s, int n, int k, int q) {
int b = 2000;
vector<bool> v(k, 1), vv(b, 0);
while (v.size() != 2000) v.push_back(0);
append_store(99, v);
append_and(1, 0, 99);
append_right(2, 0, k);
for (int i = 1; i <= 1; i ++) {
for (int j = k - 1; j >= 0; j --) {
vv[j] = 1;
append_store(98, vv);
vv[j] = 0;
append_and(4, 1, 98); // take the j-th bit
append_and(5, 2, 98);
if (j == 0) {
append_or(4, 4, 7);
append_or(5, 5, 8);
}
if (j == 1) append_and(0, 4, 5); // min between the two bits
else {
append_and(6, 4, 5);
append_or(0, 0, 6); // storing it in ans
}
if (j == 0) break;
append_right(4, 4, j);
append_right(5, 5, j);
append_xor(9, 4, 5); // dif bits
append_and(7, 9, 4); // has the 1 bit
append_and(8, 9, 5);
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |