Submission #1138940

#TimeUsernameProblemLanguageResultExecution timeMemory
1138940why1Combo (IOI18_combo)C++20
Compilation error
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'}; bool check=false; for(int i = 0; i < 3; i++){ string s=""; s+=v[i]; int x=ask(s); if(x==1){ ans+=v[i]; v.erase(v.begin()+i); check=true; break; } } if(!check){ ans+=v[3]; v.pop_back(); } int l=1; for(int i = 1; i < n; i++){ 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; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:12:23: error: 'ask' was not declared in this scope
   12 |                 int x=ask(s);
      |                       ^~~
combo.cpp:28:31: error: 'ask' was not declared in this scope
   28 |                         int x=ask(ans+v[j]);
      |                               ^~~