답안 #40876

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
40876 2018-02-09T15:59:02 Z IvanC Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> ii;
const ll MINV = 0;
const ll MAXV = (ll)1e18;
ll NN,TT,maior;
ll findGap(int T,int N){
	TT = T;
	NN = N;
	ll ini,fim;
	MinMax(MINV,MAXV,ini,fim);
	ll gap = (ll)ceil(double(fim - ini)/double(N));
	vector<ll> diferencas;
	for(ll i = 0;i<N;i++){
		ll lo = ini + i*gap;
		ll hi = min(lo+gap,fim);
		if(i != 0) lo++;
		ll copia1,copia2;
		MinMax(lo,hi,&copia1,&copia2);
		maior = max(copia2 - copia1,maior);
	}
	return maior;
}

Compilation message

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:13:26: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
  MinMax(MINV,MAXV,ini,fim);
                          ^
In file included from gap.cpp:1: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:13:26: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
  MinMax(MINV,MAXV,ini,fim);
                          ^
In file included from gap.cpp:1: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*);
      ^