제출 #418448

#제출 시각아이디문제언어결과실행 시간메모리
418448JediMaster11Mechanical Doll (IOI18_doll)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;
#define fo(a, b, c) for (int a = b; a < c; a++)
#define ll long long
#define print(x) cout << x << "\n";
#define vint vector<int>
#define vll vector<long long>



// // should call
// // c - array of length m + 1, the exit of device i is c[i]
// // x, y - length s is the number of switches. exit 'X' of -i is connected to x[i-1] and same for Y
// // called once
// void answer(vint C, vint X, vint Y)
// {
//     fo(i, 0, C.size())
//     {
//         print(C[i]);
//     }
//     print("");
//     fo(i, 0, X.size())
//     {
//         print(X[i] << " " << Y[i]);
//     }
// }



// m - number of triggers (doesnt include 0)
// a - array of length n, of the serial numbers of the triggers the ball needs to enter, in the correct order
void create_circuit(int m, vint a)
{
    int n = a.size();

    int numS = n - 1;

    int c[] = {1,-1}, x[numS], y[numS];

    int on = -2;
    fo(i, 0, numS)
    {
        x[i]=1;
        y[i]=on--;
    }
    y[numS - 1] = 0;

    answer(c, x, y);
}


// int main()
// {

//     ios::sync_with_stdio(0);
//     cin.tie(0);

//     vint a = {1, 1, 1, 1};

//      create_circuit(1, a);
// }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:49:5: error: 'answer' was not declared in this scope
   49 |     answer(c, x, y);
      |     ^~~~~~