제출 #785757

#제출 시각아이디문제언어결과실행 시간메모리
785757Boas콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include "combo.h"
#include "grader.cpp"
#include <bits/stdc++.h>
#define ALL(x) x.begin(), x.end()
using namespace std;

string guess_sequence(int N)
{
  vector<char> buttons = {'A', 'B', 'X', 'Y'};
  string S;
  std::random_device rd;
  std::mt19937 g(rd());
  for (int i = 0; i < N; i++)
  {
    shuffle(buttons.begin(), buttons.end(), g);
    for (char c : buttons)
    {
      string p = S + c;
      if (press(p) == i + 1)
      {
        S = p;
        if (i == 0)
          buttons.erase(find(ALL(buttons), c));
        break;
      }
    }
  }
  return S;
}

컴파일 시 표준 에러 (stderr) 메시지

/usr/bin/ld: /tmp/cc19aD9X.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/ccL7spn1.o:combo.cpp:(.text+0xc0): first defined here
/usr/bin/ld: /tmp/cc19aD9X.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccL7spn1.o:combo.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status