Language: C++

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include<bitset>
#include <utility>
using namespace std;
#define rank rankk
#define mp make_pair
#define pb push_back
#define xo(a,b) ((b)&1?(a):0)
//#define LL ll
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef long long ll;
typedef pair<ll,int> pli;
const int INF=0x3f3f3f3f;
const ll INFF=0x3f3f3f3f3f3f3f3fll;
//const ll M=1e9+7;
//const ll maxn=2e5+7;
//const int MAXN=1005;
const int MAX=2e5+5;
const int MAX_N=MAX;
//const int N=55;
const ll MOD=1000000007;
const double pi=acos(-1.0);
//const double eps=0.00000001;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
template<typename T>inline T abs(T a) {return a>0?a:-a;}
template<class T> inline
void read(T& num) {
    bool start=false,neg=false;
    char c;
    num=0;
    while((c=getchar())!=EOF) {
        if(c=='-') start=neg=true;
        else if(c>='0' && c<='9') {
            start=true;
            num=num*10+c-'0';
        } else if(start) break;
    }
    if(neg) num=-num;
}
inline ll powMM(ll a,ll b,ll M){
    ll ret=1;
    a%=M;
//    b%=M;
    while (b){
        if (b&1) ret=ret*a%M;
        b>>=1;
        a=a*a%M;
    }
    return ret;
}
void open()
{
    freopen("1009.in","r",stdin);
    freopen("out.txt","w",stdout);
}
int x1,x2,y1,y2,xmin,xmax,ymin,ymax;
bool stx,sty;
struct node
{
    int x,y;
}a[MAX];
int n,cnt,dp[MAX],ge;
bool cmp(node p,node q)
{
    return ((p.x-q.x)>0)==stx;//若满足 则从下标小到大为p在q的右侧
}
bool judge(int nx,int ny)
{
    if(nx<xmin||nx>xmax||ny<ymin||ny>ymax)
        return false;
    return true;
}
int cn()//数最多有序的个数
{
    if(!cnt)
        return 0;
    sort(a,a+cnt,cmp);ge=1;
    dp[0]=a[0].y;
//    for(int i=0;i<cnt;i++)
//        printf("%d ",a[i].x);
//    printf("\n");
    for(int i=1;i<cnt;i++)
    {
        int l=0,r=ge-1,mid,ans=-1;
        while(l<=r)
        {
            mid=(l+r)/2;
            if(((dp[mid]-a[i].y)>0)==sty)
            {
                l=mid+1;
                ans=mid+1;
            }
            else
                r=mid-1;
        }
//        if((dp[mid]-a[i].y)==sty)
//            dp[mid+1]=a[i].y,ge=mid+2;
//        else
//            dp[mid]=a[i].y,ge=mid+1;
        if(ans!=-1)dp[ans]=a[i].y,ge=ans+1;
        else
        {

            dp[0]=a[i].y,ge=1;
//            printf("!! %d %d\n",a[i].y);
        }
    }
    return ge;

}
int main()
{
    scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
    xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
    stx=(x1-x2)>0;//x1在x2右侧
    sty=(y1-y2)>0;//y1在y2上方
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int p,q;
        scanf("%d%d",&p,&q);
        if(judge(p,q))a[cnt++]=node{p,q};
    }
//    printf("!cnt=%d \n",cnt);
    int num=cn();
//    printf("num! %d\n",num);
    double an;
    if(num==min(ymax-ymin+1,xmax-xmin+1))
        an=(xmax-xmin+ymax-ymin)*100.0+(10.0*pi-20.0);
    else an=(xmax-xmin+ymax-ymin)*100.0-(20.0-pi*5)*num;
    printf("%.10f\n",an);

}


Compiler output:
a.cc:68:11: error: 'int y1' redeclared as different kind of entity
   68 | int x1,x2,y1,y2,xmin,xmax,ymin,ymax;
      |           ^~
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cstdio:41,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:257:1: note: previous declaration 'double y1(double)'
  257 | __MATHCALL (y1,, (_Mdouble_));
      | ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:126:45: error: no matching function for call to 'min(double (&)(double) noexcept, int&)'
  126 |     xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
      |                                          ~~~^~~~~~~
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:2:
/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:126:45: note:   deduced conflicting types for parameter 'const _Tp' ('double(double) noexcept' and 'int')
  126 |     xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
      |                                          ~~~^~~~~~~
/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,
                 from a.cc:3:
/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:126:45: note:   mismatched types 'std::initializer_list<_Tp>' and 'double (*)(double) noexcept'
  126 |     xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
      |                                          ~~~^~~~~~~
a.cc:126:61: error: no matching function for call to 'max(double (&)(double) noexcept, int&)'
  126 |     xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
      |                                                          ~~~^~~~~~~
/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:126:61: note:   deduced conflicting types for parameter 'const _Tp' ('double(double) noexcept' and 'int')
  126 |     xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
      |                                                          ~~~^~~~~~~
/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
/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:126:61: note:   mismatched types 'std::initializer_list<_Tp>' and 'double (*)(double) noexcept'
  126 |     xmin=min(x1,x2);xmax=max(x1,x2);ymin=min(y1,y2);ymax=max(y1,y2);
      |                                                          ~~~^~~~~~~
a.cc:128:12: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  128 |     sty=(y1-y2)>0;//y1在y2上方
      |          ~~^~~
a.cc:128:16: error: ordered comparison of pointer with integer zero ('double (*)(double) noexcept' and 'int')
  128 |     sty=(y1-y2)>0;//y1在y2上方
      |         ~~~~~~~^~