이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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);
}*/
append_print(0);
}
# | 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... |