#include "nile.h"
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<ll> calculate_costs(vector<int> w, vector<int> a, vector<int> b, vector<int> e) {
vector<ll> ret;
for (int j : e) {
ll ans = 0;
multiset<int> nose(w.begin(), w.end());
while (!nose.empty()) {
multiset<int>::iterator actpos = nose.begin();
multiset<int>::iterator nextpos = next(actpos);
ans += 2;
if (nextpos != nose.end() && *nextpos - *actpos <= j) {
nose.erase(actpos);
nose.erase(nextpos);
continue;
}
nose.erase(actpos);
}
ret.push_back(ans);
}
return ret;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |