Submission #1060709

# Submission time Handle Problem Language Result Execution time Memory
1060709 2024-08-15T21:04:22 Z jamjanek Bit Shift Registers (IOI21_registers) C++17
10 / 100
0 ms 348 KB
#include "registers.h"

void construct_instructions(int s, int n, int k, int q) {
	append_right(1, 0, 2);//ustaw b
	
	append_left(0, 0, 2000-2), append_right(0,0,2000-2);//ustaw a

	append_right(2, 0, 1); append_and(2, 2, 1); //((a>>1)&b)
	append_right(3, 1, 1); append_and(3, 3, 0); //((b>>1)&a)
	append_or(2, 2, 3);// pom

	append_right(3, 0, 1);
	append_not(4, 1);
	append_move(5, 0);
	append_right(6, 1, 1);
	append_and(3, 3, 4), append_and(3, 3, 5), append_and(3, 3, 6);//(a&(a>>1)&(b^11)&((b>>1)))
	
	append_move(4, 1);
	append_right(5, 1, 1);
	append_not(6, 0);
	append_right(7, 0, 1);
	append_and(4, 4, 5), append_and(4, 4, 6), append_and(4, 4, 7);//(b&(b>>1)&(a^11)&((a>>1))
	
	append_or(3, 3, 4);//pom1
	
	append_xor(2, 2, 3);//pom1^pom
	
	append_and(3, 0, 1);//a&b
	append_or(0, 2, 3);

	return;/*
	int	pom = ((a>>1)&(b))|((a)&(b>>1));


	int pom1 = (a&(a>>1)&(b^11)&((b>>1))) | (b&(b>>1)&(a^11)&((a>>1)));
		printf("pom1:%d\n", pom1);
	return (a&b) | (pom^pom1) ;
	
	append_move(1, 0);
	append_right(1, 1, 1);
	append_and(0, 0, 1);*/
}
# 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 Wrong answer detected in grader
2 Halted 0 ms 0 KB -
# 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 0 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 -