| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 720489 | LittleCube | 모임들 (IOI18_meetings) | C++14 | 673 ms | 216252 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "meetings.h"
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
namespace
{
int N, Q;
pll mx[5005][5005];
vector<int> H;
};
ll query(int L, int R)
{
if (R < L)
return 1e18;
if (L == R)
return H[L];
else
{
auto [h, mid] = mx[L][R];
return min(query(L, mid - 1) + (R - mid + 1) * h, query(mid + 1, R) + (mid - L + 1) * h);
}
}
vector<ll> minimum_costs(vector<int> H, vector<int> L, vector<int> R)
{
N = H.size(), Q = L.size();
::H = H;
vector<ll> C(Q);
for (int i = 0; i < N; i++)
mx[i][i] = pii(H[i], i);
for (int i = 0; i < N; i++)
for (int j = i + 1; j < N; j++)
mx[i][j] = max(mx[i][j - 1], mx[j][j]);
for (int i = 0; i < Q; i++)
C[i] = query(L[i], R[i]);
return C;
}
컴파일 시 표준 에러 (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... | ||||
