제출 #916730

#제출 시각아이디문제언어결과실행 시간메모리
916730_VIBE콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#inclde<bits/stdc++.h> #include "combo.h" using namespace std; string guess_sequence(int N); int press(string p); string guess_sequence(int N) { set<char> s={'A','X','B','Y'}; string ans; for(auto x:s){ if(press(to_string(x))==1){ ans+=x; s.erase(x);break; } } int val=1; for(int i=1;i<N;i++){ for(auto x:s){ ans+=x; if(press(ans)==val+1) break; ans.pop_back(); } } return ans; }

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

combo.cpp:1:2: error: invalid preprocessing directive #inclde; did you mean #include?
    1 | #inclde<bits/stdc++.h>
      |  ^~~~~~
      |  include
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:5: error: 'set' was not declared in this scope
   11 |     set<char> s={'A','X','B','Y'};
      |     ^~~
combo.cpp:3:1: note: 'std::set' is defined in header '<set>'; did you forget to '#include <set>'?
    2 | #include "combo.h"
  +++ |+#include <set>
    3 | using namespace std;
combo.cpp:11:9: error: expected primary-expression before 'char'
   11 |     set<char> s={'A','X','B','Y'};
      |         ^~~~
combo.cpp:14:15: error: 's' was not declared in this scope
   14 |    for(auto x:s){
      |               ^
combo.cpp:23:19: error: 's' was not declared in this scope
   23 |        for(auto x:s){
      |                   ^