| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367284 | psigurd | 나일강 (IOI24_nile) | C++17 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> calculate_costs(vector<ll> w, vector<ll> a, vector<ll> b, vector<ll> e){
vector<ll> ans;
int n = w.size();
ll SUM = 0;
for (auto &p : b){
SUM += p;
}
if (n % 2 == 1){
ll MIN = 1000000000000000000;
for (int i = 0; i < n; i++){
MIN = min(MIN, a[i] - b[i]);
}
SUM += MIN;
}
for (int i = 0; i < n; i++){
ans.push_back(SUM);
}
return ans;
}