제출 #501532

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

string guess_sequence(int n){
    string s = "";
    char c1 = 'X',c2 = 'Y',c3 = 'A';
    if(press("XY") != 0){
        if(press("X") != 0){s += 'X';c1 = 'B';}
        else {s += 'Y';c2 = 'B';}
    }
    else{
        if(press("A") != 0){s += 'A';c3 = 'B';}
        else s += 'B';
    }
    for(int i = 0;i < n - 1; i++){
        int x = press(s + c1 + s + c2 + c1 + s + c2 + c2 + s + c2 + c3);
        if(x == i + 1)s += c3;
        else if(x == i + 2)s += c1;
        else s += v2;
    }
    return s;
}

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:20:19: error: 'v2' was not declared in this scope; did you mean 'c2'?
   20 |         else s += v2;
      |                   ^~
      |                   c2