This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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) {
append_store(97, num((1 << k) - 1));
append_store(99, num(1));
ll shift = n*k-k;
append_right(1, 0, shift);
shift -= k;
while (shift > 0) {
append_right(2, 0, shift);
append_and(2, 2, 97);
getMin(1, 2);
shift -= k;
}
append_and(0, 0, 97);
getMin(0, 1);
}
# | 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... |