Submission #1006659

#TimeUsernameProblemLanguageResultExecution timeMemory
1006659kebineCombo (IOI18_combo)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;

# define int long long
# define fir first
# define sec second
# define pb push_back
# define endl "\n"

string guess_sequence(int N) {
    char ch[3];
    string st;
    int asd = press("AB");
    if(asd) {
        int x = press("A");
        if(x) st = "A", ch[0] = 'B', ch[1] = 'X', ch[2] = 'Y';
        else st = "B", ch[0] = 'A', ch[1] = 'X', ch[2] = 'Y';
    }
    else {
        int x = press("X");
        if(x) st = "X", ch[0] = 'A', ch[1] = 'B', ch[2] =  'Y';
        else st = "Y", ch[0] = 'A', ch[1] = 'B', ch[2] = 'X';
    }

    for(int i = 2; i<N; i++) {
        string now = "";
        now += st; now.pb(ch[0]); now.pb(ch[0]);
        now += st; now.pb(ch[0]); now.pb(ch[1]);
        now += st; now.pb(ch[0]); now.pb(ch[2]);
        now += st; now.pb(ch[1]);
        int get = press(now);
        if(get == i+1) st.pb(ch[0]);
        else if(get == i) st.pb(ch[1]);
        else st.pb(ch[2]);
    }

    string  st0 = st; st0.pb(ch[0]);
    string  st1 = st; st1.pb(ch[1]);
    string  st2 = st; st2.pb(ch[2]);

    int x = press(st0);
    int y = press(st1);

    if(x == N) st.pb(ch[0]);
    else if(y == N) st.pb(ch[1]);
    else st.pb(ch[2]);

    return st;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cce6vIlF.o: in function `main':
grader.cpp:(.text.startup+0x4c): undefined reference to `guess_sequence[abi:cxx11](int)'
collect2: error: ld returned 1 exit status