Submission #1024183

# Submission time Handle Problem Language Result Execution time Memory
1024183 2024-07-15T15:04:37 Z mdn2002 Bit Shift Registers (IOI21_registers) C++17
0 / 100
1 ms 348 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std; 

void construct_instructions(int s, int n, int k, int q) {
    int b = 2000;
    vector<bool> v(k, 1), vv(b, 0);
    while (v.size() != 2000) v.push_back(0);
    append_store(99, v);

    append_and(1, 0, 99);
    append_right(2, 0, k);
    for (int i = 1; i <= 1; i ++) {
        for (int j = k - 1; j >= 0; j --) {
            vv[j] = 1;
            append_store(98, vv);
            vv[j] = 0;

            append_and(4, 1, 98); // take the j-th bit
            append_and(5, 2, 98);

            if (j == 0) {
                append_left(7, 7, j);
                append_left(8, 8, j);
                append_or(4, 4, 7);
                append_or(5, 5, 8);
            }

            if (j == 1) append_and(0, 4, 5); // min between the two bits
            else {
                append_and(6, 4, 5);
                append_or(0, 0, 6); // storing it in ans
            }

            if (j == 0) break;
            append_xor(9, 4, 5); // dif bits
            append_and(7, 9, 4); // has the 1 bit
            append_and(8, 9, 5);
        }
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 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 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 1 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -