Submission #156629

#TimeUsernameProblemLanguageResultExecution timeMemory
156629a_playerGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #define f first #define s second #define mp make_pair #define pb push_back using namespace std; typedef long long ll; ll mas=0; ll v[100001]; ll findGap(int T,int N){ if(T==2){ ll n=-1LL; int cont=0; while(cont<N){ ll i=1LL; ll a,b; MinMax(n+1,n+i+1,a,b); while(a==-1LL&&b==-1LL){ i*=2; MinMax(n+1,n+i+1,a,b); } if(n>=0LL)mas=max(mas,a-n); cont++; n=a;} return mas;} ll a=0,b=1000000000000000000; int i=0,j=N-1; while(i<=j){ MinMax(a,b,a,b); v[i]=a; v[j]=b; i++; j--; a++; b--; } for(int i=0;i<N-1;i++)mas=max(mas,v[i+1]-v[i]); return mas; }

Compilation message (stderr)

gap.cpp: In function 'll findGap(int, int)':
gap.cpp:20:22: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
  MinMax(n+1,n+i+1,a,b);
                      ^
In file included from gap.cpp:2:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:20:22: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
  MinMax(n+1,n+i+1,a,b);
                      ^
In file included from gap.cpp:2:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:23:27: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
       MinMax(n+1,n+i+1,a,b);
                           ^
In file included from gap.cpp:2:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:23:27: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
       MinMax(n+1,n+i+1,a,b);
                           ^
In file included from gap.cpp:2:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:32:19: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
     MinMax(a,b,a,b);
                   ^
In file included from gap.cpp:2:0:
gap.h:1:6: note:   initializing argument 3 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~
gap.cpp:32:19: error: invalid conversion from 'll {aka long long int}' to 'long long int*' [-fpermissive]
     MinMax(a,b,a,b);
                   ^
In file included from gap.cpp:2:0:
gap.h:1:6: note:   initializing argument 4 of 'void MinMax(long long int, long long int, long long int*, long long int*)'
 void MinMax(long long, long long, long long*, long long*);
      ^~~~~~