Submission #1142543

#TimeUsernameProblemLanguageResultExecution timeMemory
1142543joker2Combo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h" #include <unordered_set> #include <unordered_map> #include <iostream> #include <vector> #include <cmath> #include <algorithm> #include <string> #include <iomanip> #include <numeric> using namespace std; std::string guess_sequence(int N) { string S = ""; vector<char> btns = {'A','B','X','Y'}; while (S.length() != N) { if (S.length() == 0) { int coin = press("AB"); if (coin > 0) { string s; s += 'A'; coin = press(s); if (coin == 1) { S += 'A'; btns.erase(btns.begin()); } else { S += 'B'; btns.erase(btns.begin()+1); } } else { string s; s += 'x'; coin = press(s); if (coin == 1) { S += 'X'; btns.erase(btns.begin()+2); } else { S += 'Y'; btns.erase(btns.begin()+3); } } } else if (S.length() < N) { string message = ""; message += S; message += btns[0]; for (size_t i = 0; i < 3; i++) { message += S; message += btns[1]; message += btns[i]; } int coin = press(message); if (coin == S.length()+1) { S += btns[0]; } else if (coin == S.length() + 2) { S += btns[1]; } else { S += btns[2]; } } else { string mess = S; mess += btns[0]; mess += btns[1]; int coin = press(); if (coin > S.length()) { mess = S; mess += btns[0]; coin = press(mess); if (coin == 1) { S += btns[0]; } else { S += btns[1]; } } else { S += btns[2]; } } } return S; }

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:63:25: error: too few arguments to function 'int press(std::string)'
   63 |         int coin = press();
      |                    ~~~~~^~
In file included from combo.cpp:1:
combo.h:7:5: note: declared here
    7 | int press(std::string p);
      |     ^~~~~