Language: C++

//Written by Zhu Zeqi
//Come on,baby
//Hack,please
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define CLR(x) memset(x,0,sizeof x)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define MAX 1000000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f
typedef long long ll;
//orz yht
using namespace std;
string i_s(int x){
	if(x==0)
	return "0";
	string ret="";
	while(x){
		ret=ret+(char)(x%10+'0');
		x/=10;
	}
	reverse(ret.begin(),ret.end());
	return ret;
}
string add(string a,string b){
	if(a=="")
	a="0";
	if(b=="")
	b="0";
	if(a.length()<b.length())
	swap(a,b);
	while(b.length()<a.length()){
		b='0'+b;
	}
	for(int i=0;i<a.length();i++){
		a[i]=a[i]+(b[i]-'0');
	}
	bool big=false;
	for(int i=a.length()-1;i>=0;i--){
		if(big){
			a[i]++;
		}
		big=false;
		if(a[i]>'9'){
			a[i]=a[i]-10;
			big=true;
		}
	}
	if(big)
	a='1'+a;
	return a;
}
string mul(string a,string b){
	vector<int> va,vb;
	if(a=="0" || b=="0")
	return "0";
	string ans;
	for(int i=0;i<a.length();i++){
		va.push_back(a[i]-'0');
	}
	for(int i=0;i<b.length();i++){
		vb.push_back(b[i]-'0');
	}
	reverse(va.begin(),va.end());
	reverse(vb.begin(),vb.end());
	vector<int> res;
	res.clear();
	res.resize(1005);
	for(int i=0;i<a.length();i++){
		for(int j=0;j<b.length();j++){
			res[i+j]+=(va[i]*vb[j]);
		}
	}
	for(int i=0;i<1005;i++){
		if(res[i]>9){
			res[i+1]+=(res[i]/10);
			res[i]%=10;
		}
	}
	for(int i=0;i<1005;i++){
		ans+=(res[i]+'0');
	}
	reverse(ans.begin(),ans.end());
	int k=0;
	while(ans[k]=='0'){
		k++;
	}
	ans=ans.substr(k);
	return ans;
}
bool is_prime(int n){
	if(n<2)
    return false;
    for(int i=2;i*i<=n;i++)
    if(n%i==0)
    return false;
    return true;
}
#define maxn 200010
#define P pair <int ,int>
using namespace std;
int k,flag=1,x1,pos,x2,y1,x,y,y2,n,cnt,st[maxn];
double ans;
P a[maxn];
int cmp(P A,P B){
	return A._1<B._1;
}
int main(){
	//freopen("input.in","r",stdin);
	//freopen("output.out","w",stdout);
	scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&n);
	if (x1>x2) swap(x1,x2),swap(y1,y2);
	if (y1>y2) flag=-1,y1*=flag,y2*=flag;
	for (int i=1;i<=n;++i)
	  {
	  	scanf("%d%d",&x,&y);y*=flag;
	  	if (!(x<x1||x>x2||y<y1||y>y2)) a[++cnt]={x,y};
	  }
	sort(a+1,a+1+cnt,cmp);
	st[0]=-INF;for (int i=1;i<=n+2;++i) st[i]=INF;
	for (int i=1;i<=cnt;++i)
	{
		y=a[i]._2;
		pos=upper_bound(st,st+n+2,y)-st;
		st[pos]=y;
	}
	k=lower_bound(st,st+n+2,INF)-st-1;
	printf("%.15f\n",(LL)(x2-x1+y2-y1)*(LL)100-20*k+5*k*Pi+(min(x2-x1,y2-y1)+1==k?5*Pi:0));
	//system("pause");
	return 0;
}

Compiler output:
a.cc:161:24: error: 'int y1' redeclared as different kind of entity
  161 | int k,flag=1,x1,pos,x2,y1,x,y,y2,n,cnt,st[maxn];
      |                        ^~
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/bits/requires_hosted.h:31,
                 from /usr/include/c++/14/cmath:41,
                 from a.cc:4:
/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 cmp(std::pair<int, int>, std::pair<int, int>)':
a.cc:165:18: error: 'struct std::pair<int, int>' has no member named '_1'
  165 |         return A._1<B._1;
      |                  ^~
a.cc:165:23: error: 'struct std::pair<int, int>' has no member named '_1'
  165 |         return A._1<B._1;
      |                       ^~
a.cc: In function 'int main()':
a.cc:171:36: error: no matching function for call to 'swap(double (&)(double) noexcept, int&)'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
In file included from /usr/include/c++/14/exception:166,
                 from /usr/include/c++/14/ios:41,
                 from /usr/include/c++/14/istream:40,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from a.cc:16:
/usr/include/c++/14/bits/exception_ptr.h:229:5: note: candidate: 'void std::__exception_ptr::swap(exception_ptr&, exception_ptr&)'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |     ^~~~
/usr/include/c++/14/bits/exception_ptr.h:229:25: note:   no known conversion for argument 1 from 'double(double) noexcept' to 'std::__exception_ptr::exception_ptr&'
  229 |     swap(exception_ptr& __lhs, exception_ptr& __rhs)
      |          ~~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/sstream:1204:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_stringbuf<_CharT, _Traits, _Alloc>&, basic_stringbuf<_CharT, _Traits, _Alloc>&)'
 1204 |     swap(basic_stringbuf<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1204:5: note:   template argument deduction/substitution failed:
a.cc:171:36: note:   mismatched types 'std::__cxx11::basic_stringbuf<_CharT, _Traits, _Alloc>' and 'double(double) noexcept'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
/usr/include/c++/14/sstream:1212:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_istringstream<_CharT, _Traits, _Allocator>&, basic_istringstream<_CharT, _Traits, _Allocator>&)'
 1212 |     swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1212:5: note:   template argument deduction/substitution failed:
a.cc:171:36: note:   mismatched types 'std::__cxx11::basic_istringstream<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
/usr/include/c++/14/sstream:1219:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_ostringstream<_CharT, _Traits, _Allocator>&, basic_ostringstream<_CharT, _Traits, _Allocator>&)'
 1219 |     swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1219:5: note:   template argument deduction/substitution failed:
a.cc:171:36: note:   mismatched types 'std::__cxx11::basic_ostringstream<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
/usr/include/c++/14/sstream:1226:5: note: candidate: 'template<class _CharT, class _Traits, class _Allocator> void std::__cxx11::swap(basic_stringstream<_CharT, _Traits, _Allocator>&, basic_stringstream<_CharT, _Traits, _Allocator>&)'
 1226 |     swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x,
      |     ^~~~
/usr/include/c++/14/sstream:1226:5: note:   template argument deduction/substitution failed:
a.cc:171:36: note:   mismatched types 'std::__cxx11::basic_stringstream<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  171 |         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/bits/specfun.h:43,
                 from /usr/include/c++/14/cmath:3906:
/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:171:36: note:   deduced conflicting types for parameter '_Tp' ('double(double) noexcept' and 'int')
  171 |         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:171:36: note:   mismatched types '_Tp [_Nm]' and 'double(double) noexcept'
  171 |         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:171:36: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double) noexcept'
  171 |         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:171:36: note:   mismatched types 'std::pair<_T1, _T2>' and 'double(double) noexcept'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bitset:52,
                 from a.cc:8:
/usr/include/c++/14/bits/basic_string.h:4039:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> void std::swap(__cxx11::basic_string<_CharT, _Traits, _Allocator>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 4039 |     swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~
/usr/include/c++/14/bits/basic_string.h:4039:5: note:   template argument deduction/substitution failed:
a.cc:171:36: note:   mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'double(double) noexcept'
  171 |         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/string:68:
/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:171:36: note:   mismatched types 'std::tuple<_UTypes ...>' and 'double(double) noexcept'
  171 |         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:171:36: note:   mismatched types 'std::tuple<_UTypes ...>' and 'double(double) noexcept'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
In file included from /usr/include/c++/14/deque:66,
                 from a.cc:27:
/usr/include/c++/14/bits/stl_deque.h:2370:5: note: candidate: 'template<class _Tp, class _Alloc> void std::swap(deque<_Tp, _Alloc>&, deque<_Tp, _Alloc>&)'
 2370 |     swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
      |     ^~~~
/usr/include/c++/14/bits/stl_deque.h:2370:5: note:   template argument deduction/substitution failed:
a.cc:171:36: note:   mismatched types 'std::deque<_Tp, _Alloc>' and 'double(double) noexcept'
  171 |         if (x1>x2) swap(x1,x2),swap(y1,y2);
      |                                ~~~~^~~~~~~
In file included from a.cc:29:
/usr/include/c++/14/fstream:1331:5: note: candidate: 'template<class _CharT, class _Traits> void std::swap(basic_filebuf<_CharT, _Traits>&, basic_filebuf<_CharT, _Traits>&)'
 1331 |     swap(basic_filebuf<_CharT, _Traits>& __x,
      |     ^~~~
/usr/