Submission #439515

# Submission time Handle Problem Language Result Execution time Memory
439515 2021-06-30T07:24:13 Z fvogel499 Bit Shift Registers (IOI21_registers) C++17
10 / 100
1 ms 204 KB
/*
File created on 06/29/2021 at 21:01:56.
Link to problem: 
Description: subtask 1
Time complexity: O()
Space complexity: O()
Status: DEV
Copyright: Ⓒ 2021 Francois Vogel
*/

#include <vector>
#include "registers.h"

using namespace std;

void construct_instructions(int _, int __, int k, int ___) {
    if (k == 1) {
        append_right(1, 0, 1);
        append_left(2, 0, 1999);
        append_right(3, 2, 1999);
        append_and(0, 1, 3);
    }
    else {
        append_print(0);

        append_right(1, 0, 2);
        append_left(2, 0, 1998);
        append_right(3, 2, 1998);
        append_move(2, 3);
        append_print(1);
        append_print(2);
        
        append_add(4, 1, 3);
        append_print(4);

        append_right(10, 4, 2);
        append_left(5, 4, 1997);
        append_right(11, 5, 1998);
        append_print(10);
        append_print(11);

        const int conv = 3;
        vector<bool> all1(2000, true);
        vector<bool> all0(2000, false);
        append_store(0, all1);
        for (int i = 10; i <= 11; i++) {
            for (int j = 1; j <= 2; j++) {
                append_move(20, 0);
                append_print(20);
                append_right(20, 20, conv-1);
                append_left(20, 20, 1999);
                append_right(20, 20, 1999);
                append_print(20);

                append_xor(25, i, j);
                append_print(25);
                append_right(26, 25, 1);
                append_left(99, 25, 1999);
                append_right(27, 99, 1999);
                append_print(26);
                append_print(27);

                append_not(28, 26);
                append_left(28, 28, 1999);
                append_right(28, 28, 1999);
                append_not(29, 27);
                append_left(29, 29, 1999);
                append_right(29, 29, 1999);
                append_print(28);
                append_print(29);

                append_and(30, 28, 29);
                append_and(31, 20, 30);
                append_print(30);
                append_print(31);

                append_store(98, all1);

                append_move(40, 31);
                append_left(41, 31, 1);
                append_left(42, 31, 2);
                append_print(40);
                append_print(41);
                append_print(42);
                append_print(43);
                
                append_store(32, all0);
                append_or(32, 32, 40);
                append_or(32, 32, 41);
                append_or(32, 32, 42);
                append_print(32);

                append_not(33, j);
                append_print(33);

                append_and(34, 32, 33);
                append_print(34);

                append_not(35, 34);
                append_print(35);

                append_and(36, 0, 35);
                append_print(36);

                append_move(0, 36);
                append_print(0);
            }
        }
    }
}
# 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 -