제출 #442220

#제출 시각아이디문제언어결과실행 시간메모리
442220daniel920712레지스터 (IOI21_registers)C++17
컴파일 에러
0 ms0 KiB
#include "registers.h" #include <vector> using namespace std; void construct_instructions(int s, int n, int k, int q) { int i,j; if(k==1) { append_move(1,0); append_right(1,1,1); append_and(0,0,1); } else { append_move(1,0); append_right(1,1,2); append_and(0,0,1); append_xor(2,0,1); append_right(2,2,1); append_left(2,2,1999); append_right(2,2,1999); append_and(3,0,1); append_move(4,0); append_move(5,1); append_right(4,4,1); append_not(7,2); append_and(6,1,0); append_and(6,6,7); append_and(8,4,0); appand_not(10,4); append_and(9,10,1); append_or(11,8,9); append_and(11,2,11); append_or(11,11,6); append_right(3,1); append_left(3,1); append_left(11,11,1999); append_right(11,11,1999); append_add(0,3,11); } }

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

registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:35:9: error: 'appand_not' was not declared in this scope; did you mean 'append_not'?
   35 |         appand_not(10,4);
      |         ^~~~~~~~~~
      |         append_not
registers.cpp:42:25: error: too few arguments to function 'void append_right(int, int, int)'
   42 |         append_right(3,1);
      |                         ^
In file included from registers.cpp:1:
registers.h:10:6: note: declared here
   10 | void append_right(int t, int x, int s);
      |      ^~~~~~~~~~~~
registers.cpp:43:24: error: too few arguments to function 'void append_left(int, int, int)'
   43 |         append_left(3,1);
      |                        ^
In file included from registers.cpp:1:
registers.h:9:6: note: declared here
    9 | void append_left(int t, int x, int s);
      |      ^~~~~~~~~~~
registers.cpp:6:9: warning: unused variable 'i' [-Wunused-variable]
    6 |     int i,j;
      |         ^
registers.cpp:6:11: warning: unused variable 'j' [-Wunused-variable]
    6 |     int i,j;
      |           ^