Submission #169782

#TimeUsernameProblemLanguageResultExecution timeMemory
169782ZwariowanyMarcinGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h"
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define ss(x) (int) x.size()
#define pb push_back
#define ll long long
#define cat(x) cerr << #x << " = " << x << endl
#define FOR(i, n) for(int i = 0; i < n; ++i)

using namespace std;	

void MinMax(ll L, ll R, ll *LL, ll *RR) {
}

ll findGap(int t, int n) {
	if(t == 1) {
		vector <ll> v;
		ll L = 0;
		ll R = 1e18;
		while(L <= R) {
			ll LL, RR;
			MinMax(L, R, &LL, &RR);
			if(LL == -1) break;
			v.pb(LL);
			if(LL != RR)
				v.pb(RR);
			L = LL + 1;
			R = RR - 1;
		}
		sort(v.begin(), v.end());
		ll ans = 0;
		for(int i = 0; i + 1 < ss(v); ++i)
			ans = max(ans, v[i + 1] - v[i]);
		return ans;
	}
	// t = 2
	ll L = 0;
	ll R = 1e18;
	ll LL, RR;
	MinMax(L, R, &LL, &RR);
	ll ans = (RR - LL + n - 2) / (n - 1);
	ll Last = -1;
	L = LL;
	R = RR;
	ll P = ans;
	while(L <= R) {
		MinMax(L, L + P, &LL, &RR);
		if(LL == -1) {
			L += P + 1;
			continue;
		}
		if(Last != -1) {
			ans = max(ans, LL - Last);
		}
		Last = RR;
		L += P + 1;
	}
	return ans;
}
		
int main() {
	return 0;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:25:10: warning: 'LL' may be used uninitialized in this function [-Wmaybe-uninitialized]
    if(LL == -1) break;
       ~~~^~~~~
gap.cpp:43:15: warning: 'RR' may be used uninitialized in this function [-Wmaybe-uninitialized]
  ll ans = (RR - LL + n - 2) / (n - 1);
            ~~~^~~~
gap.cpp:43:15: warning: 'LL' may be used uninitialized in this function [-Wmaybe-uninitialized]
/tmp/ccVYBRCi.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/ccOd1qoF.o:gap.cpp:(.text+0x0): first defined here
/tmp/ccVYBRCi.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccOd1qoF.o:gap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status