제출 #1214054

#제출 시각아이디문제언어결과실행 시간메모리
1214054Nelt로봇 대회 (IOI23_robot)C++20
컴파일 에러
0 ms0 KiB
#include "robot.h"
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define ll long long
using namespace std;

// globals to hold the maze map, height H, width W
// plus a layer counter L and a marker color C = L mod 4 (so C∈{2,3,4,5})
// and a sweep‐phase flag PHASE∈{0 (expansion),1 (traceback)}

void program_pulibot()
{
    vector<int> V = {-2,-1,0,1,2,3,4,5}, S(5);
    auto mv = [&](int c)->char{ /* same W,S,E,N mapping */ };

    for (int s0:V) for(int s1:V) for(int s2:V)
    for(int s3:V) for(int s4:V)
    {
        S = {s0,s1,s2,s3,s4};

        if (PHASE == 0)   // expansion
        {
            // 1) if S[0]==0 *and* this cell’s distance == L, write parent pointer
            // 2) else if you’ve seen *every* dist==L cell, increment L, update C
            // 3) when you first step into goal, switch PHASE=1, paint it “1”
        }
        else  // PHASE == 1, traceback
        {
            if (s0 >= 2 && s0 <= 5)
                set_instruction(S, 1, mv(s0));  // follow pointers forward
            else
                set_instruction(S, 0,   'H');
        }
    }
}

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

robot.cpp: In lambda function:
robot.cpp:14:60: warning: no return statement in function returning non-void [-Wreturn-type]
   14 |     auto mv = [&](int c)->char{ /* same W,S,E,N mapping */ };
      |                                                            ^
robot.cpp: In function 'void program_pulibot()':
robot.cpp:21:13: error: 'PHASE' was not declared in this scope
   21 |         if (PHASE == 0)   // expansion
      |             ^~~~~