Submission #293682

#TimeUsernameProblemLanguageResultExecution timeMemory
293682VodkaInTheJarRoller Coaster Railroad (IOI16_railroad)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "railroad.h" using namespace std; const long long inf = 1e18; long long plan_roller_coaster(int n, vector <int> s, vector <int> t) { long long ans = inf; for (int i = 0; i < n; i++) { multiset <pair <int, int> > se; for (int j = 0; j < n; j++) if (j != i) se.insert({s[j], t[j]}); long long curr_ans = 0; int curr_t = t[i]; while (!s.empty()) { auto it = se.lower_bound({curr_t, 0}); if (it == se.end()) it--; curr_ans += max(0, curr_t - it->first); curr_t = it->second; se.erase(it); } ans = min(ans, curr_ans); } return ans; }

Compilation message (stderr)

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