(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #945020

#TimeUsernameProblemLanguageResultExecution timeMemory
945020itslqMeetings (IOI18_meetings)C++17
Compilation error
0 ms0 KiB
#include "meetings.h" #include <bits/stdc++.h> using namespace std; #define int long long vector<int> A; struct node { int l, r, m, v; node *lc, *rc; node(int _l, int _r): l(_l), r(_r) { m = (l + r) >> 1; if (l == r) { v = A[l]; } else { lc = new node(l, m); rc = new node(m + 1, r); v = max(lc -> v, rc -> v); } } int query(int _l, int _r) { if (l == _l && r == _r) { return v; } else if (_r <= m) { return lc -> query(_l, _r); } else if (_l > m) { return rc -> query(_l, _r); } else { return max(lc -> query(_l, m), rc -> query(m + 1, _r)); } } } *root; std::vector<long long> minimum_costs(std::vector<int> H, std::vector<int> L, std::vector<int> R) { int N = H.size(); int Q = L.size(); int S, T; vector<int> ans; A = H; root = new node(1, N); for (int i = 0; i < Q; i++) { T = LLONG_MAX; for (int j = L[i]; j < R[i]; j++) { S = 0; for (int k = L[i]; k < j; k++) S += root -> query(k, j); for (int k = j; k <= R[i]; k++) S += root -> query(j, k); T = min(T, S); } ans.push_back(T); } return ans; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccARuNGf.o: in function `main':
grader.cpp:(.text.startup+0x1d6): undefined reference to `minimum_costs(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