Language: C++

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#define S second
using namespace std;
int n, x1, y1, x2, y2, M=1e9, ac;
double ans, pi=acos(-1.0);
pair<int,int> a[200005];
vector<int> v;

int main() {
	int i, tx, ty, t;
	scanf("%d%d%d%d%d", &x1, &y1, &x2, &y2, &n);
	if(x1>x2) swap(x1, x2), swap(y1, y2);
	if(y1>y2) y1 = M-y1, y2 = M-y2;
	for(i=0; i<n; i++) {
		scanf("%d%d", &tx, &ty);
		if(tx<x1 || tx>x2 || ty<y1 || ty>y2) continue;
		if(y1>y2) ty = M-ty;
		a[ac++] = {tx, ty};
	}
	sort(a, a+ac);
	for(i=0; i<ac; i++) {
		t = lower_bound(v.begin(), v.end(), a[i].S) - v.begin();
		if(t==v.size()) v.push_back(a[i].S);
		else v[t] = a[i].S;
	}
	ans = (x2-x1 + y2-y1) * 100 + v.size() * (5*pi - 20);
	if(v.size() == min(x2-x1, y2-y1)+1) ans += 5*pi;
	printf("%.15f", ans);
	return 0;
}

Compiler output:
a.cc:7:12: error: 'int y1' redeclared as different kind of entity
    7 | int n, x1, y1, x2, y2, M=1e9, ac;
      |            ^~
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:15:37: error: no matching function for call to 'swap(double (&)(double) noexcept, int&)'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61,
                 from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/move.h:226:5: note: candidate: 'template<class _Tp> std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   deduced conflicting types for parameter '_Tp' ('double(double) noexcept' and 'int')
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
/usr/include/c++/14/bits/move.h:250:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> std::__enable_if_t<((bool)std::__is_swappable<_Tp>::value)> std::swap(_Tp (&)[_Nm], _Tp (&)[_Nm])'
  250 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |     ^~~~
/usr/include/c++/14/bits/move.h:250:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   mismatched types '_Tp [_Nm]' and 'double(double) noexcept'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1089:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value>::type std::swap(pair<_T1, _T2>&, pair<_T1, _T2>&)'
 1089 |     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
      |     ^~~~
/usr/include/c++/14/bits/stl_pair.h:1089:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double) noexcept'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1106:5: note: candidate: 'template<class _T1, class _T2> typename std::enable_if<(! std::__and_<std::__is_swappable<_T1>, std::__is_swappable<_T2> >::value)>::type std::swap(pair<_T1, _T2>&, pair<_T1, _T2>&)' (deleted)
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double) noexcept'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_vector.h:2122:5: note: candidate: 'template<class _Tp, class _Alloc> void std::swap(vector<_Tp, _Alloc>&, vector<_Tp, _Alloc>&)'
 2122 |     swap(vector<_Tp, _Alloc>& __x, vector<_Tp, _Alloc>& __y)
      |     ^~~~
/usr/include/c++/14/bits/stl_vector.h:2122:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   mismatched types 'std::vector<_Tp, _Alloc>' and 'double(double) noexcept'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/vector:87:
/usr/include/c++/14/tuple:2805:5: note: candidate: 'template<class ... _Elements> typename std::enable_if<std::__and_<std::__is_swappable<_Elements>...>::value>::type std::swap(tuple<_UTypes ...>&, tuple<_UTypes ...>&)'
 2805 |     swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
      |     ^~~~
/usr/include/c++/14/tuple:2805:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   mismatched types 'std::tuple<_UTypes ...>' and 'double(double) noexcept'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
/usr/include/c++/14/tuple:2823:5: note: candidate: 'template<class ... _Elements> typename std::enable_if<(! std::__and_<std::__is_swappable<_Elements>...>::value)>::type std::swap(tuple<_UTypes ...>&, tuple<_UTypes ...>&)' (deleted)
 2823 |     swap(tuple<_Elements...>&, tuple<_Elements...>&) = delete;
      |     ^~~~
/usr/include/c++/14/tuple:2823:5: note:   template argument deduction/substitution failed:
a.cc:15:37: note:   mismatched types 'std::tuple<_UTypes ...>' and 'double(double) noexcept'
   15 |         if(x1>x2) swap(x1, x2), swap(y1, y2);
      |                                 ~~~~^~~~~~~~
a.cc:16:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   16 |         if(y1>y2) y1 = M-y1, y2 = M-y2;
      |            ~~^~~
a.cc:16:25: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   16 |         if(y1>y2) y1 = M-y1, y2 = M-y2;
      |                        ~^~~
      |                        | |
      |                        | double(double) noexcept
      |                        int
a.cc:19:40: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if(tx<x1 || tx>x2 || ty<y1 || ty>y2) continue;
      |                                      ~~^~~
a.cc:20:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |                 if(y1>y2) ty = M-ty;
      |                    ~~^~~
a.cc:29:26: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   29 |         ans = (x2-x1 + y2-y1) * 100 + v.size() * (5*pi - 20);
      |                ~~~~~~~~~~^~~
      |                      |    |
      |                      int  double(double) noexcept
a.cc:30:37: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   30 |         if(v.size() == min(x2-x1, y2-y1)+1) ans += 5*pi;
      |                                   ~~^~~
      |                                   |  |
      |                                   |  double(double) noexcept
      |                                   int