제출 #683984

#제출 시각아이디문제언어결과실행 시간메모리
683984JuanDetecting Molecules (IOI16_molecules)C++17
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<ll, ll> #define ff first #define ss second vector<ll> find_subset(ll L, ll R, vector<ll> w){ ll n = w.size(); vector<pii> arr; for(ll i = 0; i < n; i++) arr.push_back({w[i], i}); sort(arr.begin(), arr.end()); vector<ll> ans; ll l=0, r=0, sum=0; while(r<n){ if(sum<L) sum += arr[r++].ff; if(sum>R) sum -= arr[l++].ff; if(sum>=L && sum<=R){ for(ll i = l; i < r; i++) ans.push_back(arr[i].ss); break; } } return ans; }

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

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