| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 132209 | sean617 | 요리 강좌 (KOI17_cook) | C++98 | 1058 ms | 60432 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#define N 3005
#define F first
#define S second
#define PI pair<int, int>
using namespace std;
int n, m, S, E, T, st, a[N][N], d[N][N], s[N][N], b[N];
vector<PI> mx[N];
int main()
{
int i, j, k, x;
cin >> n >> m >> S >> E >> T;
for (i = 1; i <= n; i++) {
for (j = 1; j <= m; j++) {
scanf ("%d", &a[i][j]);
s[i][j] = s[i][j - 1] + a[i][j];
}
}
for (i = 1; i <= n; i++) {
scanf ("%d", &b[i]);
}
for (j = 1; j <= m; j++) {
for (i = 1; i <= n; i++) {
d[i][j] = 2e9;
if (j == m) st =1;
else st = S;
for (k = st; k <= E && j - k >= 0; k++) {
x = s[i][j] - s[i][j - k];
if (j - k > 0) {
if (mx[j - k][0].S == b[i] || mx[j - k][0].S == i) x += mx[j - k][1].F;
else x += mx[j - k][0].F;
x += T;
}
d[i][j] = min(d[i][j], x);
}
mx[j].push_back(PI(d[i][j], i));
}
sort(mx[j].begin(), mx[j].end());
}
cout << mx[m][0].F;
return 0;
}
컴파일 시 표준 에러 (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... | ||||
