| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 79039 | doowey | 모임들 (IOI18_meetings) | C++14 | 731 ms | 398684 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "meetings.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5005;
ll meet[N][N];
ll pref(int dim, int l, int r){
ll ans = meet[dim][r];
if(l != 0)
ans -= meet[dim][l - 1];
return ans;
}
vector<ll> minimum_costs(vector<int> H, vector<int> L, vector<int> R) {
int n = H.size();
int mx;
for(int i = 0 ;i < n; i ++ ){
meet[i][i] = H[i];
mx = H[i];
for(int j = i - 1; j >= 0; j -- ){
mx = max(mx, H[j]);
meet[i][j] = mx;
}
mx = H[i];
for(int j = i + 1; j < n; j ++ ){
mx = max(mx, H[j]);
meet[i][j] = mx;
}
}
for(int i = 0 ; i < n; i ++ ){
for(int j = 1; j < n; j ++ ){
meet[i][j] += meet[i][j - 1];
}
}
vector<ll> ans;
int lf, rf;
ll tot;
for(int i = 0; i < L.size(); i ++ ){
lf = L[i];
rf = R[i];
tot = (ll)1e18;
for(int j = lf; j <= rf; j ++ ){
tot = min(tot, pref(j, lf, rf));
}
ans.push_back(tot);
}
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... | ||||
