| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 415149 | schse | 모임들 (IOI18_meetings) | C++17 | 3199 ms | 786436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#ifndef EVAL
#include "grader.cpp"
#endif
#include "meetings.h"
vector<vector<long long>> prefsum;
long long calcscore(int l, int r, int p, std::vector<int> const &H)
{
return prefsum[p][l] + prefsum[p][r] - H[p];
}
long long findmin(int l, int r, std::vector<int> const &H)
{
long long mx = INT64_MAX;
for (int i = l; i <= r; i++)
{
mx = min(mx, calcscore(l, r, i, H));
}
return mx;
}
void calcpref(vector<int> const &H)
{
prefsum.resize(H.size(), vector<long long>(H.size(), 0));
for (int i = 0; i < H.size(); i++)
{
int mx = 0;
long long sum = 0;
for (int e = i; e < H.size(); e++)
{
mx = max(mx, H[e]);
prefsum[i][e] = sum += mx;
}
mx = 0;
sum = 0;
for (int e = i; e >= 0; e--)
{
mx = max(mx, H[e]);
prefsum[i][e] = sum += mx;
}
}
}
std::vector<long long> minimum_costs(std::vector<int> H,
std::vector<int> L,
std::vector<int> R)
{
calcpref(H);
int Q = L.size();
std::vector<long long> C(Q);
for (int j = 0; j < Q; ++j)
{
C[j] = findmin(L[j], R[j], H);
}
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... | ||||
