제출 #1334651

#제출 시각아이디문제언어결과실행 시간메모리
1334651iamhereforfunDetecting Molecules (IOI16_molecules)C++20
컴파일 에러
0 ms0 KiB
// Starcraft 2 enjoyer //

#include <bits/stdc++.h>
#include "molecules.h"

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")

using namespace std;

#define LSOne(X) ((X) & -(X))
#define int long long

const int N = 5e5 + 5;
const int M = 1e6 + 5;
const int LG = 60;
const int INF = 1e9 + 5;
const int K = 301;
const int B = 150000;
const int MOD = 1e9 + 7;

vector<int> find_subset(int l, int u, vector<int> w)
{
    vector<pair<int, int>> v;
    for (int x = 0; x < w.size(); x++)
    {
        v.push_back({w[x], x + 1});
    }
    sort(v.begin(), v.end());
    int sl = 0, sr = 0;
    for (int x = 0; x < v.size(); x++)
    {
        sl += v[x].first;
        sr += v[v.size() - 1 - x].first;
        if (sl <= u && sr >= l)
        {
            vector<int> ans;
            int cur = 0;
            for (int y = 0; y < x + 1; y++)
            {
                cur += v[y].first;
                ans.push_back(v[y].second);
            }
            for (int y = 0; y < x + 1; y++)
            {
                if (cur >= l && cur <= u)
                    break;
                cur += v[v.size() - 1 - y].first;
                cur -= v[y].first;
                ans[y] = v[v.size() - 1 - y].second;
            }
            return ans;
        }
    }
    return {};
}

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

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