제출 #1176188

#제출 시각아이디문제언어결과실행 시간메모리
1176188gyg레지스터 (IOI21_registers)C++20
21 / 100
0 ms328 KiB
#include "registers.h"
#include <bits/stdc++.h>
using namespace std;

void construct_instructions(int s, int n, int k, int q) {
	assert(n == 2 && k <= 2);
	if (k <= 1) {
		append_move(1, 0);
		append_right(1, 1, 1);
		append_and(0, 0, 1);
		return;
	}

	append_move(1, 0);
	append_right(1, 1, 2);
	append_and(2, 0, 1);

	// append_print(0), append_print(1), append_print(2);

	append_xor(3, 0, 1);
	append_right(1, 1, 1);
	append_add(4, 0, 1);

	// append_print(3), append_print(4);

	append_move(5, 3);
	append_right(5, 5, 1);
	append_move(6, 4);
	append_right(6, 6, 1);
	append_not(4, 4);

	// append_print(3), append_print(4), append_print(5), append_print(6);

	append_and(7, 3, 4);
	append_and(7, 7, 5);
	append_and(7, 7, 6);

	// append_print(7);
	
	vector<bool> x;
	for (int i = 1; i <= 2000; i++) {
		if (i == 1) x.push_back(1);
		else x.push_back(0);
	}
	append_store(8, x);
	// append_print(8);
	append_and(7, 7, 8);

	append_xor(2, 2, 7);
	append_move(0, 2);
}
#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...