Language: C++

#include <algorithm>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const long double PI = 3.14159265358979323846264;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

#define N 200010
ll i1, j1, i2, j2, si, sj, n;
vector<P> x;

ll sgn(ll x){
	return x==0?0:x<0?-1:1;
}

int main(){
	cin>>i1>>j1>>i2>>j2;
	i2 -= i1; j2 -= j1;
	si = sgn(i2); sj = sgn(j2);
	i2 *= si; j2 *= sj;
	cin>>n;
	rep(i, n){
		ll a, b;
		cin>>a>>b;
		a -= i1; b -= j1;
		a *= si; b *= sj;
		if(a<0||a>i2||b<0||b>j2) continue;
		x.push_back(P(a, b));
	}
	n = x.size();
	sort(all(x));
	long double res = 100LL*(i2+j2);
	cout.precision(25);
	if(i2*j2==0){
		if(!x.empty()) res = res - 20 + 10*PI;
		cout<<res<<endl;
		return 0;
	}
	vector<ll> lis;
	rep(i, n){
		ll t = x[i].snd;
		auto it = lower_bound(lis.begin(), lis.end(), t);
		if(it==lis.end()) lis.push_back(t);
		else *it = t;
	}
	res = res + (-20+5*PI)*min(lis.size(), min(i2, j2)-1);
	cout<<res<<endl;

	return 0;
}


Compiler output:
a.cc:41:8: warning: built-in function 'j1' declared as non-function [-Wbuiltin-declaration-mismatch]
   41 | ll i1, j1, i2, j2, si, sj, n;
      |        ^~
a.cc: In function 'int main()':
a.cc:78:35: error: no matching function for call to 'min(std::vector<long long int>::size_type, long long int)'
   78 |         res = res + (-20+5*PI)*min(lis.size(), min(i2, j2)-1);
      |                                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:1:
/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:78:35: note:   deduced conflicting types for parameter 'const _Tp' ('long unsigned int' and 'long long int')
   78 |         res = res + (-20+5*PI)*min(lis.size(), min(i2, j2)-1);
      |                                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:78:35: note:   mismatched types 'std::initializer_list<_Tp>' and 'long unsigned int'
   78 |         res = res + (-20+5*PI)*min(lis.size(), min(i2, j2)-1);
      |                                ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~