Submission #820212

# Submission time Handle Problem Language Result Execution time Memory
820212 2023-08-11T01:27:10 Z LittleCube Bit Shift Registers (IOI21_registers) C++17
64 / 100
3 ms 628 KB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;

const int M = 100, B = 2000;


void construct_instructions(int s, int n, int k, int q)
{
	vector<bool> even(B, 0), odd(B, 0);

	for (int i = 0; i < (n - 1) * k; i++)
		if (i / k % 2 == 0)
			even[i] = 1;
		else
			odd[i] = 1;
	append_store(5, even);
	append_store(6, odd);
	auto bubble = [&](int mask)
	{
		append_print(0);
		append_right(10, 0, k);
		append_xor(15, 10, 0);
		append_print(15);
		append_and(15, 15, mask);
		append_move(20, 15);
		append_move(35, 99);
		for (int i = 1; i < k; i++)
		{
			append_right(30, 20, i);
			append_or(35, 30, 35);
		}
		append_not(30, 35);
		append_and(20, 30, 20);
		append_print(20);
		append_and(20, 20, mask);
		append_print(20);
		append_and(40, 20, 0);
		append_add(50, 40, mask);
		append_right(50, 50, k);
		append_and(50, 50, mask);
		append_add(50, 50, mask);
		append_not(50, 50);
		append_and(50, 50, mask);
		append_and(15, 50, 15);
		append_left(60, 15, k);
		append_or(15, 60, 15);
		append_print(15);
		append_xor(0, 0, 15);
	};
	for (int i = 0; i <= n; i++)
		if (i % 2 == 0)
			bubble(5);
		else
			bubble(6);
	// 11010101010101
	// 00100000101000
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 3 ms 628 KB Output is correct
3 Correct 1 ms 628 KB Output is correct
4 Correct 1 ms 628 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 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 2 ms 628 KB Output is correct
4 Correct 1 ms 588 KB Output is correct
5 Correct 2 ms 596 KB Output is correct
6 Correct 2 ms 596 KB Output is correct
7 Correct 1 ms 588 KB Output is correct