Submission #1275485

#TimeUsernameProblemLanguageResultExecution timeMemory
1275485abyfuCombo (IOI18_combo)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "combo.h"
using namespace std;
#define pb push_back
#define ll long long
vector<string> rt;
int nn;

int press(string s){
    cout << s << endl;
    int tx; cin >> tx;
    return tx;
}

void bt(string r, int u){
    if (u == nn){
        rt.pb(r);
    }
    else {
        for (int i = 0; i < u; i++){
            bt(r + char(i + 'A'), u + 1);
        }
    }
}



string guess_sequence(int n){
    nn = n;
    if (n <= 3){
        bt("", 0);
        for (auto i : rt){
            if (press(i) == n){
                return i;
            }
        }
    }
}

Compilation message (stderr)

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:38:1: warning: control reaches end of non-void function [-Wreturn-type]
   38 | }
      | ^
/usr/bin/ld: /tmp/ccx2FXG1.o: in function `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)':
grader.cpp:(.text+0x0): multiple definition of `press(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'; /tmp/ccqsyKU5.o:combo.cpp:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status