제출 #1028176

#제출 시각아이디문제언어결과실행 시간메모리
1028176khanhtbDetecting Molecules (IOI16_molecules)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" #define ll long long #define ull unsigned long long #define ld long double #define pb push_back #define pf push_front #define vi vector<ll> #define vii vector<vi> #define pll pair<ll, ll> #define vpll vector<pll> #define all(a) a.begin(), a.end() #define fi first #define se second using namespace std; const ll mod = 1e9 + 7; const ll inf = 2e18; const ll blocksz = 320; const ll N = 2e5 + 8; ll ans[N]; pll a[N]; vi find_subset(int l, int r, vi x){ ll n = x.size(); for(ll i = 0; i < n; i++) a[i].fi = x[i], a[i].se = i; sort(a+1,a+n+1); vi ans; ll j = 1, sum = 0; for(ll i = 1; i <= n; i++){ sum += a[i].fi; while((sum > r || a[i].fi-a[j].fi > r-l) && j <= i){ sum -= a[j].fi; j++; } if(l <= sum){ for(ll x = j; x <= i; x++){ ans.pb(a[x].se); } sort(all(ans)); break; } } return ans; }

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

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