Submission #249313

#TimeUsernameProblemLanguageResultExecution timeMemory
249313sahil_kGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h"
#include <iostream>
#include <algorithm>
using namespace std;
long long findGap (int t, long int n) {
	if (t == 1) {
		long long mn, mx;
		long long p_mn = -1, p_mx = 1e18+1;
		long long ans = 0;
		for (int i=0; i<(n+1)/2; i++) {
			MinMax(p_mn+1, p_mx-1, &mn, &mx);
			if (i != 0) ans = max(ans, mn-p_mn);
			if (i != 0) ans = max(ans, p_mx-mx);
			p_mn = mn;
			p_mx = mx;
		}
		ans = max(ans, mx-mn);
		return ans;
	} else {
		return 0;
	}
}

Compilation message (stderr)

/tmp/ccAfTLIG.o: In function `main':
grader.cpp:(.text.startup+0x18e): undefined reference to `findGap(int, int)'
collect2: error: ld returned 1 exit status