Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const double pi = acos(-1);
const int maxn = 200010;
int x1, y1, x2, y2, n;
vector<pair<int,int>> points;

int LIS() {
	if (points.empty()) return 0;
	vector<int> ret(1e9, points.size());
	for (auto t:points) {
		*lower_bound(ret.begin(), ret.end(), t.second) = t.second;
	}
	return find(ret.begin(), ret.end(), 1e9) - ret.begin();
}

int main() {
	scanf("%d%d%d%d%d", &x1, &y1, &x2, &y2, &n);
	double pval = 20 - 5 * pi, qval = 10 * pi - 20;
	double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
	int xs = x1 > x2 ? -1 : 1;
	int ys = y1 > y2 ? -1 : 1;
	x1 *= xs; x2 *= xs;
	y1 *= ys; y2 *= ys;
	for (int i = 1; i <= n; i++) {
		int x, y;
		scanf("%d%d", &x, &y);
		x *= xs, y *= ys;
		if (x1 <= x && x <= x2 && y1 <= y && y <= y2) points.emplace_back(x, y);
	}
	sort(points.begin(), points.end());
	int k = LIS();
	if (k == min(x2 - x1, y2 - y1) + 1) {
		ans += -(k-1) * pval + qval;
	} else {
		ans += -k * pval;
	}
	printf("%.10f\n", ans);
	
	return 0;
}

Compiler output:
a.cc:6:9: error: 'int y1' redeclared as different kind of entity
    6 | int x1, y1, x2, y2, n;
      |         ^~
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/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 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:21:51: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                                ~~~^~~~
a.cc:21:47: error: no matching function for call to 'abs(double (*)(double) noexcept)'
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                            ~~~^~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42:
/usr/include/stdlib.h:980:12: note: candidate: 'int abs(int)' (near match)
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
/usr/include/stdlib.h:980:12: note:   conversion of argument 1 would be ill-formed:
a.cc:21:51: error: invalid conversion from 'double (*)(double) noexcept' to 'int' [-fpermissive]
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                                ~~~^~~~
      |                                                   |
      |                                                   double (*)(double) noexcept
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)' (near match)
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note:   conversion of argument 1 would be ill-formed:
a.cc:21:51: error: invalid conversion from 'double (*)(double) noexcept' to '__int128' [-fpermissive]
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                                ~~~^~~~
      |                                                   |
      |                                                   double (*)(double) noexcept
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)' (near match)
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note:   conversion of argument 1 would be ill-formed:
a.cc:21:51: error: invalid conversion from 'double (*)(double) noexcept' to 'long long int' [-fpermissive]
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                                ~~~^~~~
      |                                                   |
      |                                                   double (*)(double) noexcept
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)' (near match)
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note:   conversion of argument 1 would be ill-formed:
a.cc:21:51: error: invalid conversion from 'double (*)(double) noexcept' to 'long int' [-fpermissive]
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                                ~~~^~~~
      |                                                   |
      |                                                   double (*)(double) noexcept
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166:
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_ValArray, _Tp>, _Tp> std::abs(const valarray<_Tp>&)'
  445 |     _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note:   template argument deduction/substitution failed:
a.cc:21:47: note:   mismatched types 'const std::valarray<_Tp>' and 'double (*)(double) noexcept'
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                            ~~~^~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_UnClos<std::_Abs, std::_Expr, _Dom>, typename _Dom::value_type> std::abs(const _Expr<_Dom1, typename _Dom1::value_type>&)'
  445 |     _DEFINE_EXPR_UNARY_FUNCTION(abs, struct std::_Abs)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:445:5: note:   template argument deduction/substitution failed:
a.cc:21:47: note:   mismatched types 'const std::_Expr<_Dom1, typename _Dom1::value_type>' and 'double (*)(double) noexcept'
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                            ~~~^~~~~~~~~
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/complex:892:5: note: candidate: 'template<class _Tp> _Tp std::abs(const complex<_Tp>&)'
  892 |     abs(const complex<_Tp>& __z) { return __complex_abs(__z.__rep()); }
      |     ^~~
/usr/include/c++/14/complex:892:5: note:   template argument deduction/substitution failed:
a.cc:21:47: note:   mismatched types 'const std::complex<_Tp>' and 'double (*)(double) noexcept'
   21 |         double ans = 100 * (abs(x1 - x2) + abs(y1 - y2));
      |                                            ~~~^~~~~~~~~
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:137:18: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to '__float128'
  137 |   abs(__float128 __x)
      |       ~~~~~~~~~~~^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:19: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to 'long double'
   79 |   abs(long double __x)
      |       ~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:13: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to 'float'
   75 |   abs(float __x)
      |       ~~~~~~^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:14: note:   no known conversion for argument 1 from 'double (*)(double) noexcept' to 'double'
   71 |   abs(double __x)
      |       ~~~~~~~^~~
a.cc:23:21: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   23 |         int ys = y1 > y2 ? -1 : 1;
      |                  ~~~^~~~
a.cc:25:12: error: invalid operands of types 'double(double) noexcept' and 'int' to binary 'operator*'
   25 |         y1 *= ys; y2 *= ys;
      |         ~~~^~~~~
a.cc:25:12: note:   in evaluation of 'operator*=(double(double) noexcept, int)'
a.cc:30:46: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   30 |                 if (x1 <= x && x <= x2 && y1 <= y && y <= y2) points.emplace_back(x, y);
      |                                           ~~~^~~~
a.cc:34:34: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   34 |         if (k == min(x2 - x1, y2 - y1) + 1) {
      |                               ~~ ^ ~~
      |                               |    |
      |                               int  double(double) noexcept