제출 #849656

#제출 시각아이디문제언어결과실행 시간메모리
849656Bach21Detecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; vector<long long> find_subset(int l, int u, vector<long long> w) { vector<pair<long long,long long>> w1; int n=w.size(); for (int i=0;i<n;i++) { w1.push_back({w[i],i}); } long long sum=0; vector<long long> res; sort(w1.begin(),w1.end()); for (int i=0,j=0;j<n;j++) { sum+=w1[j].first; while (sum>u) { sum-=w1[i++].first; } if (sum>=l) { for (int k=i;k<=j;k++) { res.push_back(w1[k].second); } break; } } return res; }

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

/usr/bin/ld: /tmp/ccJFEaAm.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