Submission #1161211

#TimeUsernameProblemLanguageResultExecution timeMemory
1161211AzaCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include "combo.h" #include <bits/stdc++.h> using namespace std; string getfnl(string s){ string p = s + 'A' + s + 'B'; if(press(p) == N){ if(press(s + 'A') == N)s += 'A'; else s += 'B'; } else{ if(press(s + 'X') == N)s += 'X'; else s += 'Y'; } return s; } string guess_sequence(int N){ string s = getfnl(""); string g = "AXBY"; ignid = -1; for(int i = 0; i < 4; i++){ if(s[0] == g[i])ignid = i; } string rem; for(int i = 0; i < 4; i++){ if(i == ignid)continue; rem += g[i]; } if(size(s) == N)return s; for(int i = 2; i < N; i++){ string p = s + rem[0] + s + rem[1] + rem[0] + s + rem[1] + rem[1] + s + rem[1] + rem[2]; if(press(p) == i){ s += rem[0]; } else if(press(p) == i + 1){ s += rem[1]; } else{ s += rem[2]; } } string p = s + 'A' + s + 'B'; if(press(p) == N){ if(press(s + 'A') == N)s += 'A'; else s += 'B'; } else{ if(press(s + 'X') == N)s += 'X'; else s += 'Y'; } return getfnl(s); } /* */

Compilation message (stderr)

combo.cpp: In function 'std::string getfnl(std::string)':
combo.cpp:6:24: error: 'N' was not declared in this scope
    6 |         if(press(p) == N){
      |                        ^
combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:19:9: error: 'ignid' was not declared in this scope; did you mean 'signed'?
   19 |         ignid = -1;
      |         ^~~~~
      |         signed