제출 #1129898

#제출 시각아이디문제언어결과실행 시간메모리
1129898pedreitorzelda콤보 (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
std::string guess_sequence(int N){ std::string ans; std::vector<char>possible = {'A','B','X','Y'}; for(int i=0;i<N;i++){ if(i==0){ for(int j=0;j<3;j++){ std::string q(N,possible[j]); int tmp = press(q); if(tmp==1){ ans+=possible[j]; break; } }if(ans.size()==i)ans+=possible[3]; }else{ for(int j=0;j<3;j++){ std::string q(N-i-1,ans[0]); std::string qu = ans+possible[j]+q; int tmp = press(qu); if(tmp==1){ ans+=possible[j]; break; } }if(ans.size()==i)ans+=possible[3]; } } return ans; }

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

combo.cpp:1:6: error: 'string' in namespace 'std' does not name a type
    1 | std::string guess_sequence(int N){
      |      ^~~~~~
combo.cpp:1:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
  +++ |+#include <string>
    1 | std::string guess_sequence(int N){