# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
100391 | Anai | Treasure (different grader from official contest) (CEOI13_treasure2) | C++14 | 3 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 "treasure.h"
using namespace std;
const int N = 105;
char mx[N][N];
static int ask(int l1, int c1, int l2, int c2) {
return countTreasure(l1, c1, l2, c2); }
static void divide(int l1, int c1, int l2, int c2, int count) {
if (count == (l2 - l1 + 1) * (c2 - c1 + 1)) {
for (int i = l1; i <= l2; ++i)
for (int j = c1; j <= c2; ++j)
Report(i, j);
return; }
if (count == 0)
return;
if (l2 - l1 >= c2 - c1) {
int mid = (l1 + l2) / 2;
int half = ask(l1, c1, mid, c2);
divide(l1, c1, mid, c2, half);
divide(mid + 1, c1, l2, c2, count - half); }
else {
int mid = (c1 + c2) / 2;
int half = ask(l1, c1, l2, mid);
divide(l1, c1, l2, mid, half);
divide(l1, mid + 1, l2, c2, count - half); } }
void findTreasure(int n){
divide(1, 1, n, n, ask(1, 1, n, n)); }
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |