#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 |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Incorrect min value |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |