Submission #861358

#TimeUsernameProblemLanguageResultExecution timeMemory
861358imarnCombo (IOI18_combo)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
//#include "insects.h"
#define f first
#define s second
#define pb push_back
#define pii pair<int,int>
#define ll long long
using namespace std;
int press(std::string p){
}
string guess_sequence(int N){
    string ans;
    string s[4];
    if(press("A")==1)ans="A",s[0]="A",s[1]="B",s[2]="X",s[3]="Y";
    else if(press("B")==1)ans="B",s[0]="B",s[1]="A",s[2]="X",s[3]="Y";
    else if(press("X")==1)ans="X",s[0]="X",s[1]="B",s[2]="A",s[3]="Y";
    else ans="Y",s[0]="Y",s[1]="B",s[2]="X",s[3]="A";
    for(int i=2;i<=N;i++){
        string now1 = ans+s[1];
        string now2 = ans+s[2]+s[1];
        string now3 = ans+s[2]+s[2];
        string now4 = ans+s[2]+s[3];
        string tt = now1+now2+now3+now4;
        int x = press(tt);
        if(x==i-1)ans = ans+s[3];
        else if(x==i)ans = ans+s[1];
        else ans = ans+s[2];
    }return ans;
}

Compilation message (stderr)

combo.cpp: In function 'int press(std::string)':
combo.cpp:10:1: warning: no return statement in function returning non-void [-Wreturn-type]
   10 | }
      | ^
/usr/bin/ld: /tmp/cc6sXFkl.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/ccR2asXj.o:combo.cpp:(.text.unlikely+0x0): first defined here
collect2: error: ld returned 1 exit status