Submission #406345

#TimeUsernameProblemLanguageResultExecution timeMemory
406345p_squareGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h" #define fast ios::sync_with_stdio(0), cin.tie(0), cout.tie(0) #define ll long long #define mp make_pair #define se second #define fi first using namespace std; ll findGap(ll t, ll n) { ll a[n]; ll l = 0, r = 1e18+1; ll ptr1, ptr2; for(int i = 0; 2*i<n; i++) { MinMax(l, r, ptr1, ptr2); a[2*i] = ptr1; if(2*i < n-1) a[2*i+1] = ptr2; l = ptr1 + 1; r = ptr2 - 1; } sort(a, a+n); ll ma = 0; for(int i = 1; i<n; i++) { ma = max(ma, a[i]-a[i-1]); } return ma; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(long long int, long long int)':
gap.cpp:20:16: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   20 |   MinMax(l, r, ptr1, ptr2);
      |                ^~~~
      |                |
      |                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:20:22: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   20 |   MinMax(l, r, ptr1, ptr2);
      |                      ^~~~
      |                      |
      |                      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*);
      |                                               ^~~~~~~~~~