Submission #105736

# Submission time Handle Problem Language Result Execution time Memory
105736 2019-04-14T09:02:09 Z Pro_ktmr Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define PB push_back
#define MP make_pair
#define MOD 1000000007

#include"gap.h"

//MinMax(LL s, LL t, LL& mn, LL& mx)
//aiのうちs以上の最小の数がmnに、aiのうちt以下の最大値がmxに格納される

//aiの差分のうち最大のものを返す
LL findGap(int T, int N){
	LL m = 0LL;
	LL M = 1000000000000000000LL;
	vector<LL> v;
	for(int i=0; i<(N+1)/2; i++){
		LL tmp1, tmp2;
		MinMax(m, M, tmp1, tmp2);
		v.PB(tmp1);
		v.PB(tmp2);
		m = tmp1+1;
		M = tmp2-1;
	}
	sort(v.begin(), v.end());

	LL ans = 0;
	for(int i=1; i<v.size(); i++){
		ans = max(ans, v[i] - v[i-1]);
	}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:21:26: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   MinMax(m, M, tmp1, tmp2);
                          ^
In file included from gap.cpp:9: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:21:26: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   MinMax(m, M, tmp1, tmp2);
                          ^
In file included from gap.cpp:9: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*);
      ^~~~~~
gap.cpp:30:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1; i<v.size(); i++){
               ~^~~~~~~~~