Submission #737787

#TimeUsernameProblemLanguageResultExecution timeMemory
737787Elvin_FritlCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #include "combo.h" string guess_sequence(int n) { string s; vector<char>v; int toto=press("AB"),toto2=("AX"),k=1; if(toto==1 && toto2==1){ s+='A'; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(toto==0 && toto2==0){ s+='Y'; v.push_back('B'); v.push_back('A'); v.push_back('X'); } else if(toto==2){ s+="AB"; k=2; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(toto2==2){ s+="AX"; k=2; v.push_back('B'); v.push_back('Y'); v.push_back('X'); } else if(toto==1){ s+='B'; v.push_back('A'); v.push_back('Y'); v.push_back('X'); } else{ s+='X'; v.push_back('B'); v.push_back('Y'); v.push_back('A'); } for(int i=k;i<n;i++){ for(char j:v){ if(press(s+j)==i+1){ s+=j; break; } } } return s; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:9:31: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    9 |   int toto=press("AB"),toto2=("AX"),k=1;
      |                              ~^~~~~
      |                               |
      |                               const char*