제출 #1337294

#제출 시각아이디문제언어결과실행 시간메모리
1337294vladilius축제 (IOI25_festival)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second

vector<int> max_coupons(ll A, vector<int> p, vector<int> t){
    int n = (int) p.size();
    
    auto cmp = [&](int i, int j){
        return (1LL * p[i] * t[i] * t[j] + 1LL * p[j] * t[j]) < (1LL * p[j] * t[i] * t[j] + 1LL * p[i] * t[i]);
    };
    
    vector<int> f;
    for (int i = 0; i < n; i++) f.pb(i);
    
    sort(f.begin(), f.end(), cmp);
    
    vector<int> out;
    
    for (int i: f){
        ll f = (A - p[i]) * t[i];
        if (A >= p[i]){
            A = f;
            out.pb(i);
        }
    }
    
    return out;
}

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

/usr/bin/ld: /tmp/ccixHhfo.o: in function `main':
grader.cpp:(.text.startup+0x22a): undefined reference to `max_coupons(int, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status