답안 #800716

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
800716 2023-08-01T19:03:17 Z MohamedAliSaidane 레지스터 (IOI21_registers) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

void construct_instructions(int s, int n, int k, int q)
{
    if(k == 1)
    {
        append_right(1, 0, 1);
        append_and(0, 0, 1);
        return ;
    }
    else
    {
        while(1)
        {

        }
        append_right(2, 1, 2); /// 2: B0, B1
        append_left(1, 0, 1998);
        append_right(1, 1, 1998); /// 1: A0, A1
        append_and(3, 1, 2); /// 3: (A0 & B0), (A1 & B1)
        append_right(4, 3, 1); /// 4: (A1 & B1)

        append_xor(5, 1, 2);
        append_not(5, 5);
        append_right(5, 5, 1);
        append_and(5, 5, 3); /// 5: (!(A1 ^ B1) & (A0 & B0))

        append_xor(6, 3, 1);
        append_xor(7, 3, 2);

        append_right(6, 6, 1); /// ((A1 & B1) ^ A1)
        append_right(7, 7, 1); /// ((A1 & B1) ^ B1)

        append_and(6, 6, 1); /// ((A1 & B1) ^ A1) & A0
        append_and(7, 7, 2); /// ((A1 & B1) ^ B1) & B0

        append_or(8, 6, 7);
        append_or(8, 8, 5);

        append_or(0, 3, 8);
        return ;
    }
}

Compilation message

registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:9:9: error: 'append_right' was not declared in this scope
    9 |         append_right(1, 0, 1);
      |         ^~~~~~~~~~~~
registers.cpp:10:9: error: 'append_and' was not declared in this scope
   10 |         append_and(0, 0, 1);
      |         ^~~~~~~~~~
registers.cpp:19:9: error: 'append_right' was not declared in this scope
   19 |         append_right(2, 1, 2); /// 2: B0, B1
      |         ^~~~~~~~~~~~
registers.cpp:20:9: error: 'append_left' was not declared in this scope
   20 |         append_left(1, 0, 1998);
      |         ^~~~~~~~~~~
registers.cpp:22:9: error: 'append_and' was not declared in this scope
   22 |         append_and(3, 1, 2); /// 3: (A0 & B0), (A1 & B1)
      |         ^~~~~~~~~~
registers.cpp:25:9: error: 'append_xor' was not declared in this scope
   25 |         append_xor(5, 1, 2);
      |         ^~~~~~~~~~
registers.cpp:26:9: error: 'append_not' was not declared in this scope
   26 |         append_not(5, 5);
      |         ^~~~~~~~~~
registers.cpp:39:9: error: 'append_or' was not declared in this scope
   39 |         append_or(8, 6, 7);
      |         ^~~~~~~~~