Submission #69148

# Submission time Handle Problem Language Result Execution time Memory
69148 2018-08-20T07:50:30 Z FedericoS Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "gap.h"
#include <vector>
#include <iostream>
using namespace std;
typedef long long ll;

ll INF=1000000000000000000;
ll x,y;
vector<ll> V;

long long findGap(int T, int N)
{

	for(int i=0;i<N;i++){
		MinMax(x,INF,&x,&y);
		V.push_back(x);
		assert(x!=-1);
		x++;
	}

	x=0;
	for(int i=0;i<N-1;i++)
		x=max(x,V[i+1]-V[i]);

	return x;
}

/*
1 6
1 2 5 7 8 12
*/

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:17:3: error: 'assert' was not declared in this scope
   assert(x!=-1);
   ^~~~~~
gap.cpp:17:3: note: suggested alternative: 'qsort'
   assert(x!=-1);
   ^~~~~~
   qsort