제출 #227638

#제출 시각아이디문제언어결과실행 시간메모리
227638Arg_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 /* void MinMax(i64 s, i64 t, i64 &mn, i64 &mx) { } */ 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 ; } vector <i64> solve2( int n , i64 lo, i64 hi ) { vector <i64> v ; v.pb(lo) ; //v.pb(hi) ; i64 d = ( hi-lo + n-1 -1 )/(n-1) ; i64 cur = lo ; while( cur < hi ) { cur++ ; i64 mn , mx ; MinMax(cur,cur+d, &mn,&mx) ; if( mn!=-1 ) { v.pb(mn) ; if( mn!=mx ) v.pb(mx) ; } cur += d ; } 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) ; else p = solve2(n,mn,mx) ; i64 ans = 0 ; for(int i=1 ; i<(int)p.size() ; 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:51:9: error: 'MinMax' was not declared in this scope
         MinMax(lo,hi,&mn,&mx) ;
         ^~~~~~
gap.cpp:51:9: note: suggested alternative: 'rindex'
         MinMax(lo,hi,&mn,&mx) ;
         ^~~~~~
         rindex
gap.cpp: In function 'std::vector<long long int> solve2(int, long long int, long long int)':
gap.cpp:71:9: error: 'MinMax' was not declared in this scope
         MinMax(cur,cur+d, &mn,&mx) ;
         ^~~~~~
gap.cpp:71:9: note: suggested alternative: 'rindex'
         MinMax(cur,cur+d, &mn,&mx) ;
         ^~~~~~
         rindex
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:87:5: error: 'MinMax' was not declared in this scope
     MinMax(0,INF,&mn,&mx) ;
     ^~~~~~
gap.cpp:87:5: note: suggested alternative: 'rindex'
     MinMax(0,INF,&mn,&mx) ;
     ^~~~~~
     rindex