Submission #385946

#TimeUsernameProblemLanguageResultExecution timeMemory
385946ismoilovDetecting Molecules (IOI16_molecules)C++14
Compilation error
0 ms0 KiB
#include "molecules.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); #define all(x) (x).begin(), (x).end() #define rall(x) (x).begin(), (x).end() #define fp(a,i,c) for(int (a) = (i); (a) < (c); (a)++) #define fpp(a,i,c) for(int (a) = (i); (a) <= (c); (a)++) #define fv(c) for(int (a) = (1); (a) <= (c); (a)++) #define fz(c) for(int (a) = (0); (a) < (c); (a)++) #define fm(a,i,c) for(int (a) = (i); (a) > (c); (a)--) #define fmm(a,i,c) for(int (a) = (i); (a) >= (c); (a)--) #define pb push_back #define in insert #define ss second #define ff first vector<int> find_subset(int l1, int u, vector<int> &w) { ll n = w.size(), ans = 0; //cin >> n >> l1 >> u; set <ll> s; /*fp(i,0,n) cin >> w[i];*/ sort(all(w)); int l = 0, r = 0; while(l < n && r < n) { while(ans < l1) { ans += w[r], r ++, s.insert(r-1); //continue; } if(ans >= l1 && ans <= u) break; while(ans > u) ans -= w[l], l ++, s.erase(l-1); } if(ans > u || ans < l1) s.erase(all(s)); //cout << ans << "\n"; vector <int> x; for(auto it : s) x.pb(it+1); return x; //return vector<int>(0); }

Compilation message (stderr)

/tmp/ccyyAwK6.o: In function `main':
grader.cpp:(.text.startup+0x139): undefined reference to `find_subset(int, int, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status