Submission #1253458

#TimeUsernameProblemLanguageResultExecution timeMemory
1253458avohadoCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
#define mod 1000000007
#define maxn 200005
#define f first
#define s second
#define ll long long
#define pb(x) push_back(x)
string guess_sequence(int n){
    string s;
    string c2="B", c1="X", c3="Y";
    if(press("AB")){
        if(press("A")){
            s="A";
        }else{
            c2="A";
            s="B";
        }
    }else if(press("Y")){
        s="Y";
        c3="A";
    }else{
        s="X";
        c1="A";
    }
    while(s.size()<n-1){
        f=press(s+c1+s+c2+c1+s+c2+c2+s+c2+c3);
        if(f==s.size()){
            s+=c3;
        }else if(s.size()==f-1){
            s+=c1;
        }else{
            s+=c2;
        }
    }
    if(n==1){
        return s;
    }
    if(press(s+c1)==n){
        return s+c1;
    }else if(press(s+c2)==n){
        return s+c2;
    }else{
        return s+c3;
    }
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:6:11: error: 'first' was not declared in this scope
    6 | #define f first
      |           ^~~~~
combo.cpp:28:9: note: in expansion of macro 'f'
   28 |         f=press(s+c1+s+c2+c1+s+c2+c2+s+c2+c3);
      |         ^