이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "registers.h"
using namespace std;
typedef long long ll;
vector<bool> num(ll num) {
vector<bool> res(2000);
for (int i = 0; i < 2000; i++) {
ll numBit = min(i, (int)(sizeof(ll)*4)-1);
res[i] = (num >> numBit) & 1;
}
return res;
}
void getMin(int x, int y) {
append_not(98, y);
append_add(98, 98, 99);
append_add(98, x, 98);
append_right(98, 98, 10);
append_and(x, x, 98);
append_not(98, 98);
append_and(y, y, 98);
append_or(x, x, y);
}
void construct_instructions(int s, int n, int k, int q) {
if (n <= 80) {
append_store(97, num((1 << k) - 1));
for (int i = 0; i < n-1; i++) {
append_right(i+1, i, k);
append_and(i, i, 97);
}
append_store(99, num(1));
for (int i = n-2; i >= 0; i--) {
getMin(i, i+1);
}
return;
}
append_store(97, num((1 << k) - 1));
append_store(99, num(1));
for (int i = 0; i < n-4; i++) {
append_right(i+1, i, k);
append_and(i, i, 97);
}
for (int i = n-6; i >= 0; i--) {
getMin(i, i+1);
}
for (int i = n-4; i > n-7; i--) {
append_right(i-1, i, k);
append_and(i, i, 99);
}
for (int i = n-4; i >= n-7; i--) {
getMin(0, i);
}
}
# | 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... |