제출 #47937

#제출 시각아이디문제언어결과실행 시간메모리
479373zpGap (APIO16_gap)C++14
컴파일 에러
0 ms0 KiB
#include "gap.h" #define ll long long #include<bits/stdc++.h> long long findGap(int T, int N) { ll s, t; MinMax(0, 1e18, &s, &t); ll L = t - s; ll d = L / (N - 1); ll ans = d; ll x = s; while(x != t){ ll p, q; MinMax(x + 1, x + d, &p , &q); if(q != -1) { x = q; continue; } int w = 2; while(1){ MinMax(x + 1,min( x + w * d, (ll)1e18),&p , &q); if(q == -1) continue; ans = max(ans, p - x); x = q; break; } } return ans; }

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

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:21:26: error: 'min' was not declared in this scope
             MinMax(x + 1,min( x + w * d, (ll)1e18),&p , &q);
                          ^~~
gap.cpp:21:26: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from gap.cpp:3:
/usr/include/c++/7/bits/stl_algo.h:3456:5: note:   'std::min'
     min(initializer_list<_Tp> __l, _Compare __comp)
     ^~~
gap.cpp:23:19: error: 'max' was not declared in this scope
             ans = max(ans, p - x);
                   ^~~
gap.cpp:23:19: note: suggested alternative:
In file included from /usr/include/c++/7/algorithm:62:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:65,
                 from gap.cpp:3:
/usr/include/c++/7/bits/stl_algo.h:3468:5: note:   'std::max'
     max(initializer_list<_Tp> __l, _Compare __comp)
     ^~~