Submission #42622

# Submission time Handle Problem Language Result Execution time Memory
42622 2018-03-01T14:06:21 Z MatheusLealV Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#include "gap.h"
#define N 100005
using namespace std;
typedef long long ll;
 
ll n, v[N], ans[N];
 
ll findGap(int T, int N_)
{
	n = N_;
 
	ll esq = 0, dir = 2000000000000000000LL, best = 0;
 
	for(int i = 1, st = 1, en = n; i <= (n + 1)/2; i++, st ++, en --)
	{
		ll a, b;
 
		MinMax(esq, dir, a, b);
 
		esq = a + 1, dir = b - 1;
 
		ans[st] = a, ans[en] = b;
	}
 
	for(int i = 1; i <= n; i++) best = max(best, ans[i] - ans[i - 1]);
 
	return best;
}

Compilation message

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:19:24: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
   MinMax(esq, dir, a, b);
                        ^
In file included from gap.cpp:2: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:19:24: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
   MinMax(esq, dir, a, b);
                        ^
In file included from gap.cpp:2: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*);
      ^