Submission #621222

# Submission time Handle Problem Language Result Execution time Memory
621222 2022-08-03T14:49:32 Z amunduzbaev Bit Shift Registers (IOI21_registers) C++17
0 / 100
1 ms 340 KB
#include "registers.h"
#include "bits/stdc++.h"
using namespace std;
#ifndef EVAL
#include "grader.cpp"
#endif

const int M = 100;

void upd(int i, int j, int p){
	append_and(M - 1, i, j);
	if(p){
		append_right(M - 1, M - 1, p);
	} 
	if(p){
		append_move(M - 2, M - 1);
		for(int k=1;k<p;k++){
			append_left(M - 2, M - 2, 1);
			append_or(M - 2, M - 2, M - 1);
		}
	}
}

void construct_instructions(int s, int n, int k, int q) {
	if(s) assert(false);
	append_move(1, 0);
	append_right(2, 0, k);
	
	for(int i=k-1;~i;i--){
		append_xor(3, 1, 2);
		if(i){
			append_right(3, 3, i);
			append_left(3, 3, i);
		}
		append_or(4, 4, 3);
		//~ append_print(4);
		upd(1, 3, i);
		append_or(1, 1, M - 2);
		upd(2, 3, i);
		append_or(2, 2, M - 2);

		//~ append_print(1);
		//~ append_print(2);
	}
	//~ append_print(1);
	//~ append_print(2);
	//~ append_print(4);
	
	append_move(1, 0);
	append_right(2, 0, k);
	append_or(3, 1, 2);
	append_not(4, 4);
	append_and(4, 4, 2);
	append_move(0, 4);
}

/*

0 2 2 1000
2 1

*/
# 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 0 ms 212 KB Wrong answer detected in grader
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 0 ms 212 KB Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -