| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 464558 | zxcvbnm | 보물 찾기 (CEOI13_treasure2) | C++14 | 47 ms | 996 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 |
|---|---|---|---|---|
| Fetching results... | ||||
