#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(2, v);
append_store(99, v);
for (int i = 1; i <= n; i ++) {
append_and(1, 0, 99); // take the number
append_right(0, 0, k); // delete the number
// now we take the max between 1, 2
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);
append_left(7, 7, j);
append_left(8, 8, j);
append_or(4, 4, 7);
append_or(5, 5, 8);
append_right(7, 7, j);
append_right(8, 8, j);
append_and(6, 4, 5); // min between the two bits
append_or(3, 3, 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(10, 9, 4); // has the 1 bit
append_and(11, 9, 5);
append_or(7, 7, 10);
append_or(8, 8, 11);
}
append_move(7, 97);
append_move(8, 97);
append_move(2, 3);
append_and(3, 3, 97);
}
append_move(0, 2);
}
# |
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 |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
668 KB |
Wrong answer detected in grader |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
860 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
860 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |