제출 #1060720

#제출 시각아이디문제언어결과실행 시간메모리
1060720jamjanekBit Shift Registers (IOI21_registers)C++17
10 / 100
0 ms348 KiB
#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(10, 0, 1);//10 a>>1
	append_right(11, 1, 1);//11 b>>1
	
	append_and(2, 10, 1); //((a>>1)&b)
	append_and(3, 11, 0); //((b>>1)&a)
	append_or(2, 2, 3);// pom

	append_right(3, 0, 1);
	append_not(4, 1);
	append_right(6, 1, 1);

	append_and(3, 3, 0), append_and(3, 3, 4), append_and(3, 3, 6);//(a&(a>>1)&(b^11)&((b>>1)))
	
	append_right(5, 1, 1);
	append_not(6, 0);
	append_right(7, 0, 1);

	append_and(4, 1, 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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...