제출 #1201559

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

void comp(int a, int b){
	append_xor(90, a, b);
	for (int i=0; i<4; i++){
		append_right(91, 90, 1<<i);
		append_or(90, 90, 91);
	}
	append_add(90, 90, 97);
	append_right(90, 90, 1);
	append_and(91, a, 90);
	for (int i=0; i<4; i++){
		append_right(92, 91, 1<<i);
		append_or(91, 91, 92);
		append_left(92, 91, 1<<i);
		append_or(91, 91, 92);
	}
	append_not(92, 91);
	append_and(93, a, 91);
	append_and(94, b, 92);
	append_add(95, 93, 94);
	append_and(93, a, 92);
	append_and(94, b, 91);
	append_move(a, 95);
	append_add(b, 93, 94);
}

void construct_instructions(int s, int n, int k, int q){
	vector<bool> v(2000, 0);
	for (int i=0; i<k; i++) v[i] = 1;
	append_store(99, v);
	for (int i=1; i<n; i++) append_right(i, 0, i*k);
	for (int i=0; i<n; i++) append_and(i, i, 99);
	v.assign(2000, 0);
	v[0] = 1;
	append_store(98, v);
	append_left(97, 98, 1);
	if (s == 0){
		for (int i=0; i<n-1; i++) comp(i, n-1);
		append_move(0, n-1);
	}
	if (s == 1){
		for (int i=0; i<n; i++){
			for (int j=0; j<n-1; j++) comp(j, j+1);
		}
		for (int i=1; i<n; i++){
			append_left(0, 0, k);
			append_add(0, 0, i);
		}
	}
}
#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...