Submission #1062133

# Submission time Handle Problem Language Result Execution time Memory
1062133 2024-08-16T19:37:46 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>jeden(2000, 0);
	vector<bool>czyste(2000, 0);
	for(int i=0;i<n;i+=skip){
		jeden[i*k] = 1;
		if(i%skip==0){
			for(int j=0;j<k;j++)
				czyste[i*k+j] = 1;
		}
	}
	iterator1++;append_store(10, czyste);
	iterator1++;append_store(2, jeden);

	append_and(0, 0, 10);
	
	append_right(1, 0, k*skip);
	
	iterator1++;append_and(3, 98, 3);

	append_print(0), append_print(1);

	append_not(5, 1);
	append_and(5, 1);
	append_add(5, 5, 0);
	append_right(5, 5, k);
	append_and(5, 5, 10);
	append_and(4, 2, 5);
	
//	iterator1++;append_print(3);
	iterator1++;append_print(4);
	//3 same 0 jeśli a<b, same 1, jeśli b<a
	iterator1++;append_move(3, 4);
	for(int i=1;i<k;i++){
		iterator1++;append_left(3,3,1);
		iterator1++;append_or(3, 3, 4);
	}

	iterator1++;append_and(4, 0, 3);
	iterator1++;append_xor(4, 4, 0); //a^(a&1111)
	iterator1++;append_and(5, 1, 3); //b&1111
	iterator1++;append_or(0, 4, 5);

	
}*/

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

	append_print(0);
	append_print(1);


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

	append_add(2, 1, 2);

	append_print(2);

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

	append_print(2);

	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);

/*	
	vector<bool>zero(2000, 0);
	for(int i=n*k;i<2000;i++)zero[i] = 1;
	append_store(1, zero);
	append_or(0, 0, 1);	
	int skip = 1;
	while(skip<n){
		policz_mniejsze(k, skip, n);
		append_print(0);
		skip*=2;
	}*/
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 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 -