Submission #963929

#TimeUsernameProblemLanguageResultExecution timeMemory
963929MardonbekhazratovCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h" #include<vector> using namespace std; string guess_sequence(int n) { string p = ""; if(press("AB")){ if(press("A")) p+="A"; else p+="B"; } else{ if(press("X")) p+="X"; else p+="Y"; } vector<char>d={"A","B","X","Y"}; for(int i=0;i<4;i++){ if(d[i]==p[0]){ d.erase(d.begin()+i); } } for(int i=2;i<n;i++){ string f1=p+d[0]+d[0]; string f2=p+d[0]+d[1]; string f3=p+d[0]+d[2]; string f4=p+d[1]; int x=press(f1+f2+f3+f4); if(x==i-1){ p+=d[2]; } else if(x==i){ p+=d[1]; } else{ p+=d[0]; } } for(int i=0;i<2;i++){ string f=p+d[i]; if(press(f)==n){ p+=d[i]; break; } if(i==1) p+=d[2]; } return p; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:16:33: error: could not convert '{"A", "B", "X", "Y"}' from '<brace-enclosed initializer list>' to 'std::vector<char>'
   16 |   vector<char>d={"A","B","X","Y"};
      |                                 ^
      |                                 |
      |                                 <brace-enclosed initializer list>