# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
63163 | khsoo01 | Treasure (different grader from official contest) (CEOI13_treasure2) | C++11 | 4 ms | 900 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 "treasure.h"
int n, a[105][105], c[4][105][105];
int px[105], sx[105], py[105], sy[105], aa;
int getc (int K, int A, int B) {
if(~c[K][A][B]) return c[K][A][B];
int R;
if(K == 0) R = countTreasure(1, 1, A, B);
if(K == 1) R = countTreasure(1, B, A, n);
if(K == 2) R = countTreasure(A, 1, n, B);
if(K == 3) R = countTreasure(A, B, n, n);
c[K][A][B] = R;
return R;
}
void findTreasure (int N) {
n = N;
for(int k=0;k<4;k++) {
for(int i=1;i<=n;i++) {
for(int j=1;j<=n;j++) {
c[k][i][j] = -1;
}
}
}
aa = getc(0, n, n);
for(int i=1;i<=n;i++) {
if(i <= n/2) {
px[i] = aa - getc(2, i+1, n);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |