Submission #1168436

#TimeUsernameProblemLanguageResultExecution timeMemory
1168436AgageldiGap (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;

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

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:14:32: error: void value not ignored as it ought to be
   14 |                 int x1 = MinMax(l, r, &mn, &mx);
      |                          ~~~~~~^~~~~~~~~~~~~~~~