제출 #1138933

#제출 시각아이디문제언어결과실행 시간메모리
1138933why1Combo (IOI18_combo)C++20
컴파일 에러
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string guess_sequence(int N) { string ans=""; vector<char> v={'A','B','X','Y'}; for(int i = 0; i < 4; i++){ string s=""; s+=v[i]; int x=ask(s); if(x==1){ ans+=v[i]; v.erase(v.begin()+i); break; } } int l=1; for(int i = 1; i < n; i++){ bool check=false; for(int j = 0; j < 2; j++){ int x=ask(ans+v[j]); if(x>l){ check=true; ans+=v[j]; l=x; break; } } if(!check){ ans+=v[3]; l++; } } return ans; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:11:23: error: 'ask' was not declared in this scope
   11 |                 int x=ask(s);
      |                       ^~~
combo.cpp:19:28: error: 'n' was not declared in this scope
   19 |         for(int i = 1; i < n; i++){
      |                            ^
combo.cpp:22:31: error: 'ask' was not declared in this scope
   22 |                         int x=ask(ans+v[j]);
      |                               ^~~