제출 #227626

#제출 시각아이디문제언어결과실행 시간메모리
227626Arg_007Gap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "gap.h" #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define sf scanf #define pf printf #define pb push_back #define mp make_pair #define PI ( acos(-1.0) ) #define IN freopen("hard1.txt","r",stdin) #define OUT freopen("hard1.txt","w",stdout) #define FOR(i,a,b) for(i=a ; i<=b ; i++) #define DBG pf("Hi\n") #define i64 long long int #define eps (1e-8) #define xx first #define yy second #define ln 17 #define off 1000005 using namespace __gnu_pbds; using namespace std ; typedef tree< i64, null_type, less<i64>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; typedef pair<i64, i64> pii; #define INF 1000000000000000000LL #define alpha 26 #define mod 998244353LL #define maxn 500005 #define LOG 18 vector <i64> solve1(int n,i64 lo, i64 hi) { vector <i64> v ; v.pb(lo) ; v.pb(hi) ; for(int i=1 ; i<(n+1)/2 ; i++ ) { lo++ ; hi-- ; i64 mn , mx ; MinMax(lo,hi,mn,mx) ; v.pb(mn) ; v.pb(mx) ; lo = mn ; hi = mx ; } sort( v.begin() , v.end() ) ; return v ; } i64 findGap( int t , int n ) { i64 mn , mx ; MinMax(0,INF,mn,mx) ; vector <i64> p ; if(t==1) p = solve1(n,mn,mx) ; i64 ans = 0 ; for(int i=1 ; i<n ; i++) ans = max( ans , p[i]-p[i-1] ) ; return ans ; } /* int main() { return 0 ; } */

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'std::vector<long long int> solve1(int, long long int, long long int)':
gap.cpp:45:27: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
         MinMax(lo,hi,mn,mx) ;
                           ^
In file included from gap.cpp:3: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:45:27: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
         MinMax(lo,hi,mn,mx) ;
                           ^
In file included from gap.cpp:3: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: In function 'long long int findGap(int, int)':
gap.cpp:57:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
     MinMax(0,INF,mn,mx) ;
                       ^
In file included from gap.cpp:3: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:57:23: error: invalid conversion from 'long long int' to 'long long int*' [-fpermissive]
     MinMax(0,INF,mn,mx) ;
                       ^
In file included from gap.cpp:3: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*);
      ^~~~~~