Submission #516600

#TimeUsernameProblemLanguageResultExecution timeMemory
516600marat0210Distributing Candies (IOI21_candies)C++17
Compilation error
0 ms0 KiB
#include <candies.h> #include <bits/stdc++.h> using namespace std; std::vector <long long> distribute_candies(std::vector <long long> c, std::vector <long long> l, std::vector <long long> r, std::vector <long long> v) { long long n = c.size(); std::vector <long long> res(n); long long q = l.size(); for (int i = 0; i < q; ++i) { long long left = l[i], right = r[i], add = v[i]; for (int j = left; j <= right; ++j) { if (add < 0) { res[j] = max(0ll, res[j] + add); } else { res[j] = min(c[j], res[j] + add); } } } return res; }

Compilation message (stderr)

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