Submission #855733

#TimeUsernameProblemLanguageResultExecution timeMemory
855733IS_Rushdi콤보 (IOI18_combo)C++17
Compilation error
0 ms0 KiB
// #include <iostream>
#include "combo.h"
using namespace std;

int press(string x){
    return 0;
}
string guess_sequence(int N) {
  string p = "";
  string x = "ABXY";
  string S = ""; 
  char z = 'Y';
  p +="AB";
  int cost = press(p);
  if(cost >= 1){
    p = "A";
    cost = press(p);
    if(cost == 1) z = 'A';
    else z = 'B';
  }else{
    p = "X";
    cost = press(p);
    if(cost == 1) z = 'X';
    else z = 'Y';
  }
  S+=z;
  string tmp = "";
  for(int i = 0; i < 4; i++){
    if(x[i] != z) tmp+=x[i];
  }x = tmp;
  for(int i = S.size(); i < N; i++){
    p = "";
    for(int j = 0; j < 3; j++){
        p+=S;
        p+=x[0];
        p+=x[j];
    }p+=S;
    p+=x[1];
    cost = press(p);
    if(cost-S.size() == 2){
        S += x[0];
    }else if(cost-S.size() == 1){
        S += x[1];
    }else{
        S += x[2];
    }
  }
  if(N > 1){
    cost = press(S+x[0]);
    if(cost == N){
        S += x[0];
    }else{
        cost = press(S+x[1]);
        if(cost == N){
            S += x[1];
        }else{
            S+=x[2];
        }
        }
    }
  return S;
}
// int main(){

// }

Compilation message (stderr)

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