Submission #741405

# Submission time Handle Problem Language Result Execution time Memory
741405 2023-05-14T03:43:52 Z Alan Bit Shift Registers (IOI21_registers) C++17
21 / 100
1 ms 212 KB
#include <vector>
void append_move(int t, int x);
void append_store(int t, std::vector<bool> v);
void append_and(int t, int x, int y);
void append_or(int t, int x, int y);
void append_xor(int t, int x, int y);
void append_not(int t, int x);
void append_left(int t, int x, int s);
void append_right(int t, int x, int s);
void append_add(int t, int x, int y);
void append_print(int t);
void construct_instructions(int s, int n, int k, int q);

#include <bits/stdc++.h>
using namespace std;

void fill (vector<bool>& v) {
	while ((int) v.size() < 2000) v.push_back(0);
}

void construct_instructions(int s, int n, int k, int q) {
	if (s == 0) {
		vector<bool> AND, v1 {1};
		for (int i = 0; i < k; i++) AND.push_back(1);
		fill(AND);
		fill(v1);
		append_store(4, AND);
		append_store(5, v1);
		append_and(1, 0, 4);
		append_right(0, 0, k);
		if (k == 2) {
			append_right(2, 1, 1);
			append_and(3, 1, 5);
			append_xor(3, 2, 3);
			append_xor(2, 0, 1);
			append_add(2, 2, 5);
			append_right(2, 2, 2);
			append_add(2, 2, 3);
			append_right(2, 2, 1);
		}
		append_and(0, 0, 1);
		append_add(0, 0, 2);
	}
}
# 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 Incorrect 1 ms 212 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Incorrect sorting
2 Halted 0 ms 0 KB -