| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1311892 | eri16 | 나일강 (IOI24_nile) | C++20 | 0 ms | 0 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> calculate_costs1(vector<int> W, vector<int> A, vector<int> B, vector<int> E){
vector <ll> ans;
vector <int> weight;
ll sum=0LL;
for (int i=0; i<A.size(); i++){
weight.push_back(A[i]-B[i]);
sum+=B[i];
}
sort(weight.begin(),weight.end());
if (weight.size()%2)sum+=weight[0];
for (int i=0; i<E.size(); i++){
ans.push_back(sum);
}
return ans;
}
