Submission #988699

#TimeUsernameProblemLanguageResultExecution timeMemory
988699MighilonCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <combo.h>
#include <bits/stdc++.h>
using namespace std;
 
string guess_sequence(int n){
    string a="ABXY", b="AB", d, s;
    if(!press("AB"))
        d="XY";
    char fc = b[0];
    if(!press(string(1, fc)))
        fc=b[1];
    for(auto c: a)
        if(c!=fc)
            d+=c;
    s+=fc;
    if(n<=1) return s;
    while(sz(s)<n-1)
        s+=d[press(s+d[1]+s+d[2]+d[0]+s+d[2]+d[1]+s+d[2]+d[2])-sz(s)];
    if(press(s+d[0]+s+d[1])>sz(s)){
        if(press(s+d[0]))
            return s+d[0];
        return s+d[1];
    }
    return s+d[2];
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:17:11: error: 'sz' was not declared in this scope; did you mean 's'?
   17 |     while(sz(s)<n-1)
      |           ^~
      |           s
combo.cpp:19:29: error: 'sz' was not declared in this scope; did you mean 's'?
   19 |     if(press(s+d[0]+s+d[1])>sz(s)){
      |                             ^~
      |                             s