Submission #1027539

# Submission time Handle Problem Language Result Execution time Memory
1027539 2024-07-19T07:24:33 Z Gangsta Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "bits/stdc++.h"
#include "gap.h"
#define ll long long int
#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){

// }

ll findGap(ll t, ll n){
	ll mn = 1, mx = 1e18, tmp, tmp1;
	if(t == 1){
		while(1){
			tmp = mn, tmp1 = mx;
			MinMax(mn, mx, mn, mx);
			if(mn == -1) return ans;
			ans = max({ans,mn-tmp, tmp1-mx});
		}
	}
}

Compilation message

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:25:19: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   25 |    MinMax(mn, mx, mn, mx);
      |                   ^~
      |                   |
      |                   long long int
In file included from gap.cpp:2:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:25:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   25 |    MinMax(mn, mx, mn, mx);
      |                       ^~
      |                       |
      |                       long long int
In file included from gap.cpp:2:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
gap.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      | ^