Language: C++

#include <cstdio>
#include <algorithm>
#include <cctype>
#include <cstring>
#include <cmath>
#include <vector>
using namespace std;
inline int read(int f = 1, int x = 0, char ch = ' ')
{
    while(!isdigit(ch = getchar())) if(ch == '-') f = -1;
    while(isdigit(ch)) x = x*10+ch-'0', ch = getchar();
    return f*x;
}
const int N = 2e5+5;
const double PI = acos(-1);
int m, x1, y1, x2, y2, rx, ry;
int n, a[N], b[N], px[N], py[N], t[N], k;
vector<int> s[N];
double ans;
void change(int x, int d) { for( ; x <= n; x += x&-x) t[x] = max(t[x], d); }
int ask(int x) { int ret = 0; for( ; x; x -= x&-x) ret = max(ret, t[x]); return ret; }
int main()
{
    x1 = read(), y1 = read(), x2 = read()-x1, y2 = read()-y1, m = read(), rx = ry = 1;
    if(x2 < 0) rx = -1, x2 = -x2; if(y2 < 0) ry = -1, y2 = -y2;
    for(int i = 1; i <= m; ++i)
    {
        int x = rx*(read()-x1), y = ry*(read()-y1);
        if(0 <= x&&x <= x2&&0 <= y&&y <= y2) px[++n] = x, a[n] = x, py[n] = y, b[n] = y;
    }
    sort(a+1, a+1+n), sort(b+1, b+1+n);
    for(int i = 1; i <= n; ++i)
        px[i] = lower_bound(a+1, a+1+n, px[i])-a,
        py[i] = lower_bound(b+1, b+1+n, py[i])-b,
        s[py[i]].push_back(px[i]);
    for(int i = 1; i <= n; ++i)
    {
        sort(s[i].begin(), s[i].end());
        reverse(s[i].begin(), s[i].end());
        for(int j = 0; j < s[i].size(); ++j) change(s[i][j], ask(s[i][j]-1)+1);
    }
    ans = 100.0*(x2+y2)+(5*PI-20)*(k = ask(n));
    if(k == min(x2, y2)+1) ans += 5*PI;
    printf("%lf\n", ans);
    return 0;
}

Compiler output:
a.cc:16:12: error: 'int y1' redeclared as different kind of entity
   16 | int m, x1, y1, x2, y2, rx, ry;
      |            ^~
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:24:21: error: assignment of function 'double y1(double)'
   24 |     x1 = read(), y1 = read(), x2 = read()-x1, y2 = read()-y1, m = read(), rx = ry = 1;
      |                  ~~~^~~~~~~~
a.cc:24:58: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   24 |     x1 = read(), y1 = read(), x2 = read()-x1, y2 = read()-y1, m = read(), rx = ry = 1;
      |                                                    ~~~~~~^~~
      |                                                        |  |
      |                                                        |  double(double) noexcept
      |                                                        int
a.cc:28:47: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   28 |         int x = rx*(read()-x1), y = ry*(read()-y1);
      |                                         ~~~~~~^~~
      |                                             |  |
      |                                             |  double(double) noexcept
      |                                             int