Submission #624405

#TimeUsernameProblemLanguageResultExecution timeMemory
624405dnx04Distributing Candies (IOI21_candies)C++17
Compilation error
0 ms0 KiB
#include "candies.h" #include "bits/extc++.h" using namespace std; #define int long long using Query = tuple<int, int, int>; vector<int> sub1(const vector<int>& c, const vector<Query>& q) { vector<int> a(c.size()); for (auto [l, r, v] : q) { for (int i = l; i <= r; ++i) { a[i] += v; if (a[i] < 0) a[i] = 0; if (a[i] > c[i]) a[i] = c[i]; } } return a; } vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = c.size(); vector<Query> q; for (int i = 0; i < n; ++i) q.emplace_back(l[i], r[i], v[i]); return sub1(c, q); }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccMYHAEG.o: in function `main':
grader.cpp:(.text.startup+0x30e): undefined reference to `distribute_candies(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status