Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
    long long int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    long long int n;
    cin>>n;
    vector<long long int> x(n);
    vector<long long int> y(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
        if(x2<x1) x[i]=-x[i];
        if(y2<y1) y[i]=-y[i];
    }

    if(x2<x1){
        x2=-x2;
        x1=-x1;
    }
    if(y2<y1){
        y2=-y2;
        y1=-y1;
    }
    vector<long long int> px,py;
    for(int i=0;i<n;i++){
        if(x1<=x[i] && x[i]<=x2 && y1<=y[i] && y[i]<=y2){
            px.push_back(x[i]);
            py.push_back(y[i]);
        }
    }
    
    int s=px.size();
    vector<pair<long long int,long long int>> pxy(s);

    for(int i=0;i<s;i++){
        pxy[i]={x[i],y[i]};
    }
    sort(pxy.begin(),pxy.end());
    const long long int INF=1e9;
    vector<int> dp(s+1,INF);
    long long int cnt=0;
    dp[0]=-INF;
    for(int i=0;i<s;i++){
        int val=pxy[i].second;
        auto it=lower_bound(dp.begin(),dp.end(),val);
        *it=val;
        cnt=max(cnt,int(it-dp.begin()));
    }
    const long double PI=acos(-1);
    long double cut=20-PI*5;
    long double dis=PI*10-20;
    long long int ccnt=cnt;
    long long int dcnt=0;
    if(cnt==min(x2-x1,y2-y1)+1){
        ccnt--;
        dcnt++;
    }
    long double res=100LL*(x2-x1+y2-y1)-ccnt*cut+dcnt*dis;
    cout<<setprecision(12)<<fixed;
    cout<<res<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:16: error: no matching function for call to 'max(long long int&, int)'
   48 |         cnt=max(cnt,int(it-dp.begin()));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:48:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   48 |         cnt=max(cnt,int(it-dp.begin()));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:48:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   48 |         cnt=max(cnt,int(it-dp.begin()));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~