# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
257510 | Saboon | 보물 찾기 (CEOI13_treasure2) | C++14 | 1 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "treasure.h"
using namespace std;
typedef long long ll;
const int maxn = 100 + 10;
bool mark[maxn][maxn];
void search(int l, int r, int lo, int hi){
if (r <= l or hi <= lo)
return;
int tot = (r-l) * (hi-lo);
int tre = countTreasure(l+1, lo+1, r, hi);
if (tre == 0)
return;
if (tre == tot){
for (int i = l; i < r; i++)
for (int j = lo; j < hi; j++)
mark[i][j] = 1;
return;
}
int m1 = (l+r)>>1, m2 = (lo+hi)>>1;
search(l,m1,lo,m2);
search(l,m1,m2,hi);
search(m1,r,lo,m2);
search(m1,r,m2,hi);
}
void findTreasure(int n){
search(0, n, 0, n);
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
if (mark[i][j])
Report(i+1,j+1);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |