제출 #883320

#제출 시각아이디문제언어결과실행 시간메모리
883320marcidDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #define int long long #define ii pair<int,int> #define iii tuple<int,int,int> #define vb vector<bool> #define vi vector<int> #define vii vector<ii> #define viii vector<iii> #define pb push_back #define eb emplace_back #define all(v) v.begin(),v.end() using namespace std; vi find_subset(int l, int u, vi w) { int n = w.size(); vii a(n); for (int i = 0; i < n; i++) { a[i]={w[i],i}; } set<int> st; map<int,int> pos; int sum = 0; st.insert(0); pos[0]=-1; sort(a.begin(),a.end()); for (int i = 0; i < n; i++) { sum+=a[i].first; auto it = *st.lower_bound(sum-u); if (it <= sum-l) { vi ans; for (int j = pos[it]+1; j < n; j++) { ans.pb(a[j].second); } return ans; } st.insert(sum); pos[sum] = i; } return {}; }

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

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