제출 #741404

#제출 시각아이디문제언어결과실행 시간메모리
741404Alan레지스터 (IOI21_registers)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; void fill (vector<bool>& v) { while ((int) v.size() < 2000) v.push_back(0); } void construct_instructions(int s, int n, int k, int q) { if (s == 0) { vector<bool> AND, v1 {1}; for (int i = 0; i < k; i++) AND.push_back(1); fill(AND); fill(v1); append_store(4, AND); append_store(5, v1); append_and(1, 0, 4); append_right(0, 0, k); if (k == 2) { append_right(2, 1, 1); append_and(3, 1, 5); append_xor(3, 2, 3); append_xor(2, 0, 1); append_add(2, 2, 5); append_right(2, 2, 2); append_add(2, 2, 3); append_right(2, 2, 1); } append_and(0, 0, 1); append_add(0, 0, 2); } }

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

registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:14:3: error: 'append_store' was not declared in this scope
   14 |   append_store(4, AND);
      |   ^~~~~~~~~~~~
registers.cpp:16:3: error: 'append_and' was not declared in this scope
   16 |   append_and(1, 0, 4);
      |   ^~~~~~~~~~
registers.cpp:17:3: error: 'append_right' was not declared in this scope
   17 |   append_right(0, 0, k);
      |   ^~~~~~~~~~~~
registers.cpp:21:4: error: 'append_xor' was not declared in this scope
   21 |    append_xor(3, 2, 3);
      |    ^~~~~~~~~~
registers.cpp:23:4: error: 'append_add' was not declared in this scope
   23 |    append_add(2, 2, 5);
      |    ^~~~~~~~~~
registers.cpp:29:3: error: 'append_add' was not declared in this scope
   29 |   append_add(0, 0, 2);
      |   ^~~~~~~~~~