Submission #919640

#TimeUsernameProblemLanguageResultExecution timeMemory
919640NurislamDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" #include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back vector<int> find_subset(int l, int r, vector<int> temp) { vector<int> ans; int n=temp.size(); vector<pair<int, int>> w; for (int i = 0; i < n; ++i) { w.push_back({temp[i], i}); } sort(w.begin(), w.end()); int i = 0, j = 0, sum = 0; while(j < n){ sum+=w[j++].first; while(sum > r){ sum -= w[i++].first; } if(sum > l){ for(; i <= j; i++){ ans.pb(w[i].second); }return ans; } } return ans; }

Compilation message (stderr)

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