Submission #647930

#TimeUsernameProblemLanguageResultExecution timeMemory
647930JANCARAPANCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include "combo.h"
using namespace std;

string ch = "ABXY";



string guess_sequence(int n) {
    string s = "";

    int block = -1;

    if (press("A") == 1) block = 0;
    else if (press("B") == 1) block = 1;
    else if (press("X") == 1) block = 2;
    else block = 3;

    s += ch[block];

    for (int i=1; i<n-1; i++) {
        for (int j=0; j<4 && sz(s) < n; j++) {
            if (block == j) continue;
            if (press(s+ch[j]) > i) {
                s += ch[j];
                break;
            }
        }
    }

    return s;
}



Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:21:30: error: 'sz' was not declared in this scope; did you mean 's'?
   21 |         for (int j=0; j<4 && sz(s) < n; j++) {
      |                              ^~
      |                              s