| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1370773 | edga1 | Nile (IOI24_nile) | C++20 | 14 ms | 2608 KiB |
#include <iostream>
#include "nile.h"
#define fi first
#define se second
#define ll long long
#define pb push_back
using namespace std;
const ll INF=1e18+5;
vector<long long> calculate_costs(vector<int> w, vector<int> a, vector<int> b, vector<int> e) {
int Q=(int)e.size(), n=(int)w.size();
ll bsum=0,bbest=INF,bbest2=INF;
for(int i=0; i<n; i++) bsum+=b[i];
if(n&1){
for(int i=0; i<n; i+=2){
bbest=min(bbest,bsum-b[i]+a[i]);
}
for(int i=1; i<n; i+=2){
bbest2=min(bbest2,bsum-b[i]+a[i]);
}
}
else bbest=bsum;
bbest2=min(bbest2,bbest);
vector<long long> r(Q, 0);
for(int q=0; q<Q; q++){
r[q]=bbest2;
}
return r;
}| # | 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... | ||||
