# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
9723 | silas | On grid (kriii2_O) | C++98 | 1000 ms | 2392 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <string.h>
#define INF -987654321
using namespace std;
int R, C;
int arr[303][303];
int cache[303][303];
int psum_element(int y, int x, int val) {
int ret = val;
if (x - 1 >= 1) {
ret += arr[y][x-1];
}
if (y - 1 >= 1) {
ret += arr[y-1][x];
}
if (x - 1 >= 1 && y - 1>= 1)
ret -= arr[y-1][x-1];
return ret;
}
int dp (int y, int x) {
if (y == 1)
return arr[1][x];
if (x == 1)
return arr[y][1];
int &ret = cache[y][x];
ret = INF;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |