Submission #1062149

# Submission time Handle Problem Language Result Execution time Memory
1062149 2024-08-16T19:48:08 Z jamjanek Bit Shift Registers (IOI21_registers) C++17
21 / 100
1 ms 348 KB
#include "registers.h"
#include<bits/stdc++.h>
using namespace std;

int iterator1;
void policz_mniejsze(int k, int skip, int n){
	vector<bool>zero(2000, 0);
	int i;
	for(i=0;i<2000;i+=k*skip*2)
		zero[i] = 1;
	append_store(10, zero);
	for(int j=0;j<n;j+=skip*2)
		for(int i=0;i<k;i++)
			zero[j*k+i] = 1;
	append_store(11, zero);
	//0 - a
	//1 - b
	//2 - !a
	append_right(1, 0, k*skip);
	append_and(0,11,0);
	append_and(1,11,1);

	append_not(2, 0);
	append_and(2, 2, 11);

	append_add(2, 1, 2);

	append_right(2, 2, k);
	append_and(2, 2, 10);//0 lub 1	


	append_add(2, 2, 11); //11111 lub 0000
	append_and(3, 1, 2);
	append_and(4, 0, 2);
	append_xor(4, 0, 4);
	append_or(0, 3, 4);
}

void construct_instructions(int s, int n, int k, int q) {

	int skip = 1;
	while(skip<n){
		policz_mniejsze(k, skip, n);
		append_print(0);
		skip*=2;
	}
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Incorrect min value
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Incorrect sorting
2 Halted 0 ms 0 KB -