제출 #981099

#제출 시각아이디문제언어결과실행 시간메모리
981099vjudge1Robot Contest (IOI23_robot)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "robot.h" #define endl '\n' #define mp make_pair #define pb push_back #define f first #define s second #define fo(i,n) for(auto i =0 ; i < n;i++) #define fore(i,l,r) for(auto i = l; i < r;i++) #define forex(i,r,l) for(auto i = r; i >= l; i--) #define ffo(i,n) forex(i,n-1,0) #define all(x) x.begin(),x.end() #define lsb(x) x&(-x) #define sz(x) (int)x.size() #define gcd(a,b) __gcd(a,b) #define vii vector<ii> using namespace std; using ll = long long; using ull = unsigned long long; using vi = vector<ll>;using ii = pair<ll,ll>;using mii = map<ll,ll>; // #pragma GCC target ("avx2") // #pragma GCC optimization ("O3") // #pragma GCC optimization ("unroll-loops") void program_pulibot() { for(int i = -2; i <= 1; i++ ) for(int j = -2; j <= 1;j++) for(int k = -2; k <=1; k++) set_instruction({0,i,j,0,k}, 1,'E'}); for(int i = -2; i <= 1; i++ ) for(int j = -2; j <= 1;j++) for(int k = -2; k <=1; k++) set_instruction({0,i,0,j,k}, 1,'S'}); set_instruction({0, 0, -2, -2, 1}, 1, 'H'); set_instruction({1, 0, -2, -2, 1}, 1, 'T'); }

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

robot.cpp: In function 'void program_pulibot()':
robot.cpp:28:51: error: expected ')' before '}' token
   28 |                 set_instruction({0,i,j,0,k}, 1,'E'});
      |                                ~                  ^
      |                                                   )
robot.cpp: At global scope:
robot.cpp:28:52: error: expected unqualified-id before ')' token
   28 |                 set_instruction({0,i,j,0,k}, 1,'E'});
      |                                                    ^
robot.cpp:29:5: error: expected unqualified-id before 'for'
   29 |     for(int i = -2; i <= 1; i++ )
      |     ^~~
robot.cpp:29:21: error: 'i' does not name a type; did you mean 'ii'?
   29 |     for(int i = -2; i <= 1; i++ )
      |                     ^
      |                     ii
robot.cpp:29:29: error: 'i' does not name a type; did you mean 'ii'?
   29 |     for(int i = -2; i <= 1; i++ )
      |                             ^
      |                             ii
robot.cpp:30:25: error: 'j' does not name a type; did you mean 'jn'?
   30 |         for(int j = -2; j <= 1;j++)
      |                         ^
      |                         jn
robot.cpp:30:32: error: 'j' does not name a type; did you mean 'jn'?
   30 |         for(int j = -2; j <= 1;j++)
      |                                ^
      |                                jn
robot.cpp:31:29: error: 'k' does not name a type
   31 |             for(int k = -2; k <=1; k++)
      |                             ^
robot.cpp:31:36: error: 'k' does not name a type
   31 |             for(int k = -2; k <=1; k++)
      |                                    ^
robot.cpp:32:44: error: expected unqualified-id before ',' token
   32 |                 set_instruction({0,i,0,j,k}, 1,'S'});
      |                                            ^
robot.cpp:32:46: error: expected unqualified-id before numeric constant
   32 |                 set_instruction({0,i,0,j,k}, 1,'S'});
      |                                              ^
robot.cpp:32:51: error: expected declaration before '}' token
   32 |                 set_instruction({0,i,0,j,k}, 1,'S'});
      |                                                   ^
robot.cpp:32:52: error: expected unqualified-id before ')' token
   32 |                 set_instruction({0,i,0,j,k}, 1,'S'});
      |                                                    ^
robot.cpp:33:20: error: expected constructor, destructor, or type conversion before '(' token
   33 |     set_instruction({0, 0, -2, -2, 1}, 1, 'H');
      |                    ^
robot.cpp:33:38: error: expected unqualified-id before ',' token
   33 |     set_instruction({0, 0, -2, -2, 1}, 1, 'H');
      |                                      ^
robot.cpp:33:40: error: expected unqualified-id before numeric constant
   33 |     set_instruction({0, 0, -2, -2, 1}, 1, 'H');
      |                                        ^
robot.cpp:34:20: error: expected constructor, destructor, or type conversion before '(' token
   34 |     set_instruction({1, 0, -2, -2, 1}, 1, 'T');
      |                    ^
robot.cpp:34:38: error: expected unqualified-id before ',' token
   34 |     set_instruction({1, 0, -2, -2, 1}, 1, 'T');
      |                                      ^
robot.cpp:34:40: error: expected unqualified-id before numeric constant
   34 |     set_instruction({1, 0, -2, -2, 1}, 1, 'T');
      |                                        ^
robot.cpp:35:1: error: expected declaration before '}' token
   35 | }
      | ^