Submission #464712

#TimeUsernameProblemLanguageResultExecution timeMemory
464712nickmet2004Gap (APIO16_gap)C++11
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h" #define ll long long using namespace std; ll findGap(int T , int n){ ll ans = 0; if(T == 1){ ll x = 0 , y = 1e18 , mn , mx ,k; for(int i = 1; i <= (n + 1) /2; ++i){ MinMax(x , y , mn , mx); if(x) ans = max(ans , mn - x + 1); if(y != 1e18) ans = max(ans , y - mx + 1); if(i == (n + 1) /2) ans = max(ans , mx - mn); x = mx + 1; y = mn - 1; } } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:11:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   11 |             MinMax(x , y , mn , mx);
      |                            ^~
      |                            |
      |                            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:11:33: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
   11 |             MinMax(x , y , mn , mx);
      |                                 ^~
      |                                 |
      |                                 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:9:40: warning: unused variable 'k' [-Wunused-variable]
    9 |         ll x = 0 , y = 1e18 , mn , mx ,k;
      |                                        ^