Submission #601278

# Submission time Handle Problem Language Result Execution time Memory
601278 2022-07-21T14:49:46 Z PiejanVDC Bit Shift Registers (IOI21_registers) C++17
0 / 100
1 ms 340 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;

const int b = 2000;

void construct_instructions(int s, int n, int k, int q) {
    if(k == 1) {
        append_move(1, 0);
        append_right(1, 1, 1);
        append_and(0, 0, 1);
        return;
    }

    append_move(1, 0);
    append_right(1, 1, 2);

    for(int i = 3 ; i >= 0 ; i--) {
        vector<bool>v(b, 0);
        for(int j = 0 ; j < 2 ; j++) v[j] = i & (1 << j);
        append_store(2, v);
        append_xor(2, 0, 2);
        for(int j = 0 ; j < 2 ; j++) {
            v.clear();
            v.resize(b, 0);
            v[j] = 1;
            append_store(3, v);
            append_and(3, 2, 3);
            append_right(3, 3, i);
            for(int l = 0 ; l < 2 ; l++) {
                append_and(5, 2, 3);
                append_or(4, 4, 5);
                append_left(3, 3, 1);
            }
            append_not(6, 4);
            append_and(10, 10, 6);
            append_and(11, 4, 0);
            append_or(10, 11, 10);
        }
        v.clear();
        v.resize(b, 0);
        for(int j = 0 ; j < 2 ; j++) v[j] = i & (1 << j);
        append_store(2, v);
        append_xor(2, 1, 2);
        for(int j = 0 ; j < 2 ; j++) {
            v.clear();
            v.resize(b, 0);
            v[j] = 1;
            append_store(3, v);
            append_and(3, 2, 3);
            append_right(3, 3, i);
            for(int l = 0 ; l < 4 ; l++) {
                append_and(5, 2, 3);
                append_or(4, 4, 5);
                append_left(3, 3, 1);
            }
            append_not(6, 4);
            append_and(10, 10, 6);
            append_and(11, 4, 1);
            append_or(10, 11, 10);
        }
    }
    append_move(0, 10);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Incorrect sorting
2 Halted 0 ms 0 KB -