Submission #1027594

# Submission time Handle Problem Language Result Execution time Memory
1027594 2024-07-19T07:53:08 Z Gangsta Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "bits/stdc++.h"
#include "gap.h"
#define ll long long
#define pb push_back
#define pii pair<ll,ll>
#define ff first
#define ss second
#define sz size()

const int N = 2e5 + 1;

using namespace std;

ll ans;

// void MinMax(ll s, ll t, ll &mn, ll &mx){
// 	int a, b;
// 	cin >> a >> b;
// 	mn = a;
// 	mx = b;
// }

ll findGap(int t, int n){
	ll mn = -1, mx = 1e18+1, tmp = 0, tmp1 = 1e18;
	if(t == 1){
		while(1){
			tmp = max(mn,(ll)0), tmp1 = min(mx,(ll)1e18);
			mn++;
			mx--;
			if(mn > mx) return ans;
			MinMax(m, mx, &mn, &mx);
			if(mn == -1) return ans;
			ans = max({ans,mn-tmp, tmp1-mx});
		}
	}
}

// int main(){
//     int n, t;
//     cin >> t >> n;
//     cout << findGap(t, n);
// }

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:31:11: error: 'm' was not declared in this scope; did you mean 'mx'?
   31 |    MinMax(m, mx, &mn, &mx);
      |           ^
      |           mx
gap.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type]
   36 | }
      | ^