Submission #713093

#TimeUsernameProblemLanguageResultExecution timeMemory
713093lamGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define ll long long #include "gap.h" using namespace std; const int maxn = 1e5 + 10; int n; ll a[maxn]; ll sub1() { int l=1; int r=n; ll s = 0; ll t = 1e18; while (l<=r) { ll mmax,mmin; MinMax(s,t,mmax,mmin); s = mmax+1; t = mmin-1; a[l++]=mmin; a[r--]=mmax; } ll ans = 0; for (int i=2; i<=n; i++) ans = max(ans,a[i]-a[i-1]); return ans; } ll findGap(int T, int N) { n=N; if (T==1) return sub1(); else return 0; }

Compilation message (stderr)

gap.cpp: In function 'long long int sub1()':
gap.cpp:15:20: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   15 |         MinMax(s,t,mmax,mmin);
      |                    ^~~~
      |                    |
      |                    long long int
In file included from gap.cpp:3:
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:15:25: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   15 |         MinMax(s,t,mmax,mmin);
      |                         ^~~~
      |                         |
      |                         long long int
In file included from gap.cpp:3:
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*);
      |                                               ^~~~~~~~~~