Submission #773861

#TimeUsernameProblemLanguageResultExecution timeMemory
773861AminjinGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include<iostream> using namespace std; long long findGap(int T, int N) { long long mn, mx, i, j; long long a[N+1]; MinMax(0LL,LLONG_MAX, &mn, &mx); a[1] = mn; a[N] = mx; i = 1; j = N; while ( mn != -1 && mx != -1 ) { MinMax(mn+1, mx-1, &mn, &mx); i ++; j --; if ( mn == -1 ) break; a[i] = mn; a[j] = mx; } long long diff = 0; for ( i = 1; i < N; i ++ ) { diff = max(diff, a[i+1] - a[i]); } return diff; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:13: error: 'LLONG_MAX' was not declared in this scope
   11 |  MinMax(0LL,LLONG_MAX, &mn, &mx);
      |             ^~~~~~~~~
gap.cpp:3:1: note: 'LLONG_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    2 | #include<iostream>
  +++ |+#include <climits>
    3 | using namespace std;