Submission #559012

# Submission time Handle Problem Language Result Execution time Memory
559012 2022-05-09T07:50:42 Z nghiass001 Bit Shift Registers (IOI21_registers) C++17
21 / 100
1 ms 304 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
const int B = 2000;
vector<bool> tmp(B);

void get_to(int t, int x, int pos) {
    append_left(t, x, B - pos - 1);
    append_right(t, t, B - 1);
}

void construct_instructions(int s, int n, int k, int q) {
    tmp[0] = 1;
    append_store(99, tmp);
    if (k == 1) {
        append_right(1, 0, 1);
        append_and(0, 0, 1);
        return;
    }

    /// a*2 + b , c*2 + d
    get_to(1, 0, 1);
    get_to(2, 0, 0);

    //get_to(3, 0, 3);
    append_right(3, 0, 3);
    get_to(4, 0, 2);

    append_and(0, 1, 3);

    append_xor(10, 1, 3);   /// a^c  -> a!=c
    append_xor(11, 10, 99); /// a==c
    append_and(12, 2, 4);   /// b&d
    append_and(13, 11, 12); /// (a==c) & (b&d)

    append_and(14, 3, 2);   /// c&b -> (~a)&b
    append_and(15, 1, 4);   /// a&d -> (~c)&d
    append_or(16, 14, 15);
    append_and(16, 16, 10); /// (a!=c) & ((~a&b) | (~c&d))

    append_or(17, 13, 16);

    append_left(0, 0, 1);
    append_or(0, 0, 17);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 304 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -