Submission #744209

#TimeUsernameProblemLanguageResultExecution timeMemory
744209b00norpGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include "gap.h" #include <bits/stdc++.h> using namespace std; long long findGap(int T, int N) { if(T == 1) { long long mn = 0, mx = 1e18; vector<long long> a(N); int l = 0, r = N - 1; while(l <= r) { MinMax(mn, mx, mn, mx); a[l++] = mn; a[r--] = mx; } long long diff = 0; for(int i = 1; i < N; i++) { diff = max(diff, a[i] - a[i - 1]); } return diff; } return 0; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:14:19: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   14 |    MinMax(mn, mx, mn, mx);
      |                   ^~
      |                   |
      |                   long long int
In file included from gap.cpp:1:
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:14:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   14 |    MinMax(mn, mx, mn, mx);
      |                       ^~
      |                       |
      |                       long long int
In file included from gap.cpp:1:
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*);
      |                                               ^~~~~~~~~~