Submission #95587

# Submission time Handle Problem Language Result Execution time Memory
95587 2019-02-02T06:20:10 Z rocketninja7 Gap (APIO16_gap) C++14
Compilation error
0 ms 0 KB
#include "gap.h"

long long findGap(int T, int N){
    long long arr[N];
    for(int i=0;i<(N+1)/2;i++){
        long long s=0, t=1000000000000000000, mn, mx;
        MinMax(s, t, *mn, *mx);
        s=arr[i]=mn;
        t=arr[N-1-i]=mx;
    }
    long long diff=0;
    for(int i=1;i<N;i++){
        diff=max(diff, arr[i]-arr[i-1]);
    }
	return diff;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:7:23: error: invalid type argument of unary '*' (have 'long long int')
         MinMax(s, t, *mn, *mx);
                       ^~
gap.cpp:7:28: error: invalid type argument of unary '*' (have 'long long int')
         MinMax(s, t, *mn, *mx);
                            ^~
gap.cpp:13:14: error: 'max' was not declared in this scope
         diff=max(diff, arr[i]-arr[i-1]);
              ^~~