제출 #535587

#제출 시각아이디문제언어결과실행 시간메모리
535587benson1029레지스터 (IOI21_registers)C++17
47 / 100
1 ms356 KiB
#include "registers.h"
#include<bits/stdc++.h>
using namespace std; 

vector<bool> tmp;

void construct_instructions(int s, int n, int k, int q) {
	if(s==0) {
		 tmp.clear();
		 for(int i=0; i<n*k; i++) {
		 	tmp.push_back(true);
		 }
		 for(int i=n*k; i<2000; i++) {
		 	tmp.push_back(false);
		 }
		 append_store(99, tmp); // 11111...1111
		 tmp.clear();
		 tmp.push_back(true);
		 for(int i=1; i<2000; i++) {
		 	tmp.push_back(false);
		 }
		 append_store(98, tmp); // 000...0001
		 tmp.clear();
		 for(int i=0; i<k; i++) tmp.push_back(true);
		 for(int i=k; i<2000; i++) tmp.push_back(false);
		 append_store(97, tmp);
		 append_xor(0, 0, 99);
		 for(int i=k-1; i>=0; i--) {
		 	tmp.clear();
		 	for(int j=0; j<n*k; j++) {
		 		if(j%k==i) tmp.push_back(true);
		 		else tmp.push_back(false);
			 }
			 for(int j=n*k; j<2000; j++) tmp.push_back(false);
			 append_store(10, tmp);
			 append_and(10, 0, 10);
			 append_left(9, 10, k-i);
			 append_right(8, 10, i);
			 append_not(8, 8);
			 append_add(8, 8, 98);
			 append_add(8, 8, 9);
			 // 8 stores the mask, 7 used
			 append_add(7, 8, 99);
			 append_right(7, 7, n*k);
			 append_add(7, 7, 99);
			 append_xor(8, 7, 8);
			 append_and(0, 0, 8);
		 }
		 for(int i=0; i<7; i++) {
		 	append_right(1, 0, k*(1<<i));
		 	append_or(0, 0, 1);
		 }
		 append_and(0, 0, 97);
		 append_xor(0, 0, 97);
	} else {
		
	}
}
#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...