Submission #438138

# Submission time Handle Problem Language Result Execution time Memory
438138 2021-06-27T16:10:53 Z Elegia Bit Shift Registers (IOI21_registers) C++17
0 / 100
1 ms 296 KB
#include "registers.h"

using bitvec = std::vector<bool>;

const int B = 2000, M = 100;

const bitvec ZERO(B);

void task0(int n, int k) {
	bitvec pre(n * k, true);
	pre.resize(B);
	const int SET1 = M / 2, FULL = M / 2 + 1, ONE = M / 2 + 2;
	append_store(FULL, pre);
	{
		bitvec one(B); one[0] = true;
		append_store(ONE, one);
	}
	for (int i = k - 1; i >= 0; --i) {
		if (i != k - 1) {
			append_left(SET1, SET1, 1);
			append_or(0, 0, SET1);
		}
		bitvec cur(B);
		for (int j = 0; j != n; ++j)
			cur[j * k + i] = true;
		append_store(1, cur); append_and(2, 0, 1);
		append_xor(3, 1, 2);
		append_add(3, 3, FULL); append_right(3, 3, n * k);
		append_xor(3, 3, ONE);
		append_add(3, 3, FULL); append_and(2, 3, 2);
		append_xor(0, 0, 2);
		if (i) append_or(SET1, 2, SET1);
	}
}

void construct_instructions(int s, int n, int k, int q) {
	if (s == 0) task0(n, k);
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect min value
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Wrong answer detected in grader
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 296 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Incorrect sorting
2 Halted 0 ms 0 KB -