Submission #1061787

# Submission time Handle Problem Language Result Execution time Memory
1061787 2024-08-16T13:25:36 Z j_vdd16 Bit Shift Registers (IOI21_registers) C++17
21 / 100
0 ms 348 KB
#include "registers.h"

#include <algorithm>
#include <bitset>
#include <cstdint>
#include <cstring>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

//#define int long long
#define loop(X, N) for(int X = 0; X < (N); X++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;

void spread(int i, int j, int maxPow) {
    for (int pow = 1; pow <= maxPow; pow *= 2) {
        append_right(j, i, pow);
        append_or(i, i, j);
    }
}

void construct_instructions(int s, int n, int k, int q) {
    if (s == 1) return;

    append_left(1, 0, k);

    vb even(2000, true);
    for (int i = k * n; i < 2000; i++) even[i] = false;
    append_store(99, even);
    append_and(1, 1, 99);

    append_xor(2, 0, 1);

    append_print(0);
    append_print(1);
    append_print(2);

    append_right(3, 2, 1);
    append_print(3);
    spread(3, 4, 1); //2
    append_print(3);
    append_print(4);

    append_not(3, 3);
    append_and(4, 2, 3);

    append_print(4);

    append_and(5, 0, 4);
    spread(5, 6, 1); //2
    append_print(5);

    append_and(2, 5, 2);
    append_xor(0, 0, 2);
    append_right(0, 0, k);

    append_print(0);

    /*
    0 2 5 100
    22 19
    */
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -