Submission #516487

#TimeUsernameProblemLanguageResultExecution timeMemory
516487JomnoiGap (APIO16_gap)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #define DEBUG 0 using namespace std; const int N = 1e5 + 10; const long long INF = 1e18 + 7; long long a[N]; int findGap(int T, int N) { if(T == 1) { MinMax(0, INF, a[1], a[N]); int l = 2, r = N - 1; while(l <= r) { MinMax(a[l - 1], a[r + 1], a[l], a[r]); l++, r--; } long long ans = 0; for(int i = 1; i < N; i++) { ans = max(ans, a[i + 1] - a[i]); } return ans; } else { // I will do it when I figured it out. } }

Compilation message (stderr)

gap.cpp: In function 'int findGap(int, int)':
gap.cpp:13:26: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   13 |        MinMax(0, INF, a[1], a[N]);
      |                       ~~~^
      |                          |
      |                          long long int
In file included from gap.cpp:2:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:13:32: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   13 |        MinMax(0, INF, a[1], a[N]);
      |                             ~~~^
      |                                |
      |                                long long int
In file included from gap.cpp:2:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
gap.cpp:16:42: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   16 |            MinMax(a[l - 1], a[r + 1], a[l], a[r]);
      |                                       ~~~^
      |                                          |
      |                                          long long int
In file included from gap.cpp:2:
gap.h:1:35: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                   ^~~~~~~~~~
gap.cpp:16:48: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   16 |            MinMax(a[l - 1], a[r + 1], a[l], a[r]);
      |                                             ~~~^
      |                                                |
      |                                                long long int
In file included from gap.cpp:2:
gap.h:1:47: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
    1 | void MinMax(long long, long long, long long*, long long*);
      |                                               ^~~~~~~~~~
gap.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^