제출 #1350237

#제출 시각아이디문제언어결과실행 시간메모리
1350237bozhoCombo (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

string guess_sequence(int n)
{
    char c[4] = {'B', 'X', 'A', 'Y'};
    int f, l;
    string idk = "";
    for (int i = 0; i < 4; i++)
    {
        idk = "";
        idk += c[i];
        if (press(idk))
        {
            f = i;
            break;
        }
    }
    l = f;
    string s = "", tr = "";
    s += c[f];
    for (int i = 0; i < n; i++)
        tr += 'A';
    tr[0] = c[f];
    int op;
    while (s.size() < n)
    {
        for (int j = 0; j < 4; j++)
        {
            if (j == l || j == f)
                continue;
            for (int i = s.size(); i < n; i++)
                tr[i] = c[j];
            l = j;
            op = press(tr);
            for (int i = s.size(); i < op; i++)
                s += c[l];
            if (op > s.size())
                break;
        }
    }
    return s;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:13:13: error: 'press' was not declared in this scope
   13 |         if (press(idk))
      |             ^~~~~
combo.cpp:35:18: error: 'press' was not declared in this scope
   35 |             op = press(tr);
      |                  ^~~~~