Submission #645330

#TimeUsernameProblemLanguageResultExecution timeMemory
645330vladislav11Detecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; vector<int> find_subset ( ll tl, ll tr, vector<int> w ) { int n = w.size(); vector< pair<ll,int> > a(n); for ( int i=0; i<n; i++ ) a[i] = { w[i], i }; sort( a.begin(), a.end() ); ll sum = 0; int l = 0, r = -1; while ( r+1 < n ) { r++; sum += a[r].first; while ( l <= r && sum > tr ) { sum -= a[l].first; l++; } if ( l <= r && tl <= sum ) { vector<int> ans; for ( int i=l; i<=r; i++ ) ans.push_back( a[i].second ); return ans; } } return {}; }

Compilation message (stderr)

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