Submission #868301

#TimeUsernameProblemLanguageResultExecution timeMemory
868301LOLOLODetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "molecules.h" using namespace std; typedef long long ll; #define f first #define s second #define pb push_back #define ep emplace #define eb emplace_back #define lb lower_bound #define ub upper_bound #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define uniquev(v) sort(all(v)), (v).resize(unique(all(v)) - (v).begin()) #define mem(f,x) memset(f , x , sizeof(f)) #define sz(x) (int)(x).size() #define __lcm(a, b) (1ll * ((a) / __gcd((a), (b))) * (b)) #define mxx *max_element #define mnn *min_element #define cntbit(x) __builtin_popcountll(x) #define len(x) (int)(x.length()) const int N = 1e6 + 100; ll a[N]; vector <int> find_subset(ll l, ll r, vector <ll> arr) { vector <pair <ll, ll>> v; for (int i = 0; i < sz(arr); i++) v.pb({arr[i], i}); sort(all(v)); vector <int> lst; ll s = 0, st = 0; for (int j = 0; j < sz(v); j++) { s += v[j].f; while (s > r) { s -= v[st].f; st++; } if (s >= l) { for (int f = st; f <= j; f++) { lst.pb(v[f].s); } return lst; } } return {0}; }

Compilation message (stderr)

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