Submission #107816

# Submission time Handle Problem Language Result Execution time Memory
107816 2019-04-25T22:00:26 Z Noam527 Gap (APIO16_gap) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define CHECK cout << "ok" << endl
#define finish(x) return cout << x << endl, 0
typedef long long ll;
typedef long double ldb;
const int md = 1e9 + 7;
const ll inf = 1e18;
const int OO = 1;
const int OOO = 1;
using namespace std;

#include "gap.h"

void MinMax(ll s, ll t, ll &mn, ll &mx);

ll findGap(int t, int n) {
	ll lo, hi, a, b;
	vector<ll> pos;
	MinMax(0, inf, lo, hi);
	ll d = (hi - lo) / (n - 1);
	pos.push_back(lo);
	for (ll i = lo + 1; i < hi; i += d) {
		MinMax(i, i + d - 1, a, b);
		if (a != -1) {
			pos.push_back(a);
			pos.push_back(b);
		}
	}
	if (pos.back() != hi) pos.push_back(hi);
	ll rtn = pos[1] - pos[0];
	for (int i = 2; i < pos.size(); i++)
		rtn = max(rtn, pos[i] - pos[i - 1]);
	return rtn;
}

Compilation message

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:31:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for (int i = 2; i < pos.size(); i++)
                  ~~^~~~~~~~~~~~
/tmp/ccM4cyuw.o: In function `findGap(int, int)':
gap.cpp:(.text+0x48): undefined reference to `MinMax(long long, long long, long long&, long long&)'
gap.cpp:(.text+0xa3): undefined reference to `MinMax(long long, long long, long long&, long long&)'
collect2: error: ld returned 1 exit status