Submission #805257

# Submission time Handle Problem Language Result Execution time Memory
805257 2023-08-03T14:36:25 Z SamAnd Bit Shift Registers (IOI21_registers) C++17
10 / 100
1 ms 628 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define m_p make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
const int M = 100, B = 2000;

int s, n, k, q;

void comp(int x, int y, int z)
{
    append_xor(M - 1, x, y);
    for (int i = 0; i < min(5, k); ++i)
    {
        append_right(M - 2, M - 1, (1 << i));
        append_or(M - 1, M - 1, M - 2);
    }

    append_not(M - 1, M - 1);
    append_right(M - 1, M - 1, 1);

    append_xor(M - 2, x, y);
    append_and(M - 2, M - 2, y);
    append_and(z, M - 2, M - 1);
    for (int i = 0; i < min(5, k); ++i)
    {
        append_right(M - 2, z, (1 << i));
        append_or(z, z, M - 2);
    }
    for (int i = 0; i < min(5, k); ++i)
    {
        append_left(M - 2, z, (1 << i));
        append_or(z, z, M - 2);
    }
}

void construct_instructions(int SS, int NN, int KK, int QQ) {
    s = SS;
    n = NN;
    k = KK;
    q = QQ;

    vector<bool> v;
    for (int i = 0; i < k; ++i)
        v.push_back(1);
    for (int i = 0; i < B - k; ++i)
        v.push_back(0);
    append_store(1, v);

    append_and(2, 0, 1);
    for (int i = 1; i < n; ++i)
    {
        append_right(3, 0, i * k);
        append_and(3, 3, 1);
        comp(2, 3, 4);
        append_not(5, 4);
        append_and(3, 3, 5);
        append_and(2, 2, 4);
        append_or(2, 2, 3);
        append_and(2, 2, 1);
    }

    append_move(0, 2);
}

/*
0 2 2 1000
2 1
-1
*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# 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 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 628 KB Wrong answer detected in grader
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 340 KB Incorrect sorting
2 Halted 0 ms 0 KB -