#include "registers.h"
int n, k;
void compare(int x, int y) {
append_not(n, y);
append_or(n + 1, x, n);
append_and(n + 2, x, n);
for (int i = 0; i < k; i++) {
append_and(n + 3, n + 3, n + 1);
append_or(n + 3, n + 3, n + 2);
append_right(n + 1, n + 1, 1);
append_right(n + 2, n + 2, 1);
}
append_left(n + 3, n + 3, 1999);
append_right(n + 3, n + 3, 1999);
for (int i = 1; i < k; i++) {
append_left(n + 4, n + 3, i);
append_or(n + 3, n + 3, n + 4);
}
append_and(n + 5, x, n + 3);
append_xor(y, y, n + 5);
append_and(n + 5, y, n + 3);
append_xor(x, x, n + 5);
append_and(n + 5, x, n + 3);
append_xor(y, y, n + 5);
}
void construct_instructions(int s, int n, int k, int q) {
::n = n, ::k = k;
for (int i = 1; i < n; i++) {
if (2000 - k * (i + 1) > 0) append_left(i, 0, 2000 - k * (i + 1));
append_right(i, i, 2000 - k);
}
append_left(0, 0, 2000 - k);
append_right(0, 0, 2000 - k);
for (int i = 1; i < n; i++) compare(0, i);
for (int i = 1; i < n; i++) {
append_left(i, i, k * i);
append_or(0, 0, i);
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Wrong answer detected in grader |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Wrong answer detected in grader |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Wrong answer detected in grader |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Incorrect sorting |
2 |
Halted |
0 ms |
0 KB |
- |