Submission #600240

#TimeUsernameProblemLanguageResultExecution timeMemory
600240FidanDetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; vector<ll> find_subset(int l, int u, vector<ll> w1) { vector<ll> cvb; ll n=w1.size(), i, c1=-1, c2=-1; vector<pair<ll, ll>> w; w.push_back({0, 0}); for(i=0; i<n; i++){ w.push_back({w1[i], i+1}); } sort(w.begin(), w.end()); vector<ll> v(n+1, 0); for(i=1; i<=n; i++){ v[i]=v[i-1]+w[i].first; } for(i=1; i<=n; i++){ ll lo=i, hi=n; while(lo<=hi){ ll mid=(lo+hi)/2; if(v[mid]-v[i-1]<l) lo=mid+1; else if(v[mid]-v[i-1]>u) hi=mid-1; else { c1=i, c2=mid; break; } } } if(c1==-1) return cvb; for(i=c1; i<=c2; i++){ cvb.push_back(w[i].second-1); } return cvb; }

Compilation message (stderr)

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