# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
257510 | Saboon | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 1 ms | 384 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 <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... |