| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1367920 | Almonther | Nile (IOI24_nile) | C++20 | 13 ms | 2608 KiB |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
std::vector<long long> calculate_costs(std::vector<int> W, std::vector<int> A,std::vector<int> B, std::vector<int> E){
ll n=W.size();
vector<ll>ans;
ll sum=0;
for(auto i:B) sum+=(ll)i;
ll mn=1e18,mn1=1e18;
if(n%2){
for(int i=0;i<n;i++){
if(i%2==0) mn=min(mn,(ll)A[i]-B[i]);
mn1=min(mn1,(ll)A[i]-B[i]);
}
}
else mn=mn1=0;
for(auto i:E){
if(i==1) ans.push_back(sum+mn);
else ans.push_back(sum+mn1);
}
return ans;
}
// int main(){
// calculate_costs({15, 12, 2, 10, 21},
// {5, 4, 5, 6, 3},
// {1, 2, 2, 3, 2},
// {5, 9, 1})
// }| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
