Submission #882120

#TimeUsernameProblemLanguageResultExecution timeMemory
882120androDetecting Molecules (IOI16_molecules)C++14
Compilation error
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<<" "; }*/

Compilation message (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