QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#150806#4. GapieeCompile Error//C++14996b2023-08-26 10:45:342023-08-26 10:45:36

Judging History

你现在查看的是最新测评结果

  • [2023-08-26 10:45:36]
  • 评测
  • [2023-08-26 10:45:34]
  • 提交

answer

// #include "interactive_lib.cpp"
#include <bits/stdc++.h>
using namespace std;
extern "C" void MinMax(long long,long long,long long*,long long*);
extern "C" long long findGap(int,int);

using ll = long long;
extern "C" long long findGap(int T,int n) {
	if (T == 1) {
		vector<ll> a(n);
		int l = 0, r = n - 1;
		ll mn = 0, mx = 1e18;
		while (l <= r) {
			long long s = mn, t = mx;
			MinMax(s, t, &mn, &mx);
			if (mn == -1 && mx == -1) break;
			a[l++] = mn++, a[r--] = mx--;
		}
		ll ans = 0;
		for (int i = 0; i < n - 1; ++i)
			ans = max(ans, a[i + 1] - a[i]);
		return ans;
	}
	vector<ll> a;
	ll mx, mn;
	MinMax(0, 1e18, &mn, &mx);
	ll B = ceil(1.0 * (mx - mn) / (n - 1));
	for (ll l = mn, r; l <= mx; l = r + 1) {
		r = min(mx, l + B);
		ll x, y;
		MinMax(l, r, &x, &y);
		if (x != -1 || y != -1)
			a.push_back(x), a.push_back(y);
	}
	long long ans = 0;
	for (int i = 0; i < (int) a.size() - 1; ++i)
		ans = max(ans, a[i + 1] - a[i]);
	return ans;
}

详细

/usr/bin/ld: /tmp/ccycjRoQ.o: in function `findGap':
answer.code:(.text+0x65): undefined reference to `MinMax'
/usr/bin/ld: answer.code:(.text+0x109): undefined reference to `MinMax'
/usr/bin/ld: answer.code:(.text+0x2fd): undefined reference to `MinMax'
/usr/bin/ld: /tmp/ccb1ixGQ.o: in function `main':
implementer.cpp:(.text.startup+0x199): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status