제출 #737787

#제출 시각아이디문제언어결과실행 시간메모리
737787Elvin_Fritl콤보 (IOI18_combo)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (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*