# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
982863 | mariaclara | 모임들 (IOI18_meetings) | C++17 | 5562 ms | 6748 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "meetings.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MAXN = 4e5+5;
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mk make_pair
#define pb push_back
#define fr first
#define sc second
vector<ll> minimum_costs(vector<int> H, vector<int> L, vector<int> R) {
int N = sz(H), Q = sz(L);
if(N <= 5000 and Q <= 5000) {
vector<ll> ans(Q,1e15), p(N);
vector<int> v(N);
for(int i = 0; i < N; i++) {
v[i] = H[i];
for(int j = i-1; j >= 0; j--)
v[j] = max(v[j+1], H[j]);
for(int j = i+1; j < N; j++)
v[j] = max(v[j-1], H[j]);
p[0] = v[0];
for(int j = 1; j < N; j++) p[j] = p[j-1] + v[j];
for(int j = 0; j < Q; j++)
ans[j] = min(ans[j], p[R[j]] - p[L[j]] + v[L[j]]);
}
return ans;
}
}
컴파일 시 표준 에러 (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... |