제출 #69150

#제출 시각아이디문제언어결과실행 시간메모리
69150FedericoSGap (APIO16_gap)C++14
0 / 100
75 ms2668 KiB
#include "gap.h"
#include <vector>
#include <iostream>
#include <assert.h>
#include <algorithm>
using namespace std;
typedef long long ll;

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

long long findGap(int T, int N)
{

	y=INF;
	while(x!=-1){
		MinMax(x,y,&x,&y);
		if(x==-1)break;
		V.push_back(x);
		V.push_back(y);
		x++;
		y--;
		if(x>=y)break;
	}

	sort(V.begin(),V.end());

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

	return x;
}

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

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:31:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=0;i<V.size()-1;i++)
              ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...