Submission #438359

# Submission time Handle Problem Language Result Execution time Memory
438359 2021-06-27T21:20:34 Z Ozy Bit Shift Registers (IOI21_registers) C++17
10 / 100
1 ms 204 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for (int i = (a); i <= (b); i++)
#define repa(i,a,b) for (int i = (a); i >= (b); i--)
#define lli long long int
#define debug(a) cout << #a << " = " << a << endl
#define debugsl(a) cout << #a << " = " << a << ", "

vector<bool> borra;

void construct_instructions(int s, int n, int k, int q) {

    borra.resize(2000,false);
    rep(i,0,k-1) borra[i] = true;

    append_right(2,0,k);
    append_print(2);

    append_store(17,borra);
    append_print(17);
    append_and(1,0,17);
    append_print(1);
    append_right(17,17,1);
    append_print(17);

    if (k == 2) {
        append_right(3,1,1);
        append_print(3);
        append_right(4,2,1);
        append_print(4);

        append_and(0,3,4);
        append_print(0);
        append_left(0,0,1);
        append_print(0);

        append_and(1,1,17);
        append_print(1);
        append_and(2,2,17);
        append_print(2);

        append_xor(5,3,4);
        append_print(5);
        append_not(6,5);
        append_print(6);

        append_not(7,3);
        append_print(7);
        append_not(8,4);
        append_print(8);

        append_and(9,1,7);
        append_print(9);
        append_and(10,2,8);
        append_print(10);
        append_or(9,10,9);
        append_print(9);

        append_and(11,5,9);
        append_print(11);
        append_or(0,0,11);

        append_and(12,1,2);
        append_and(12,12,6);
        append_and(12,12,17);
        append_print(12);

        append_or(0,0,12);
    }
    else if (k == 1){
        append_and(0,2,1);
        return;
    }

}

# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer detected in grader
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -