# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
437094 | Popax21 | Bit Shift Registers (IOI21_registers) | C++17 | 2 ms | 332 KiB |
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 <assert.h>
#include "registers.h"
#define NUM_BITS 2000
static inline int ulong(int n) {
int l = 0;
while((1 << l) < n) l++;
return l;
}
void calc_min(int n, int k) {
//Fill rest of registers with 1s
{
std::vector<bool> r(NUM_BITS);
for(int b = 0; b < NUM_BITS; b++) r[b] = (b >= n*k);
append_store(1, r);
append_or(0, 0, 1);
}
//Register plane algorithm
for(int i = 0; i < ulong(n); i++) {
//Split registers into two planes
append_move(1, 0);
append_right(1, 1, (1 << i) * k);
//Calculate comparsion-add operands
append_xor(2, 0, 1);
append_and(3, 2, 0);
append_and(4, 2, 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... |