제출 #238582

#제출 시각아이디문제언어결과실행 시간메모리
238582rahul_a_n콤보 (IOI18_combo)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int guess_sequence(int N){ string ans; if(press("A")>0) ans="A"; else if(press("B")>0) ans="B"; else if(press("X")>0) ans="X"; else ans="Y"; for(int i=1;i<N;i++){ if(press(ans+"A")>i) ans+="A"; else if(press(ans+"B")>i) ans+="B"; else if(press(ans+"X")>i) ans+="X"; else ans+="Y"; } return ans; }

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

combo.cpp: In function 'int guess_sequence(int)':
combo.cpp:5:6: error: 'press' was not declared in this scope
    5 |   if(press("A")>0)
      |      ^~~~~
combo.cpp:14:8: error: 'press' was not declared in this scope
   14 |     if(press(ans+"A")>i)
      |        ^~~~~
combo.cpp:23:10: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to 'int' in return
   23 |   return ans;
      |          ^~~