제출 #525892

#제출 시각아이디문제언어결과실행 시간메모리
525892buidangnguyen05Detecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
/* input */ #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N = 2e5 + 10; deque<int> solve(int l, int r, vector<int> w) { int n = w.size(); pair<int, int> a[n + 1]; for (int i = 0; i < n; ++i) a[i] = make_pair(w[i], i); sort (a, a + n); ll cur = 0; deque<int> ans; int R = n - 1; for (; ~R; --R) { cur += a[R].first; ans.push_back(a[R].second); if (cur >= l && cur <= r) return ans; if (cur >= r) break; } int L = 0; while (L < R && cur > r) { cur -= w[ans.back()]; ans.pop_back(); cur += a[L].first; ans.push_front(a[L++].second); } if (cur > r) return deque<int>(0); return ans; }

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

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