Language: C++

#include <bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef pair < int , int > T;

inline void read(int &x) {
    char ch;
    bool flag = false;
    for (ch = getchar(); !isdigit(ch); ch = getchar())if (ch == '-') flag = true;
    for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
    x = flag ? -x : x;
}


inline void read(long long  &x) {
    char ch;
    bool flag = false;
    for (ch = getchar(); !isdigit(ch); ch = getchar())if (ch == '-') flag = true;
    for (x = 0; isdigit(ch); x = x * 10 + ch - '0', ch = getchar());
    x = flag ? -x : x;
}

const int maxn = 3100000;
int n;
struct zy{
long long x,y;
int op;
}a[maxn];

bool cmp( zy A ,zy B){
if (A.x!=B.x)
    return A.x<B.x;
return A.y < B.y;
}


long long  d[maxn],top;

int get_num( long long x ){
int l=1;
int r=top+1;
int ans=1;
while ( l <= r )
    {
        int mid=(l+r)/2;
        if ( d[ mid ] > x )
            {
                r=mid-1;
                ans=mid;
            }
        else
            l=mid+1;
    }
return ans;
}



int doit (int st,int ed ){
for (int i=1;i<maxn;i++)
    d[i]=120000000ll;
d[1]=a[st].y; top=1;
for (int i=st+1;i<ed;i++)
    {
        if ( a[i].y < a[st].y )
            continue;
        int tmp=get_num( a[i].y);
        d[tmp]=a[i].y;
        if (tmp > top )
            top++;
    }
int tmp=get_num( a[ed].y);
return tmp;
}

int main() {
    //printf("%.17f\n",40-( 900- 891.415926535897938 )  ) ;
    //printf("%.17f\n",acos(-1)  ) ;
    read(a[0].x); read(a[0].y); read(a[1].x); read(a[1].y);
    if (a[0].x > a[1].x )
        swap( a[0] ,a[1]);
    a[0].op=-1; a[1].op=1;
    read(n);
    n++;
    for (int i = 2;i<= n;i++)
    {
        read( a[ i ].x);
        read( a[ i ].y);
        a[i].op=0;
    }
    if ( a[0].y > a[1].y )
        {
            for (int i=0;i<=n;i++)
                a[i].y=-a[i].y;
        }
    sort ( a, a+n+1 , cmp );
    int st=0,ed=0;
    for (int i=0;i<=n;i++)
        if (a[i].op==-1)
        {
            st=i;
            break;
        }
    for (int i=0;i<=n;i++)
        if (a[i].op==1)
        {
            ed=i;
            break;
        }
    int tot=doit(st,ed)-2;
    long double PI=acos(-1);
    //long double PI=3.141592653589793827l;
    long double tmp=5.0l*PI*tot*1.0l -20.0l*tot*1.0l;
    long long ans=( (long long ) trunc( abs( a[st].x -a[ed].x) ) )*100ll + ( (long long ) trunc( abs( a[st].y - a[ed].y ) ) )*100ll ;
    if (tot == min ( a[ed].x- a[st].x ,  (int)abs( a[ ed ].y - a[st].y) )+1 )
        tmp=10.0l*PI*tot*1.0l -20.0l*tot*1.0l;
    long long LLtmp=(long long ) round( tmp-0.5 +1e-15 );
    long long ans_10=( (long long ) (  ans + LLtmp ) ) /10ll;
    long long k=ans-ans_10*10ll;
    cout << ans_10 ;
    tmp = 1.0l*k + tmp  ;
    cout << fixed << setprecision(25) << tmp << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:115:20: error: no matching function for call to 'min(long long int, int)'
  115 |     if (tot == min ( a[ed].x- a[st].x ,  (int)abs( a[ ed ].y - a[st].y) )+1 )
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:115:20: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
  115 |     if (tot == min ( a[ed].x- a[st].x ,  (int)abs( a[ ed ].y - a[st].y) )+1 )
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:115:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
  115 |     if (tot == min ( a[ed].x- a[st].x ,  (int)abs( a[ ed ].y - a[st].y) )+1 )
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~