Submission #953542

# Submission time Handle Problem Language Result Execution time Memory
953542 2024-03-26T06:14:19 Z Trisanu_Das Bit Shift Registers (IOI21_registers) C++17
33 / 100
1 ms 764 KB
#include "registers.h"
#include "bits/stdc++.h"
using namespace std;
 
void mini(int a, int b, int k) {
    append_not(3, b);
    append_add(3, 3, a);
    append_and(3, 3, 98);
    append_and(4, 4, 69);
    for(int i = k; i >= 1; --i) {
        append_right(3, 3, 1);
        append_or(4, 4, 3);
    }
    append_and(a, a, 4);
    append_not(4, 4);
    append_and(b, b, 4);
    append_or(a, a, b);
}
 
void construct_instructions(int s, int n, int k, int q) {
    if(s == 0) {
        vector<bool> P(2000, 0), paiu(2000, 0);
        for(int i = 0; i < k; ++i) P[i] = 1;
        paiu[k] = 1;
        append_store(99, P);
        append_store(98, paiu);
        if(k == 1) {
            append_move(1, 0);
            append_right(1, 1, 1);
            append_and(0, 0, 1);
            return;
        }
        append_move(1, 0);
        append_and(1, 1, 99);
        for(int i = 1; i < n; ++i) {
            append_right(2, 0, k * i);
            append_and(2, 2, 99);
            mini(1, 2, k);
        }
        append_move(0, 1);
    }
}
# 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 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 764 KB Output is correct
3 Correct 1 ms 604 KB Output is correct
4 Correct 1 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Wrong answer detected in grader
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 -