제출 #972412

#제출 시각아이디문제언어결과실행 시간메모리
972412TanosDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define x first #define y second #define all(x) x.begin(), x.end() #define el "\n" #define pb push_back #define pp pop_back #define pii pair <int, int> #define pll pair <ll, ll> #define ibase ios_base::sync_with_stdio(0), cin.tie(0); const int N = 5e5 + 5, M = 1e3 + 5, pw = 31; const ll MAX = 1e15, inf = 1e9 + 7; vector <int> find_subset(ll l, ll u, vector <int> a) { int n = a.size(); vector<pair <int, int>> p; for (int i = 0; i < n; i++) { p.pb({a[i], i}); } sort(p.begin(), p.end()); ll sum = 0, j = 0, last = 0; for (int i = 0; i < n; i++) { sum += p[i].x; last = i; if (sum >= l && sum <= u) { break; } else if (sum >= l) { j = 0; while (sum > u) sum -= p[j++].x; if (sum >= l) break; } } vector <int> ans; ans.clear(); if (l > sum || sum > u) return ans; for (int i = j; i <= last; i++) ans.pb(p[i].y); return ans; }

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

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