Submission #706762

#TimeUsernameProblemLanguageResultExecution timeMemory
706762Yell0Detecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef pair<int,int> pii; typedef long long ll; int find_subset(int l,int u,int w[],int n,int result[]) { vector<pii> a; for(int i=0;i<n;++i) a.push_back({w[i],i}); sort(a.begin(),a.end()); int i=0,j=0; ll sum=0; for(;i<n;++i) { sum+=a[i].first; if(sum>=l) break; } if(sum<l) return 0; for(;j<=i;++j) { sum-=a[j].first; if(sum<=u) break; } if(sum>u) return 0; for(int x=0;x<=i-j;++x) result[x]=a[x+j].second; return 0; }

Compilation message (stderr)

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