제출 #1232742

#제출 시각아이디문제언어결과실행 시간메모리
1232742Timosh레지스터 (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) { int x = 1; 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[i] = 1; append_store(1, v); // 0 1 0 1 0 1 append_store(2, s); // 0 1 0 0 0 0 append_and(1, 0, 1); // 0 1 0 0 0 1 append_and(2, 1, 2); append_move(3, 1); for (int j = 1; j < n; j++) { append_right(1, 1, k); append_and(2, 1, 2); } append_xor(99, 99, 2); append_move(4, 2); if (i == 0) { append_or(0, 0, x); break; } for (int j = 1; j < n; j++) { append_left(2, 2, k); append_or(2, 4, 2);#include "bits/stdc++.h" #include "registers.h" using namespace std; void construct_instructions(int s, int n, int k, int q) { int x = 1; 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[i] = 1; append_store(1, v); // 0 1 0 1 0 1 append_store(2, s); // 0 1 0 0 0 0 append_and(1, 0, 1); // 0 1 0 0 0 1 append_and(2, 1, 2); append_move(3, 1); for (int j = 1; j < n; j++) { append_right(1, 1, k); append_and(2, 1, 2); } append_xor(99, 99, 2); append_move(4, 2); if (i == 0) break; for (int j = 1; j < n; j++) { append_left(2, 2, k); append_or(2, 4, 2); } append_not(2, 2); append_and(3, 2, 3); append_move(x, 3); for (int j = 0; j < i; j++) { append_right(3, 3, x); append_or(x, x, 3); } append_or(0, 0, x); // x++; } append_move(0, 99); } } append_not(2, 2); append_and(3, 2, 3); append_move(x, 3); for (int j = 0; j < i; j++) { append_right(3, 3, x); append_or(x, x, 3); } append_or(0, 0, x); // x++; } append_move(0, 99); }

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

registers.cpp:36:44: error: stray '#' in program
   36 |                         append_or(2, 4, 2);#include "bits/stdc++.h"
      |                                            ^
registers.cpp: In function 'void construct_instructions(int, int, int, int)':
registers.cpp:36:45: error: 'include' was not declared in this scope
   36 |                         append_or(2, 4, 2);#include "bits/stdc++.h"
      |                                             ^~~~~~~
registers.cpp:42:1: error: a function-definition is not allowed here before '{' token
   42 | {
      | ^