답안 #32242

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
32242 2017-10-05T03:41:15 Z dqhungdl Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
#include "gap.h";
using namespace std;

int64_t a[100005];

int64_t findGap(int T, int n)
{
    MinMax(0,1e18,&a[1],&a[n]);
    int i=2,j=n-1;
    while(i<=j)
        MinMax(a[i-1]+1,a[j+1]-1,&a[i],&a[j]);
    int64_t res=0;
    for(int i=2;i<=n;i++)
        res=max(res,a[i]-a[i-1]);
    return res;
}

Compilation message

gap.cpp:2:17: warning: extra tokens at end of #include directive
 #include "gap.h";
                 ^
gap.cpp: In function 'int64_t findGap(int, int)':
gap.cpp:9:30: error: invalid conversion from 'int64_t* {aka long int*}' to 'long long int*' [-fpermissive]
     MinMax(0,1e18,&a[1],&a[n]);
                              ^
In file included from gap.cpp:2: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:9:30: error: invalid conversion from 'int64_t* {aka long int*}' to 'long long int*' [-fpermissive]
     MinMax(0,1e18,&a[1],&a[n]);
                              ^
In file included from gap.cpp:2: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*);
      ^
gap.cpp:12:45: error: invalid conversion from 'int64_t* {aka long int*}' to 'long long int*' [-fpermissive]
         MinMax(a[i-1]+1,a[j+1]-1,&a[i],&a[j]);
                                             ^
In file included from gap.cpp:2: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:12:45: error: invalid conversion from 'int64_t* {aka long int*}' to 'long long int*' [-fpermissive]
         MinMax(a[i-1]+1,a[j+1]-1,&a[i],&a[j]);
                                             ^
In file included from gap.cpp:2: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*);
      ^