Submission #32337

# Submission time Handle Problem Language Result Execution time Memory
32337 2017-10-09T13:30:47 Z WhipppedCream Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#ifdef atom
#include "grader.cpp"
#else
#include "gap.h"
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
#define X first
#define Y second
#define vi vector<int>
#define vvi vector< vi >
#define vii vector< ii >
#define mp make_pair
#define pb push_back
long long findGap(int T, int n)
{
	ll left, right;
	MinMax(0, 1e18, &left, &right);
	ll best = 0;
	if(T == 1)
	{
		ll lmin = left, lmax = right;
		for(int i = 2; i< n; i+= 2)
		{
			ll mmin, mmax;
			MinMax(lmin+1, lmax-1, mmin, mmax);
			best = max(best, mmin-lmin);
			best = max(best, lmax-mmax);
			lmin = mmin;
			lmax = mmax;
		}
		best = max(best, lmax-lmin);
	}
	return best;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:28:37: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
    MinMax(lmin+1, lmax-1, mmin, mmax);
                                     ^
In file included from gap.cpp:5:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^
gap.cpp:28:37: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
    MinMax(lmin+1, lmax-1, mmin, mmax);
                                     ^
In file included from gap.cpp:5:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^