Submission #48478

# Submission time Handle Problem Language Result Execution time Memory
48478 2018-05-14T09:27:38 Z faishol27 Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "gap.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define PUB push_back

vector<ll>data;
ll kiri=0, kanan=1e18,
	rKiri, rKanan;

long long findGap(int T, int N)
{
	ll ans = 0;
	
	while(data.size() < N){
		MinMax(kiri, kanan, rKiri, rKanan);
		
		kiri = rKiri+1;
		kanan = rKanan-1;
		
		data.PUB(kiri);
		if(kiri != kanan) data.PUB(kanan);
	}
	
	sort(data.begin(), data.end());
	
	for(int i=1;i<N;i++){
		ans = max(ans, data[i]-data[i-1]);
	}
	return ans;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:16:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  while(data.size() < N){
        ~~~~~~~~~~~~^~~
gap.cpp:17:36: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
   MinMax(kiri, kanan, rKiri, rKanan);
                                    ^
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:17:36: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
   MinMax(kiri, kanan, rKiri, rKanan);
                                    ^
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*);
      ^~~~~~