| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1370762 | edga1 | Nile (IOI24_nile) | C++20 | 2092 ms | 5424 KiB |
#include <bits/stdc++.h>
#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();
vector<array<int,3>> ar(n);
for(int i=0; i<n; i++){
ar[i][0]=w[i];
ar[i][1]=a[i];
ar[i][2]=b[i];
}
sort(ar.begin(),ar.end());
vector<long long> atb(Q, 0);
for(int q=0; q<Q; q++){
int p=0,d=e[q];
ll r=0;
while(p<n){
if(p==n-1){
r+=ar[p][1];
p++;
continue;
}
if(ar[p+1][0]-ar[p][0]<=d){
r+=ar[p][2]+ar[p+1][2];
p+=2;
}
else{
r+=ar[p][1];
p++;
}
}
atb[q]=r;
}
return atb;
}
| # | 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... | ||||
