답안 #47926

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
47926 2018-05-09T08:09:28 Z khohko Gap (APIO16_gap) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "grader.cpp"
#pragma GCC optimize("O3")
using namespace std;
#define ll long long
#define lol long long
#define pb push_back
//#define mp make_pair
#define fr first
#define sc second
#define MAX ((lol)(1e15+100))
#define MX ((lol)(4e9+100))
#define ARRS ((lol)(1e6+100))
#define MOD ((lol)(1e9+7))
#define EP ((double)(1e-9))
#define EPS ((double)(1e-8))
#define pb push_back
#define PI ((double)3.141592653)
#define LG 21




long long findGap(int T, int n)
{
    vector<ll> v;
    ll k,p;
    MinMax(0,1e18,&k,&p);
    v.pb(k);
    v.pb(p);
    ll l=k+1,r=p-1;
    ll t=(r-l)/2*n;
    t=max(t,1ll);
    for(ll i=l; i<=r; i+=t){
        MinMax(i,min(r,i+t-1),&k,&p);
        v.pb(k);
        v.pb(p);
    }
    sort(v.begin(),v.end());
    ll pas=0;
    for(int i=1; i<v.size(); i++){
        pas=max(pas,v[i]-v[i-1]);
    }
	return pas;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:41:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=1; i<v.size(); i++){
                  ~^~~~~~~~~
/tmp/ccrSYVEX.o: In function `MinMax(long long, long long, long long*, long long*)':
grader.cpp:(.text+0x0): multiple definition of `MinMax(long long, long long, long long*, long long*)'
/tmp/ccrB3WZZ.o:gap.cpp:(.text+0x190): first defined here
/tmp/ccrSYVEX.o: In function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'
/tmp/ccrB3WZZ.o:gap.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status