#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;
}
}
Compilation message
/tmp/ccDgGh1T.o: In function `main':
treasure.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccnzO9wp.o:grader.c:(.text.startup+0x0): first defined here
/tmp/ccnzO9wp.o: In function `main':
grader.c:(.text.startup+0x109): undefined reference to `findTreasure(int)'
collect2: error: ld returned 1 exit status