Submission #390935

#TimeUsernameProblemLanguageResultExecution timeMemory
390935BlagojceGap (APIO16_gap)C++11
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second
#define pq priority_queue
#define all(x) begin(x), end(x)
 
 
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
 
const int mxn = 1e5;
#include "gap.h

long long findGap(int T, int N)
{
	ll a1, an;
	MinMax(0, 1e18, &a1, &an);
	
	
	ll d = (an - a1)/(N-1);
	
	
	ll pr = a1;
	
	ll ans = 0;
	for(int i = 0; a1 + 1 + i*d < an; i++){
		ll ai, aj;
		MinMax(a1+1 + i*d, min(a1 + (i+1)*d, an-1), &ai, &aj);
		
		if(ai != -1){
			ans = max(ans, ai-pr);
			pr = aj;
		}
	}
	ans = max(ans, an-pr);
	
	return ans;
}

Compilation message (stderr)

gap.cpp:16:10: warning: missing terminating " character
   16 | #include "gap.h
      |          ^
gap.cpp:16:10: error: #include expects "FILENAME" or <FILENAME>
   16 | #include "gap.h
      |          ^~~~~~
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:21:2: error: 'MinMax' was not declared in this scope
   21 |  MinMax(0, 1e18, &a1, &an);
      |  ^~~~~~