제출 #1073707

#제출 시각아이디문제언어결과실행 시간메모리
1073707Gabriel모임들 (IOI18_meetings)C++17
4 / 100
5564 ms3288 KiB
#include "meetings.h" #include "bits/stdc++.h" using namespace std; vector<long long> minimum_costs(vector<int> H, vector<int> L, vector<int> R){ vector<long long> h, l, r; long long n = H.size(); long long q = L.size(); for(long long i = 0; i < n; i++) h.push_back((long long)H[i]); for(long long i = 0; i < q; i++) l.push_back((long long)L[i]); for(long long i = 0; i < q; i++) r.push_back((long long)R[i]); vector<long long> c(q); for(long long i = 0; i < q; i++){ long long Bien = LLONG_MAX; for(long long j = l[i]; j <= r[i]; j++){ long long Costo = h[j]; long long Mayor = h[j]; for(long long k = j - 1; k >= l[i]; k--){ Mayor = max(Mayor, h[k]); Costo += Mayor; } Mayor = h[j]; for(long long k = j + 1; k <= r[i]; k++){ Mayor = max(Mayor, h[k]); Costo += Mayor; } if(Costo < Bien) Bien = Costo; } c[i] = Bien; } return c; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...