| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 16508 | hongjun7 | On grid (kriii2_O) | C++98 | 0 ms | 1808 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <stdio.h>
#define MN 305
int n, m, x, c[MN][MN], d[MN][MN], v;
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
scanf("%d", &x);
c[i][j] = x + c[i - 1][j] + c[i][j - 1] - c[i - 1][j - 1];
for (int k = 1; k <= i; k++) {
for (int l = 1; l <= j; l++) {
v = d[k - 1][l - 1] + c[i][j] - c[i][l - 1] - c[k - 1][j] + c[k - 1][l - 1];
if (v > d[i][j]) d[i][j] = v;
}
}
}
}
printf("%d", d[n][m]);
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
