Language: C++

#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<deque>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)

#define pi 3.14159265358979323846
typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

int mp[200020];
int dp[200020];


int main()
{
	double plu = (20. * pi / 4.) - 20.;
	double mai = (20. * pi / 2.) - 20.;
	
	REP(i,200020)dp[i] = 1000000000;
	
	ll sx,sy,gx,gy;cin >> sx >> sy >> gx >> gy;
	if(sx > gx)
	{
		swap(sx,gx);swap(sy,gy);
	}
	ll kake = 1;
	if(sy > gy)
	{
		kake = -1;
		sy *= -1;gy *= -1;
	}
	int n;cin >> n;
	
	vector<pair<ll,ll> > x;
	vector<pair<ll,ll> > y;
	
	REP(i,n)
	{
		ll a,b;cin >> a >> b;b*=kake;
		if(a > sx && a < gx && b > sy && b < gy)
		{
			x.PB(MP(a,i));y.PB(MP(b,i));
		}
	}
	
	sort(ALL(x));
	sort(ALL(y));
	
	REP(i,x.size())
	{
		mp[x[i].SE] = i;
	}
	
	REP(i,x.size())
	{
		ll tmp = mp[y[i].SE];
		*lower_bound(dp,dp+n,tmp) = tmp;
	}
	
	ll ans = lower_bound(dp,dp+n,1000000000) - dp;
	ll ret = 0;
	if(ans == min(abs(gx-sx),abs(gy-sy)))
	{
		ret++;ans--;ans = max(0,ans);
	}
	
	double dist = (double)(100.*(abs(gx-sx)+abs(gy-sy))) + ans*plu + ret*mai;
	//cout << ans << ' ' << ret << endl;
	cout << Decimal << dist << endl;
	
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:97:38: error: no matching function for call to 'max(int, ll&)'
   97 |                 ret++;ans--;ans = max(0,ans);
      |                                   ~~~^~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:97:38: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   97 |                 ret++;ans--;ans = max(0,ans);
      |                                   ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:13:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:97:38: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   97 |                 ret++;ans--;ans = max(0,ans);
      |                                   ~~~^~~~~~~