제출 #1321012

#제출 시각아이디문제언어결과실행 시간메모리
1321012sadix선물 (IOI25_souvenirs)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>


static inline int64_t M = 9ull;

extern std::pair<std::vector<int>, long long> transaction(long long M);

static void buy_souvenirs(int N, long long P0) {
  std::vector<int32_t> bought(N, 0);
  
  for(int32_t type = 0; type < N; type++) {
    while(bought[type] < type) {
      for(int64_t M = 1; M < P0; M++) {
        auto transactions = transaction(M);
        auto& L = transactions.first;
        
        if(static_cast<int32_t>(L.size()) == 1 && L[0] == type) {
          bought[type]++;
          break;
        }
      }
    }
  }
}


int main() {
  buy_souvenirs(3, 4);
}

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

/usr/bin/ld: /tmp/ccKWLbgF.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccPOc7y9.o:souvenirs.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccKWLbgF.o: in function `main':
stub.cpp:(.text.startup+0x99): undefined reference to `buy_souvenirs(int, long long)'
collect2: error: ld returned 1 exit status