Submission #566819

# Submission time Handle Problem Language Result Execution time Memory
566819 2022-05-22T23:28:15 Z Redhood Bit Shift Registers (IOI21_registers) C++17
33 / 100
4 ms 852 KB
#include <bits/stdc++.h>

using namespace std;
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()

typedef long long ll;
typedef long double ld;

#include "registers.h"

void construct_instructions(int s, int n, int k, int q) {
	append_move(1 , 0);
	vector < bool > empt(2000), one(2000);
        for(int t=0;t<k;++t)
            empt[t]=1;
    one[0] = 1;
	for(int i = 1; i < n; ++i){
        append_move(2 , 0);
        append_right(2 , 2 , k * i);
        append_store(3 , empt);
        append_and(1 , 1 , 3);
        append_and(2 , 2 , 3);
        /// a, b
        append_move(3 , 2);
        /// a, b , b
        append_not(3 , 3);
        append_store(4 , one);
        append_print(3);
        append_add(3 , 3 , 4);
        append_add(3 , 3 , 1);
        /// in 3 we have a-b
        /// if (a - b) > 0 then by this op we will have zeros otherwise ones
        append_move(1 , 3);
        append_right(3 , 3 , k);
        /// if there are zeros than a - b > 0 then b is the option
        /// otherwise a is option and a - b < 0 a-b + b = a
        append_and(1 , 1 , 3);
        append_add(1 , 1 , 2);
	}
	append_store(2 , empt);
	append_and(1 , 1 , 2);
	append_move(0 , 1);
}

# 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 Correct 1 ms 212 KB Output is correct
2 Correct 4 ms 852 KB Output is correct
3 Correct 3 ms 724 KB Output is correct
4 Correct 3 ms 852 KB Output is correct
# 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 1 ms 340 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Incorrect sorting
2 Halted 0 ms 0 KB -