제출 #1232787

#제출 시각아이디문제언어결과실행 시간메모리
1232787Timosh레지스터 (IOI21_registers)C++20
컴파일 에러
0 ms0 KiB
#include "bits/stdc++.h"
#include "registers.h"

using namespace std;

void construct_instructions(int s, int n, int k, int q)
{
	append_not(42, 42);
	vector<bool> T(2000);
	T[0] = 1;
	append_store(43, T);
	for (int i = k - 1; i >= 0; i--)
	{
		vector<bool> v(2000), s(2000);
		for (int j = 0; j < n; j++)
			v[j * k + i] = 1;
		s[1999] = 1;
		append_store(1, v);
		append_store(4, s);
		append_not(3, 1);
		append_add(3, 43, 3);
		append_and(1, 0, 1);
		append_add(3, 1, 3);
		append_and(2, 3, 4);
		append_right(1999 - i);
		append_xor(99, 99, 2);
		if (i == 0)
			break;
		append_add(2, 2, 42);
		append_and(1, 2, 1);
		for (int j = 0; j < i; j++)
		{
			append_right(1, 1, 1);
			append_or(0, 0, 1);
		}
	}
	// 0101
	// 1111
	// 1001
	append_move(0, 99);
}

컴파일 시 표준 에러 (stderr) 메시지

registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:25:29: error: too few arguments to function 'void append_right(int, int, int)'
   25 |                 append_right(1999 - i);
      |                 ~~~~~~~~~~~~^~~~~~~~~~
In file included from registers.cpp:2:
registers.h:10:6: note: declared here
   10 | void append_right(int t, int x, int s);
      |      ^~~~~~~~~~~~