Submission #122773

#TimeUsernameProblemLanguageResultExecution timeMemory
122773tselmegkhGap (APIO16_gap)C++14
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "gap.h" using namespace std; #define INF 1e9 #define MAX 200005 #define xx first #define yy second #define pb push_back #define mp make_pair #define ull long long #define FOR(i,a,b) for(int i=a;i<=b;i++) #define nl '\n' #define zai <<' '<< #define all(a) a.begin(),a.end() #define pc __builtin_popcount #define debug(args...) cerr << #args << " = "; Dbg,args; cerr << nl; struct Dbg { template<typename T> Dbg& operator,(const T& v) { cerr << v << ", "; return *this; } } Dbg; template <typename T> ostream& operator<<(ostream& _o_, const vector<T>& _v_){ if(!_v_.empty()){_o_<<'[';copy(_v_.begin(),_v_.end(),ostream_iterator<T>(_o_,", "));_o_<<"\b\b]";}return _o_;} typedef vector<int> vi; typedef pair<int,int> ii; typedef vector<ii> vii; template<class C> void mini(C &_a, C _b) { _a = min(_a, _b); } template<class C> void maxi(C &_a, C _b) { _a = max(_a, _b); } ull a[MAX]; ull findGap(int T,int n){ ull mn = 0, mx = 1e18; int l = 0, r = n - 1; ull f,s; while(l <= r){ MinMax(mn, mx, f, s); a[l] = f; a[r] = s; mn = f + 1; mx = s - 1; l++; r--; } ull ans = 0; for(int i = 1; i < n; i++){ maxi(ans, a[i] - a[i - 1]); } return ans; }

Compilation message (stderr)

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:34:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
         MinMax(mn, mx, f, s);
                            ^
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:34:28: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
         MinMax(mn, mx, f, s);
                            ^
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*);
      ^~~~~~