Submission #1099169

#TimeUsernameProblemLanguageResultExecution timeMemory
1099169aren_danceCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int press(string p); string guess_sequence(int N){ int n=N; string s=""; vector<char> ans(4); ans[0]='A'; ans[1]='B'; ans[2]='X'; ans[3]='Y'; if(press("AB")>0){ if(press("A")){ s+='A'; ans.erase(ans.begin()+0); } else{ s+='B'; ans.erase(ans.begin()+1); } } else{ if(press("X")){ s+='X'; ans.erase(ans.begin()+2); } else{ s+='Y'; ans.erase(b.begin()+3); } } for(int i=1;i<n-1;++i){ string w=s+ans[0]+ans[0]+s+ans[0]+ans[1]+s+ans[0]+ans[1]+s+ans[1]; if(press(w)==i){ w+=ans[2]; } else if(press(w)==i+1){ s+=ans[1]; } else{ s+=ans[0]; } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:29:23: error: 'b' was not declared in this scope
   29 |             ans.erase(b.begin()+3);
      |                       ^