# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
992439 | MrM7md | Meetings (IOI18_meetings) | C++17 | 5579 ms | 1280 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
// #define int long long
#define endl '\n'
#define F first
#define S second
#define pb push_back
#define all(a) a.begin(),a.end()
const int NN=1e6+50000;
const int MOD=1e9+7;
const int off=(1<<11);
vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){
vector<long long>v;
for(int i=0;i<L.size();i++){
long long ans=1e18;
for(int j=L[i];j<=R[i];j++){
int mx=H[j];
int cur=mx;
for(int k=j-1;k>=L[i];k--){
mx=max(mx,H[k]);
cur+=mx;
}
mx=H[j];
for(int k=j+1;k<=R[i];k++){
mx=max(mx,H[k]);
cur+=mx;
}
ans=min(ans,(long long)mx);
}
v.pb(ans);
}
return v;
}
// signed main(){
// ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// }
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |