Submission #257496

# Submission time Handle Problem Language Result Execution time Memory
257496 2020-08-04T10:58:53 Z Saboon Treasure (different grader from official contest) (CEOI13_treasure2) C++14
Compilation error
0 ms 0 KB
#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