Submission #1053429

# Submission time Handle Problem Language Result Execution time Memory
1053429 2024-08-11T11:38:49 Z Zicrus Bit Shift Registers (IOI21_registers) C++17
21 / 100
0 ms 348 KB
#include <bits/stdc++.h>
#include "registers.h"
using namespace std;

typedef long long ll;

void n2k1() {
    append_move(1, 0);
	append_right(1, 1, 1);
	append_and(0, 0, 1);
}

vector<bool> num(ll num) {
    vector<bool> res(2000);
    for (int i = 0; i < 2000; i++) {
        ll numBit = min(i, (int)sizeof(ll)-1);
        res[i] = (num >> numBit) & 1;
    }
    return res;
}

void construct_instructions(int s, int n, int k, int q) {
	if (n == 2 && k == 1) return n2k1();

    append_store(99, num((1 << k) - 1));
    append_print(99);
    append_right(1, 0, k);
    append_print(1);
    append_and(0, 0, 99);
    append_print(0);
    append_store(99, num(1));
    append_print(99);
    append_not(2, 1);
    append_print(2);
    append_add(2, 2, 99);
    append_print(2);
    append_add(2, 0, 2);
    append_print(2);
    append_right(2, 2, 10);
    append_print(2);
    append_and(0, 0, 2);
    append_print(1);
    append_not(2, 2);
    append_print(2);
    append_and(1, 1, 2);
    append_print(0);
    append_or(0, 0, 1);
    append_print(0);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -