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"
std::vector<bool> pad(std::vector<bool> x) {
while (x.size() < 2000) x.push_back(false);
return x;
}
void construct_instructions(int s, int n, int k, int q) {
if (n == 2 && k == 1) {
append_move(1, 0);
append_right(1, 1, 1);
append_and(0, 0, 1);
}
if (n == 2 && k == 2) {
append_move(1, 0);
append_right(1, 1, 2);
//Store bit 1 in all of register 2
append_and(2, 0, 1);
append_store(3, pad({false, true}));
append_and(2, 2, 3);
append_move(3, 2);
append_right(3, 3, 1);
append_or(2, 3, 2);
//Store not bit 1 in all of register 3
append_not(3, 2);
//If bit 1, store answer in register 5
append_and(5, 0, 1);
append_and(5, 5, 2);
//If not bit 1, store answer in register 4
append_right(4, 0, 1);
append_or(0, 0, 4);
append_right(4, 1, 1);
append_or(1, 1, 4);
append_and(4, 0, 1);
append_store(6, pad({true}));
append_and(4, 4, 6);
append_and(4, 4, 3);
append_or(0, 4, 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... |