| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 257496 | Saboon | 보물 찾기 (CEOI13_treasure2) | C++14 | 0 ms | 0 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>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
const int maxn = 100 + 10;
bool mark[maxn][maxn];
int ask(int l, int r, int lo, int hi){
cout << l << " " << r << " " << lo << " " << hi << endl;
int x;
cin >> x;
return x;
}
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 = ask(l+1, r, lo+1, 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);
}
int main(){
ios_base::sync_with_stdio(false);
int n;
cin >> n;
search(0, n, 0, n);
cout << "END" << endl;
for (int i = 0; i < n; i++){
for (int j = 0; j < n; j++)
cout << mark[i][j];
cout << endl;
}
}
