Submission #1134129

#TimeUsernameProblemLanguageResultExecution timeMemory
1134129sohamsen15Nile (IOI24_nile)C++20
Compilation error
0 ms0 KiB
#include <nile.h> #include <bits/stdc++.h> using namespace std; using ll = long long; vector<ll> calculate_costs(vector<int> w, vector<int> a, vector<int> b, vector<int> e) { int q = e.size(); int n = w.size(); vector<vector<int>> artifacts(n, vector<int>(3)); for (int i = 0; i < n; i++) artifacts[i] = {w[i], a[i], b[i]}; sort(artifacts.begin(), artifacts.end()); vector<ll> ans; for (int d: e) { ll cost = 0; int idx = 0; for (;;) { if (idx == n - 1) { cost += artifacts[idx][1]; break; } else { if (artifacts[idx + 1][0] - artifacts[idx][0] <= d) { cost += artifacts[idx][2] + artifacts[idx + 1][2]; idx += 2; } else { cost += artifacts[idx][1]; idx++; } } } ans.push_back(cost); } return ans; } // int main() { // ios::sync_with_stdio(false); // cin.tie(nullptr); // cout.tie(nullptr); // int n, q; cin >> n >> q; // vector<int> w(n), a(n), b(n), e(q); // for (auto &x: w) cin >> x; // for (auto &x: a) cin >> x; // for (auto &x: b) cin >> x; // for (auto &x: e) cin >> x; // vector<ll> ans = calculate_costs(w, a, b, e); // for (auto x: ans) // cout << x << endl; // }

Compilation message (stderr)

nile.cpp:1:10: fatal error: nile.h: No such file or directory
    1 | #include <nile.h>
      |          ^~~~~~~~
compilation terminated.