# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
9711 | shashack | On grid (kriii2_O) | C++98 | 1000 ms | 3340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
int row, col;
const ll INF=9876543210000;
ll data[310][310], psum[310][310], cache[310][310];
ll get_psum(int sx, int sy, int ex, int ey)
{
ll ret = psum[ex][ey] - psum[sx-1][ey] - psum[ex][sy-1] + psum[sx-1][sy-1];
return ret;
}
ll solution(int x, int y)
{
if(x==row+1 && y==col+1) return 0;
else if(x==row+1 || y==col+1) return -INF;
ll& ret=cache[x][y];
if(ret!=-INF) return ret;
for(int i=x ; i<=row ; i++)
for(int j=y ; j<=col ; j++)
ret=max(ret, solution(i+1, j+1)+get_psum(x, y, i, j));
return ret;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |