제출 #882120

#제출 시각아이디문제언어결과실행 시간메모리
882120androDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define int long long #include "molecules.h" using namespace std; std::vector<int> find_subset(int l, int u, std::vector<int> w) { multiset<pair<int,int>>ms; int n=w.size(); for(int i=0;i<n;i++)ms.insert({w[i],i}); vector<int>ans; while(l>0){ auto lb=ms.lower_bound({l,-1e18}); if(lb==ms.end()){ lb--; if(lb==ms.begin())return {}; } else { pair<int,int>B=*lb; ans.push_back(B.second); u-=B.first; if(u<0)return {}; break; } pair<int,int>A=*lb; l-=A.first; u-=A.first; if(u<0)return {}; //cout<<l<<" "<<u; //cout<<endl; ans.push_back(A.second); ms.erase(A); } return ans; }/* signed main(){ for(auto it:find_subset(14, 15, {5, 5, 6}))cout<<it<<" "; }*/

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

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