Submission #455346

# Submission time Handle Problem Language Result Execution time Memory
455346 2021-08-05T23:15:14 Z mjhmjh1104 Bit Shift Registers (IOI21_registers) C++17
10 / 100
1 ms 636 KB
#include "registers.h"
#include <vector>
using namespace std;

int n, k;
vector<bool> zero(2000);

void compare(int x, int y) {
	append_not(3, y);
	append_or(4, x, 3);
	append_and(5, x, 3);
	append_store(6, zero);
	append_store(7, zero);
	for (int i = 0; i < k; i++) {
		append_and(6, 6, 4);
		append_or(6, 6, 5);
		append_right(4, 4, 1);
		append_right(5, 5, 1);
	}
	append_left(6, 6, 1999);
	append_right(6, 6, 1999);
	for (int i = 1; i < k; i++) {
		append_left(7, 6, 1);
		append_or(6, 6, 7);
	}
	append_and(8, x, 6);
	append_xor(y, y, 8);
	append_and(8, y, 6);
	append_xor(x, x, 8);
	append_and(8, x, 6);
	append_xor(y, y, 8);
}

void construct_instructions(int s, int n, int k, int q) {
	::n = n, ::k = k;
	append_move(1, 0);
	for (int i = 1; i < n; i++) {
		append_right(2, 0, k * i);
		compare(1, 2);
	}
	append_move(0, 1);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer detected in grader
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 636 KB Wrong answer detected in grader
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB Incorrect sorting
2 Halted 0 ms 0 KB -