Submission #624881

#TimeUsernameProblemLanguageResultExecution timeMemory
624881Cyber_WolfGap (APIO16_gap)C++14
0 / 100
53 ms2336 KiB
//Contest: APIO 16 Problem 3
//Problem Name: Gap


#include <bits/stdc++.h>
#include "gap.h"

using namespace std;


long long findGap(int subtask, int n)
{
	vector<long long> v;
	long long last = 0;
	for(int i = 0; i < n; i++)
	{
		long long mnm, mxm;
		MinMax(last, 1e18, &mnm, &mxm);
		v.push_back(mnm);
		last = mnm+1;
	}
	long long ans = 0;
	for(int i = 1; i < v.size(); i++)	ans = max(ans, v[i]-v[i-1]);
	return ans;
}

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:23:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |  for(int i = 1; i < v.size(); i++) ans = max(ans, v[i]-v[i-1]);
      |                 ~~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...