답안 #1069541

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1069541 2024-08-22T05:16:16 Z Ignut Detecting Molecules (IOI16_molecules) C++17
컴파일 오류
0 ms 0 KB
// Ignut

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

vector<int> solve(int L, int U, vector<int> w) {
    int n = w.size();
    vector<pair<int, int>> v;
    for (int i = 0; i < n; i ++) v.push_back({w[i], i});
    sort(v.begin(), v.end());
    for (int l = 0; l < n; l ++) {
        ll sum = 0;
        for (int r = l; r < n; r ++) {
            sum += v[r].first;
            if (sum > U) break;
            if (sum < L) continue;
            vector<int> res;
            for (int i = l; i <= r; i ++) res.push_back(v[i].second);
            return res;
        }
    }
    return {};
}

Compilation message

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