Submission #543383

#TimeUsernameProblemLanguageResultExecution timeMemory
543383Blobo2_Blobo2Detecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" //#include "grader.cpp" #include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" #define all(v) v.begin(),v.end() #define gen(arr,n,nxt) generate(arr,arr+n,nxt) #define Blobo2 ios_base::sync_with_stdio(false);cin.tie(0); vector<int> find_subset(int l, int u, vector<int> w) { vector<pair<int,int> >v; for(int i=0;i<(int)w.size();i++)v.push_back({w[i],i}); sort(all(v)); int cnt=0,s=0; vector<int>ans; for(int i=0;i<(int)v.size();i++){ cnt += v[i].first; while(cnt > u){ cnt -= v[s].first; s++; } if(cnt <=u && cnt>= l){ for(int j=s;j<=i;j++)ans.push_back(v[j].second); break; } } sort(all(ans)); return ans; }

Compilation message (stderr)

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