Submission #792982

#TimeUsernameProblemLanguageResultExecution timeMemory
792982prvocisloDetecting Molecules (IOI16_molecules)C++17
Compilation error
0 ms0 KiB
#pragma once #include <algorithm> #include <bitset> #include <cassert> #include <chrono> #include <cmath> #include <deque> #include <iomanip> #include <iostream> #include <map> #include <queue> #include <random> #include <set> #include <string> #include <vector> typedef long long ll; typedef long double ld; using namespace std; vector<int> find_subset(ll l, ll r, vector<int> w) { int n = w.size(); vector<pair<int, int> > a; for (int i = 0; i < n; i++) a.push_back({ w[i], i }); sort(a.begin(), a.end()); vector<ll> pf(n + 1, 0); for (int i = 0; i < n; i++) pf[i + 1] = pf[i] + a[i].first; for (int k = 1; k <= n; k++) if (pf[k] <= r && pf[n] - pf[n - k] >= l) { for (int i = 0; i + k <= n; i++) if (l <= pf[i + k] - pf[i] && pf[i + k] - pf[i] <= r) { vector<int> id; for (int j = i; j < i + k; j++) id.push_back(a[j].second + 1); return id; } } return {}; }

Compilation message (stderr)

molecules.cpp:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
/usr/bin/ld: /tmp/cct1GtyD.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