Submission #464558

# Submission time Handle Problem Language Result Execution time Memory
464558 2021-08-13T12:18:11 Z zxcvbnm Treasure (different grader from official contest) (CEOI13_treasure2) C++14
44 / 100
47 ms 996 KB
#include "treasure.h"
#include <bits/stdc++.h>
using namespace std;
int n;
bool ans[105][105];
map<array<int, 4>, int> call;
int query(int x1, int y1, int x2, int y2) {
    if (x1 <= 0 || x2 <= 0 || x2 > n || x1 > n || y1 <= 0 || y1 > n || y2 <= 0 || y2 > n) return 0;
    if (call.count({x1, y1, x2, y2})) {
        return call[{x1, y1, x2, y2}];
    }
    return call[{x1, y1, x2, y2}] = countTreasure(x1, y1, x2, y2);
}
void findTreasure (int N) {
    n = N;
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= n; j++) {
            ans[i][j] = query(1, 1, i, j) - query(1, 1, i-1, j) - query(1, 1, i, j-1) + query(1, 1, i-1, j-1);
        }
    }

    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= n; j++) {
            if (ans[i][j]) {
                Report(i, j);
            }
            cerr << ans[i][j] << " ";
        }
        cerr << "\n";
    }

//    int cnt = countTreasure(1, 1, N, N);
//    if(cnt > 0) Report(1, 1);
}
# Verdict Execution time Memory Grader output
1 Partially correct 1 ms 204 KB Output is partially correct - N = 5, K = 425, score = 8
2 Partially correct 1 ms 332 KB Output is partially correct - N = 10, K = 7075, score = 4
3 Partially correct 1 ms 332 KB Output is partially correct - N = 15, K = 36450, score = 4
4 Partially correct 2 ms 332 KB Output is partially correct - N = 16, K = 47296, score = 4
5 Partially correct 14 ms 416 KB Output is partially correct - N = 55, K = 6782050, score = 4
6 Partially correct 19 ms 636 KB Output is partially correct - N = 66, K = 14090571, score = 4
7 Partially correct 26 ms 748 KB Output is partially correct - N = 77, K = 26140961, score = 4
8 Partially correct 34 ms 844 KB Output is partially correct - N = 88, K = 44642224, score = 4
9 Partially correct 43 ms 996 KB Output is partially correct - N = 99, K = 71566902, score = 4
10 Partially correct 47 ms 992 KB Output is partially correct - N = 100, K = 74507500, score = 4