Submission #1168479

#TimeUsernameProblemLanguageResultExecution timeMemory
1168479AgageldiGap (APIO16_gap)C++20
Compilation error
0 ms0 KiB
#include "bits/stdc++.h"
#include "gap.h"
#include "grader.cpp"
using namespace std;

#define ll long long

ll n, l = 0, r = 1e18, mn = 0, mx = 0;
set <int> s;
int ans, answer;

ll findGap(int T,int N) {
	while((int)s.size() < N && l <= r) {
		MinMax(l, r, &mn, &mx);
		if(mn == -1) break;
		s.insert(mn);
		s.insert(mx);
		l = mn + 1, r = mx - 1;
	}
	answer = 0, ans = *s.begin();
	for(auto i : s) {
		answer = max(answer, i - ans);
		ans = i;
	}
	return answer;
}

Compilation message (stderr)

/usr/bin/ld: /tmp/cc33xJ0o.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/ccFVqpET.o:gap.cpp:(.text+0x0): first defined here
/usr/bin/ld: /tmp/cc33xJ0o.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccFVqpET.o:gap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status