Submission #220013

#TimeUsernameProblemLanguageResultExecution timeMemory
220013UserIsUndefinedCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
/**
 *    author:  Mohamad Milhem
 *    created: 2020-04-06-22.53.40
**/

#include <bits/stdc++.h>
#include <stdio.h>
//#include "combo.h"

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define MOD ll(1000000007)
#define debug(x) cout << '[' << #x << " is: " << x << "] " <<endl;
#define decimalpoint cout << std::fixed << setprecision(5)

int press(string s){
    return 1;
}

std::string guess_sequence(int N) {
    string First = "ABXY";
    int indx = -1;

    for (int i = 0 ; i < 3 ; i++){
        string here = "";
        here+=First[i];
        if (press(here)){indx = i ; break;}
    }
    if (indx == -1)indx = 3;

    vector<char> rest;
    for (int i = 0 ; i < 4 ; i++){
        if (i != indx)rest.push_back(First[i]);
    }

    string now = "" + First[indx];

    for (int i = 0 ; i < N - 1; i++){
        string q ;
        string first = now + rest[1];
        string second1 = now + rest[2] + rest[0] + now + rest[2] + rest[1];

        q = first + second1;
        int ans = press(q);
        now+= rest[ans-now.size()];
    }


  return now;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/ccszNeW5.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/ccuo2Hp8.o:combo.cpp:(.text+0xc0): first defined here
collect2: error: ld returned 1 exit status