제출 #710043

#제출 시각아이디문제언어결과실행 시간메모리
710043BaytoroDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> //#include "grader.cpp" using namespace std; #define int long long vector<pair<int,int>> vec; vector<int> get(int l, int r){ vector<int> ans; for(int i=l;i<=r;i++) ans.push_back(vec[i].second); sort(ans.begin(),ans.end()); return ans; } vector<int> find_subset(int v, int u, vector<int> w) { int n=w.size(); int sum=0; for(int i=0;i<n;i++) vec.push_back({w[i],i}); sort(vec.begin(),vec.end()); int l=0; for(int r=0;r<n;r++){ sum+=vec[r].first; if(sum<v) continue; if(v<=sum && sum<=u){ return get(l,r); } else{ while(sum>u){ sum-=vec[l].first; l++; } if(v<=sum && sum<=u){ return get(l,r); } } } return {}; }

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

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