Submission #967727

# Submission time Handle Problem Language Result Execution time Memory
967727 2024-04-22T17:15:37 Z TAhmed33 Gap (APIO16_gap) C++
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "grader.cpp"
using namespace std;
typedef long long ll;
const ll inf = 1e18;
vector <ll> a;
ll ans = 0;
pair <ll, ll> ask (ll l, ll r) {
	ll mn = l, mx = r;
	MinMax(l, r, &mn, &mx);
	return {mn, mx};
}
void recurse (ll l, ll r) {
	if (l == r) {
		return;
	}
	ll mid = (l + r) / 2;
	auto g = ask(l, mid);
	if (g.first != -1) recurse(g.first, g.second);
	auto h = ask(mid + 1, r);
	if (h.first != -1) recurse(h.first, h.second);
	if (g.second != -1 && h.first != -1) ans = max(ans, h.first - g.second);
}
ll findGap (int t, int n) {
	a.clear(); ans = 0;
	auto g = ask(0, inf);
	recurse(g.first, g.second);
	return ans;
}

Compilation message

/usr/bin/ld: /tmp/ccEUykjx.o: in function `MinMax(long long, long long, long long*, long long*)':
grader.cpp:(.text+0x0): multiple definition of `MinMax(long long, long long, long long*, long long*)'; /tmp/ccACnoVx.o:gap.cpp:(.text+0x2f0): first defined here
/usr/bin/ld: /tmp/ccEUykjx.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccACnoVx.o:gap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status