Submission #1367841

#TimeUsernameProblemLanguageResultExecution timeMemory
1367841AlmontherNile (IOI24_nile)C++20
0 / 100
14 ms2608 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+=i;
    if(W.size()%2){
        int mn=1e9;
        for(int i=0;i<n;i++) mn=min(mn,A[i]-B[i]);
        sum+=mn;
    }
    ans.push_back(sum);
    while(ans.size()!=E.size()) ans.push_back(ans.back());
}
// int main(){
//     calculate_costs({15, 12, 2, 10, 21},
//                 {5, 4, 5, 6, 3},
//                 {1, 2, 2, 3, 2},
//                 {5, 9, 1})
// }

Compilation message (stderr)

nile.cpp: In function 'std::vector<long long int> calculate_costs(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
nile.cpp:19:1: warning: no return statement in function returning non-void [-Wreturn-type]
   19 | }
      | ^
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...
#Result Execution timeMemoryGrader output
Fetching results...