criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
const double pi = acos(-1);
ll X1,Y1,X2,Y2,n,a[200020],d[200020],len;
map<ll,ll> x,y;
 
int main(){
    ios::sync_with_stdio(false);
    cin >> X1 >> Y1 >> X2 >> Y2 >> n;
    if(X2 < X1){
        swap(X1,X2);
        swap(Y1,Y2);
    }
    for(int i = 1,u,v;i <= n;++i){
        cin >> u >> v;
        x[u] = v;
        y[v] = u;
    }
    double qc = 5 * pi, ans = 0;
    if(X1 == X2){
        int p = min(Y1,Y2), q = max(Y1,Y2);
        ans = 100 * (q - p);
        if(x.count(X1) && x[X1] > p && x[X1] < q) ans += 2*qc - 20;
        cout << fixed << setprecision(12) << ans << endl;
        return 0;
    }
    if(Y1 == Y2){
        int p = min(X1,X2), q = max(X1,X2);
        ans = 100 * (q - p);
        if(y.count(Y1) && y[Y1] > p && y[Y1] < q) ans += 2*qc - 20;
        cout << fixed << setprecision(12) << ans << endl;
        return 0;
    }
 
    int cnt = 0, mny = min(Y1,Y2), mxy = max(Y1,Y2);
    ans = 100 * (X2 - X1 + mxy - mny);
    for(auto p: x){
        if(p.first < X1 || p.first > X2) continue;
        if(p.second >= mny && p.second <= mxy) a[++cnt] = (Y1 < Y2 ? 1 : -1) * p.second;
    }
 
    for(int i = 1;i <= cnt;++i) d[i] = 1e9;
    for(int i = 1;i <= cnt;++i){
        int pos = lower_bound(d+1,d+1+len,a[i]) - d;
        if(pos == len + 1) len++;
        d[pos] = a[i];
    }
 
    ans -= (20 - qc) * len;
    if(len > X2 - X1 || len > mxy - mny) ans += qc;
 
    cout << fixed << setprecision(12) << ans << endl;
 
    return 0;
}

Compiler output:
a.cc:3:1: error: extended character   is not valid in an identifier
    3 |  
      | ^
a.cc:8:1: error: extended character   is not valid in an identifier
    8 |  
      | ^
a.cc:36:1: error: extended character   is not valid in an identifier
   36 |  
      | ^
a.cc:43:1: error: extended character   is not valid in an identifier
   43 |  
      | ^
a.cc:50:1: error: extended character   is not valid in an identifier
   50 |  
      | ^
a.cc:53:1: error: extended character   is not valid in an identifier
   53 |  
      | ^
a.cc:55:1: error: extended character   is not valid in an identifier
   55 |  
      | ^
a.cc:3:1: error: '\U000000a0' does not name a type
    3 |  
      | ^
a.cc:6:1: error: 'll' does not name a type
    6 | ll X1,Y1,X2,Y2,n,a[200020],d[200020],len;
      | ^~
a.cc:7:5: error: 'll' was not declared in this scope
    7 | map<ll,ll> x,y;
      |     ^~
a.cc:7:8: error: 'll' was not declared in this scope
    7 | map<ll,ll> x,y;
      |        ^~
a.cc:7:10: error: template argument 1 is invalid
    7 | map<ll,ll> x,y;
      |          ^
a.cc:7:10: error: template argument 2 is invalid
a.cc:7:10: error: template argument 3 is invalid
a.cc:7:10: error: template argument 4 is invalid
a.cc:8:1: error: '\U000000a0' does not name a type
    8 |  
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>

using P = std::pair<int, int>;

constexpr double PI = 3.141592653589793238;

int n;

bool used[200000];

std::vector<P> vec;

int memo[200000];

int dx, dy;

int dfs(int m) {

	if (memo[m] >= 0)
		return memo[m];

	int res = 0;

	int v;

	if (dx > 0)
		v = std::upper_bound(vec.begin(), vec.end(), vec[m]) - vec.begin();
	else
		v = std::lower_bound(vec.begin(), vec.end(), vec[m]) - vec.begin() - 1;

	if (v < 0)
		return memo[m] = 0;

	for (int i = v; i < vec.size(); ++i) {
		if (dy > 0 && vec[m].second < vec[i].second)
			res = std::max(res, dfs(i));
		else if (dy<0 && vec[m].second>vec[i].second)
			res = std::max(res, dfs(i));
	}

	return memo[m] = res + 1;
}

int main() {

	int x1, y1, x2, y2;

	std::cin >> x1 >> y1 >> x2 >> y2 >> n;

	std::memset(memo, -1, sizeof(memo));

	P p;

	for (int i = 0; i<n; ++i) {
		std::cin >> p.first >> p.second;

		if (( (x1 <= p.first&&p.first <= x2) || (x2 <= p.first&&p.first <= x1) )&&
		((y1 <= p.second&&p.second <= y2) || (y2 <= p.second&&p.second <= y1))) {
			vec.emplace_back(p);
		}
	}

	if (x1 == x2 || y1 == y2) {

		int cnt = 0;

		for (int i = 0; i < vec.size(); ++i) {
			if (x1 == vec[i].first || y1 == vec[i].second)
				++cnt;
		}

		long double ans = (std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI / 2)*(double)cnt;

		std::cout << std::fixed << std::setprecision(15) << ans << std::endl;

		goto a;
	}

	if (x1 < x2)
		dx = 1;
	else
		dx = -1;
	if (y1 < y2)
		dy = 1;
	else
		dy = -1;

	std::sort(vec.begin(), vec.end());

	int cnt = 0;

	for (int i = 0; i < vec.size(); ++i) {

		if (!used[i])
			cnt = std::max(cnt, dfs(i));
	}

	double ans = double(std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI/4)*(double)cnt;

	std::cout << std::fixed << std::setprecision(15) << ans << std::endl;

a:;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:107:1: error: jump to label 'a'
  107 | a:;
      | ^
a.cc:81:22: note:   from here
   81 |                 goto a;
      |                      ^
a.cc:103:16: note:   crosses initialization of 'double ans'
  103 |         double ans = double(std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI/4)*(double)cnt;
      |                ^~~
a.cc:95:13: note:   crosses initialization of 'int cnt'
   95 |         int cnt = 0;
      |             ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>

using P = std::pair<int, int>;

constexpr double PI = 3.141592653589793238;

int n;

bool used[200000];

std::vector<P> vec;

int memo[200000];

int dx, dy;

int dfs(int m) {

	if (memo[m] >= 0)
		return memo[m];

	int res = 0;

	int v;

	if (dx > 0)
		v = std::upper_bound(vec.begin(), vec.end(), vec[m]) - vec.begin();
	else
		v = std::lower_bound(vec.begin(), vec.end(), vec[m]) - vec.begin() - 1;

	if (v < 0)
		return memo[m] = 0;

	for (int i = v; i < vec.size(); ++i) {
		if (dy > 0 && vec[m].second < vec[i].second)
			res = std::max(res, dfs(i));
		else if (dy<0 && vec[m].second>vec[i].second)
			res = std::max(res, dfs(i));
	}

	return memo[m] = res + 1;
}

int main() {

	int x1, y1, x2, y2;

	std::cin >> x1 >> y1 >> x2 >> y2 >> n;

	std::memset(memo, -1, sizeof(memo));

	P p;

	for (int i = 0; i<n; ++i) {
		std::cin >> p.first >> p.second;

		if (( (x1 <= p.first&&p.first <= x2) || (x2 <= p.first&&p.first <= x1) )&&
		((y1 <= p.second&&p.second <= y2) || (y2 <= p.second&&p.second <= y1))) {
			vec.emplace_back(p);
		}
	}

	if (x1 == x2 || y1 == y2) {

		int cnt = 0;

		for (int i = 0; i < vec.size(); ++i) {
			if (x1 == vec[i].first || y1 == vec[i].second)
				++cnt;
		}

		long double ans = (std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI / 2)*(double)cnt;

		std::cout << std::fixed << std::setprecision(15) << ans << std::endl;

		goto a;
	}

	if (x1 < x2)
		dx = 1;
	else
		dx = -1;
	if (y1 < y2)
		dy = 1;
	else
		dy = -1;

	std::sort(vec.begin(), vec.end());

	int cnt = 0;

	for (int i = 0; i < vec.size(); ++i) {

		if (!used[i])
			cnt = std::max(cnt, dfs(i));
	}

	double ans = double(std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI/4)*(double)cnt;

	std::cout << std::fixed << std::setprecision(15) << ans << std::endl;

a:;


	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:107:1: error: jump to label 'a'
  107 | a:;
      | ^
a.cc:81:22: note:   from here
   81 |                 goto a;
      |                      ^
a.cc:103:16: note:   crosses initialization of 'double ans'
  103 |         double ans = double(std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI/4)*(double)cnt;
      |                ^~~
a.cc:95:13: note:   crosses initialization of 'int cnt'
   95 |         int cnt = 0;
      |             ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define ALL(a) a.begin(),a.end()
using ll=long long;


int main(){
    const long double PI=acos(-1);
    cout<<setprecision(12)<<fixed;
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    int n;
    cin>>n;
    vector<int> x(n),y(n);
    for(int i=0;i<n;i++){
        cin>>x[i]>>y[i];
    }
    
    vector<int> nx,ny;
    for(int i=0;i<n;i++){
        if(min(x1,x2)<=x[i] && x[i]<=max(x1,x2) && min(y1,y2)<=y[i] && y[i]<=max(y1,y2)){
            nx.push_back(x[i]);
            ny.push_back(y[i]);
        }
    }
    n=nx.size();
    x=nx,y=ny;

    for(int i=0;i<n;i++){
        if(x2<x1){
            x[i]=-x[i];
        }
        if(y2<y1){
            y[i]=-y[i];
        }
    }
    if(x2<x1){
        x1=-x1;
        x2=-x2;
    }
    if(y2<y1){
        y1=-y1;
        y2=-y2;
    }

    vector<pair<int,int>> sx(n);
    for(int i=0;i<n;i++){
        sx[i]={x[i],i};
    }
    sort(ALL(sx));
    set<pair<int,int>> ss;
    vector<vector<int>> edge(n);
    vector<int> len(n,1);
    for(int i=0;i<n;i++){
        int index=sx[i].second;
        auto it=ss.lower_bound({y[index],-1});
        if(it==ss.begin()){
            len[index]=1;
        }
        else{
            it--;
            len[index]=it->second+1;
        }
        ss.insert({y[index],len[index]});
        it=ss.lower_bound({y[index],len[index]});
        it++;
        auto org=it;
        for(;it!=ss.end();it++){
            if(len[index]<(it->second){
                break;
            }
        }
        ss.erase(org,it);
    }
    int cnt=0;
    if(n>0) cnt=*max_element(len.begin(),len.end());
        
    long double cut=20-5*PI;
    long double res;
    if(cnt==min(x2-x1,y2-y1)+1){
        res=100*(x2-x1+y2-y1)-cut*(cnt-1)+10*PI-20;
    }
    else res=100*(x2-x1+y2-y1)-cut*cnt;
    cout<<res<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:39: error: expected ')' before '{' token
   70 |             if(len[index]<(it->second){
      |               ~                       ^
      |                                       )
a.cc:73:9: error: expected primary-expression before '}' token
   73 |         }
      |         ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>

using P = std::pair<int, int>;

constexpr double PI = 3.141592653589793238;

int n;

bool used[200000];

std::vector<P> vec;

int memo[200000];

int dx, dy;

int dfs(int m) {

	if (memo[m] >= 0)
		return memo[m];

	int res = 0;

	int v;

	if (dx > 0)
		v = std::upper_bound(vec.begin(), vec.end(), vec[m]) - vec.begin();
	else
		v = std::lower_bound(vec.begin(), vec.end(), vec[m]) - vec.begin() - 1;

	if (v < 0)
		return memo[m] = 0;

	for (int i = v; i < vec.size(); ++i) {
		if (dy > 0 && vec[m].second < vec[i].second)
			res = std::max(res, dfs(i));
		else if (dy<0 && vec[m].second>vec[i].second)
			res = std::max(res, dfs(i));
	}

	return memo[m] = res + 1;
}

int main() {

	int x1, y1, x2, y2;

	std::cin >> x1 >> y1 >> x2 >> y2 >> n;

	std::memset(memo, -1, sizeof(memo));

	P p;

	for (int i = 0; i<n; ++i) {
		std::cin >> p.first >> p.second;

		if (( (x1 <= p.first&&p.first <= x2) || (x2 <= p.first&&p.first <= x1) )&&
		((y1 <= p.second&&p.second <= y2) || (y2 <= p.second&&p.second <= y1))) {
			vec.emplace_back(p);
		}
	}

	if (x1 == x2 || y1 == y2) {

		int cnt = 0;

		for (int i = 0; i < vec.size(); ++i) {
			if (x1 == vec[i].first || y1 == vec[i].second)
				++cnt;
		}

		long double ans = (std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI / 2)*(double)cnt;

		std::cout << std::fixed << std::setprecision(15) << ans << std::endl;

		goto a;
	}

	if (x1 < x2)
		dx = 1;
	else
		dx = -1;
	if (y1 < y2)
		dy = 1;
	else
		dy = -1;

	std::sort(vec.begin(), vec.end());

	int cnt = 0;

	for (int i = 0; i < vec.size(); ++i) {

		if (!used[i])
			cnt = std::max(cnt, dfs(i));
	}

	double ans = double(std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI/4)*(double)cnt;

	std::cout << std::fixed << std::setprecision(15) << ans << std::endl;

a:;

	system("pause");

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:107:1: error: jump to label 'a'
  107 | a:;
      | ^
a.cc:81:22: note:   from here
   81 |                 goto a;
      |                      ^
a.cc:103:16: note:   crosses initialization of 'double ans'
  103 |         double ans = double(std::abs(x1 - x2) + std::abs(y1 - y2)) * 100.0 - 20.0 * (1.0 - PI/4)*(double)cnt;
      |                ^~~
a.cc:95:13: note:   crosses initialization of 'int cnt'
   95 |         int cnt = 0;
      |             ^~~
Language: C++


#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int MaxN = 200003;
#define x0 Fuck_the_GCC_header_x0
#define y0 Fuck_the_GCC_header_y0
#define x1 Fuck_the_GCC_header_x1
#define y1 Fuck_the_GCC_header_y1
#define X first
#define Y second
int x0,x1,y0,y1,n,cnt;
#define M_PI 3.14159265358979323846
constexpr double len=M_PI*20,len2=M_PI*10,len4=M_PI*5;
PII e[MaxN];
int a[MaxN],mn[MaxN];

int main() {
    ios::sync_with_stdio(false);cin.tie(0);
    cin >> x0 >> y0 >> x1 >> y1 >> n;
    if (x0>x1) {swap(x0,x1);swap(y0,y1);}
    cout << fixed << setprecision(15);
    cnt=0;
    for (int i=1;i<=n;++i) {
        int x,y;
        cin >> x >> y;
        if (x<min(x0,x1) || x>max(x0,x1) || y<min(y0,y1) || y>max(y0,y1)) continue;
        cnt++;
        e[cnt].first=x,e[cnt].second=y;
    }
    if (x1==x0) {
        double ans=(long long)abs(y1-y0)*100LL;
        for (int i=1;i<=cnt;++i) if (e[cnt].X==x1) ans=ans-20LL+len2;
        cout << ans << endl;
        return 0;
    }
    if (y1==y0) {
        double ans=(long long)abs(x1-x0)*100LL;
        for (int i=1;i<=cnt;++i) if (e[cnt].Y==y1) ans=ans-20LL+len2;
        cout << ans << endl;
        return 0;
    }
    sort(e+1,e+cnt+1);
    //if (x1<x0) reverse(e+1,e+cnt+1);
    if (y1<y0) for (int i=1;i<=cnt;++i) e[i].Y=2LL*y0-e[i].Y;
    for (int i=1;i<=cnt;++i) a[i]=e[i].Y;
    for (int i=1;i<=cnt;++i) mn[i]=0x7fffffff;
    mn[0]=0x80000000;
    int sum=0;
    for (int i=1;i<=cnt;++i) {
        int x=lower_bound(mn,mn+cnt+1,a[i])-mn;
        mn[x]=a[i];
        sum=max(sum,x);
    }
    double ans=100LL*(abs(x0-x1)+abs(y0-y1));
    ans=ans-20*sum+len4*sum;
	if(sum==abs(x-xx)+1||sum==abs(y-yy)+1)
		ans=ans+len4;
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:21: error: 'x' was not declared in this scope
   58 |         if(sum==abs(x-xx)+1||sum==abs(y-yy)+1)
      |                     ^
a.cc:58:23: error: 'xx' was not declared in this scope; did you mean 'x0'?
   58 |         if(sum==abs(x-xx)+1||sum==abs(y-yy)+1)
      |                       ^~
      |                       x0
a.cc:58:39: error: 'y' was not declared in this scope; did you mean 'yn'?
   58 |         if(sum==abs(x-xx)+1||sum==abs(y-yy)+1)
      |                                       ^
      |                                       yn
a.cc:58:41: error: 'yy' was not declared in this scope; did you mean 'yn'?
   58 |         if(sum==abs(x-xx)+1||sum==abs(y-yy)+1)
      |                                         ^~
      |                                         yn
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define PB push_back
#define MP make_pair
#define FOR( i , n ) for( ll i = 0; i < (n); i++ )
#define FORR( i , n ) for( ll i = ( n - 1 ); i >= 0 ; i-- )
#define DB( x ) cout << #x << " = " << x << endl;
#define OUT( a , n ) for( ll J = 0; J < (n); J++ )cout<< (a)[J] << " \n"[J == (n) - 1 ]
#define WAIT cout << flush , system("PAUSE");
#define CONTAINS(a, x) ((a).find(x) != (a).end())
#define endl '\n'

typedef long long ll;
typedef pair<ll, ll> pii;

#define y1 _jsdbgdg4095345

const ll N = 2e6 + 100;

const double pi = 2 * acos(0);
double fee = 20.0 - 2 * pi * 10 / 4.0;

ll x1 , y1 , x2 , y2;
ll n;


ll s[N];

ll t[N];

void add(ll i, ll x){
	for(; i < N;  i+= (i & -i)){
		t[i]  = max(t[i] , x);
	}
}

int query(ll i){
	ll ans = 0;
	for(; i > 0; i-= (i & -i)){
		ans = max(ans , t[i]);
	}
	return ans;
}

ll main()
{
	ios::sync_with_stdio( 0 );
	cin.tie( 0 );


	scanf("%d %d %d %d", &x1, &y1, &x2, &y2);
	scanf("%d", &n);

	if(x1 > x2){
		swap(x1 , x2);
		swap(y1 , y2);
	}

	vector<pii> pnts;

	/*
	1 1 3 1
	1
    2 1
	 */

	vector<ll> all;

	for( ll i = 0; i < n; i++ ){
		ll a , b;
		scanf("%d %d", &a, &b);
		if(a >= x1 && a <= x2 && b >= min(y1, y2) && b <= max(y1, y2)){
			all.push_back(b);
			pnts.push_back({a , b});
		}
	}

	sort(all.begin() , all.end());
	sort(pnts.begin(), pnts.end());

	for( ll i = 0; i < (ll)pnts.size(); i++){
		pnts[i].second= lower_bound(all.begin(), all.end(), pnts[i].second) - all.begin() + 1;
	}

	ll sz = pnts.size();

	for( ll i = 0; i < sz; i++){
		s[i] = pnts[i].second;
	}


	if(y1 > y2){
		reverse(s , s + sz);
	}


	ll dist= abs(x1 - x2) + abs(y1 - y2);

	ll ans = 0;
	for( ll i = 0; i < sz; i++ ){
		ll y = s[i];
		ll q = query(y) + 1;
		add(y, q);
	}

	ans = query(N - 1);

	double sol = 1LL * dist * 100 - ans * fee;

	if(ans == 1){
		if(x1 == x2 || y1 == y2){
			sol += 2 * pi * 10.0 / 4.0;
		}
	}


	prllf("%.18lf\n", sol);


	return 0;
}


Compiler output:
a.cc:47:1: error: '::main' must return 'int'
   47 | ll main()
      | ^~
a.cc: In function 'int main()':
a.cc:119:9: error: 'prllf' was not declared in this scope
  119 |         prllf("%.18lf\n", sol);
      |         ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define PII pair<LL,LL>
#define lowbit(x) ((x)&(-(x)))
#define FOR(i,a,b) for (LL i=(a);i<=(b);++i)
#define ROF(i,b,a) for (LL i=(b);i>=(a);--i)
typedef long long LL;
inline LL read(){
	LL x=0,f=1; char ch=getchar();
	while (ch<'0'||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	while (ch>='0'&&ch<='9') { x=x*10+ch-'0'; ch=getchar(); }
	return x*f;
}

const LL MAXN=400005,Mo=1000000007;
const double eps=1e-8,PI=3.1415926535897932384626433832;
struct P{
	LL x,y;
	P(LL xx=0,LL yy=0):x(xx),y(yy){}
	bool operator <(const P &B)const{ return x<B.x||x==B.x&&y<B.y; }
}A[MAXN],S,T;
LL n,m,f[MAXN],g[MAXN],c[MAXN];
LL add(LL x,LL y){ for (;x<MAXN;x+=lowbit(x)) f[x]=max(f[x],y); }
LL sum(LL x){ LL y=0; for (;x;x-=lowbit(x)) y=max(y,f[x]); return y;}
int main(){
	S.x=read(); S.y=read(); T.x=read(); T.y=read();
	if (S.x>T.x) swap(S,T);
	n=read();
	FOR(i,1,n) {
		A[i].x=read(); A[i].y=read();
		if (A[i].x>T.x||A[i].x<S.x||A[i].y>max(S.y,T.y)||A[i].y<min(S.y,T.y)) --i,--n;
	}
	double ans=(fabs(S.x-T.x)+fabs(S.y-T.y))*double(100);
	if (n==0) {
		prLLf("%.15f\n",ans);
		return 0;
	}
	else if (S.x==T.x||S.y==T.y) {
		ans+=PI*10-20;
		prLLf("%.15f\n",ans);
		return 0;
	}
	if (S.y>T.y) {
		FOR(i,1,n) A[i].y=T.y+S.y-A[i].y;
		swap(S.y,T.y);
	}
	FOR(i,1,n) c[i]=A[i].y;
	sort(c+1,c+1+n);
	FOR(i,1,n) A[i].y=lower_bound(c+1,c+1+n,A[i].y)-c;
	//FOR(i,1,n) cout<<A[i].y<<endl;
	sort(A+1,A+1+n);
	memset(f,0,sizeof(f));
	memset(g,0,sizeof(g));
	FOR(i,1,n) {
		g[i]=sum(A[i].y)+1;
		add(A[i].y,g[i]);
	}
	m=sum(n+1);
	//cout<<m<<endl;
	if (m) ans+=(PI*5-20)*double(m);
	prLLf("%.15f\n",ans);
	
	return 0;
}

/*
6 5 1 1
3
3 2
5 3
2 4
100000000 0 0 100000000
2
1 1
2 2

*/


Compiler output:
a.cc: In function 'LL add(LL, LL)':
a.cc:23:65: warning: no return statement in function returning non-void [-Wreturn-type]
   23 | LL add(LL x,LL y){ for (;x<MAXN;x+=lowbit(x)) f[x]=max(f[x],y); }
      |                                                                 ^
a.cc: In function 'int main()':
a.cc:35:17: error: 'prLLf' was not declared in this scope
   35 |                 prLLf("%.15f\n",ans);
      |                 ^~~~~
a.cc:40:17: error: 'prLLf' was not declared in this scope
   40 |                 prLLf("%.15f\n",ans);
      |                 ^~~~~
a.cc:61:9: error: 'prLLf' was not declared in this scope
   61 |         prLLf("%.15f\n",ans);
      |         ^~~~~
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

#define INF_LL (ll)1e18
#define INF (int)1e9
#define REP(i, n) for(int i = 0;i < (n);i++)
#define FOR(i, a, b) for(int i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
using ll = long long;
using PII = pair<int, int>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll x1, y1, x2, y2;
	int N;
	vector<pair<ll, ll> > foun;

	cin >> x1 >> y1 >> x2 >> y2;
	cin >> N;
	bool f = 0, f2 = 0;
	if(x2 < x1){
		swap(x2, x1);
		f2 = 1;
	}
	if(y2 < y1){
		swap(y2, y1);
		f = 1;
	}
	REP(i, N){
		ll x, y;
		cin >> x >> y;
		if(x1 <= x && x <= x2 && y1 <= y && y <= y2){
			foun.push_back({x, y*(f ? -1 : 1});
		}
	}
	ll dp[214514] = {};
	fill(dp, dp+214514, INF_LL);
	if(f2)
		sort(all(foun), greater<pair<ll, ll> >());
	else
		sort(all(foun));
	vector<ll> fy;
	REP(i, foun.size()){
		fy.push_back(foun[i].second);
	}
	ll max_in = -1;
	REP(i, fy.size()){
		ll in = lower_bound(dp, dp+214514, fy[i])-dp;
		dp[in] = fy[i];
		max_in = max(max_in, in);
	}
	long double res = (x2-x1+y2-y1)*(ll)100;
	max_in++;
	res -= max_in*20;
	if(x1 == x2 || y1 == y2)
		res += M_PI*max_in*10;
	else
		res += M_PI*max_in*5;
	cout << fixed << setprecision(20) << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:57: error: expected ')' before '}' token
   53 |                         foun.push_back({x, y*(f ? -1 : 1});
      |                                              ~          ^
      |                                                         )
Language: C++

#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#define PI 3.1415926535897932384

using namespace std;

bool pairCompare(const std::pair<int, int> &firstElem,
                 const std::pair<float, int> &secondElem) {
    return firstElem.first < secondElem.first;
}

int main() {
    double x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) swap(x2, x1);
    if (y1 > y2) swap(y2, y1);
    int N;
    cin >> N;

    vector<pair<int, int> > dots;
    for (int i = 0; i < N; i++) {
        int x, y;
        cin >> x >> y;
        if (x1 <= x && x <= x2 && y1 <= y && y <= y2) {
            dots.push_back(make_pair(x, y));
        }
    }

    sort(dots.begin(), dots.end(), pairCompare);

    int fountaiN = 0;
    if (dots.size() > 0) {
        fountaiN++;

        for (int i = 0; i < dots.size() - 1; i++) {
            if (dots[i].second <= dots[i + 1].second) {
                fountaiN++;
            } else if (dots[i].first == dots[i + 1].first) {
                fountaiN++;
            }
        }
    }

    double ans;
    if (x1 != x2 && y1 != y2) {
        if (fountaiN == 1) {
            ans = 100 * (x2 - x1) + 100 * (y2 - y1) + (5.0 * PI - 20.0);
        } else if (fountaiN >= 2) {
            ans = 100 * (x2 - x1) + 100 * (y2 - y1) + 2.0 * (5.0 * PI - 20.0);
        } else {
            ans = 100 * (x2 - x1) + 100 * (y2 - y1);
        }
    } else {
        if (fountaiN == 1) {
            ans = 100 * (x2 - x1) + 100 * (y2 - y1) + (10.0 * PI - 20.0);
        } else if (fountaiN >= 2) {
            ans = 100 * (x2 - x1) + 100 * (y2 - y1) + 2.0 * (10.0 * PI - 20.0);
        } else {
            ans = 100 * (x2 - x1) + 100 * (y2 - y1);
        }
    }

    printf("%.15f\n", ans);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   31 |     sort(dots.begin(), dots.end(), pairCompare);
      |     ^~~~
      |     sqrt
Language: C++

import math
sx,sy,gx,gy = list(map(int,input().split()))
n = int(input())
h = [0]*n
for i in range(n):
    h[i] = list(map(int,input().split()))
rx = 0
ry = 0
X = sx - 1
Y = sy - 1
if gx - sx <0:
    rx = 1
    X = sx + 1
if gy - sy < 0:
    ry = 1
    Y = sy + 1
_Y = Y

dp = [[0 for i in range(abs(sy-gy)+2)]for j in range(abs(sx-gx)+2)]
for i in range(0,abs(sx-gx)+2):
    if rx == 1:
        x = X - i
    else:
        x = X + i
    Y = _Y
    for j in range(0,abs(sy-gy)+2):
        if ry == 1:
            y = Y - j
        else:
            y = Y + j
        if(i == 0 or j== 9):
            continue
        for k in range(n):
            if h[k][0] == x and h[k][1] == y:
                dp[i][j] += 1
        dp[i][j] = max(dp[i-1][j]+dp[i][j], dp[i][j-1]+dp[i][j])

a = max(dp[len(dp)-1])



ans = (abs(sx-gx) + abs(sy-gy) )* 100
ans -= a*20
ans += a*(20 * math.pi/4)
if(sx==gx or sy == gy):
    ans += 20*math.pi/4
print(ans)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import math
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string.h>
#include <iomanip>
using namespace std;
 
 
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
typedef long long ll;
 
template <class T> int LIS(vector<T> &a) {
    T INF = numeric_limits<T>::max() / 2;
    vector<T> res(a.size()+1,INF);
    for (int i = 0; i < a.size(); i++) {
        *(lower_bound(res.begin(),res.end(),a[i])) = a[i];
    }
    for (int i = 0; i < a.size(); i++) {
        if (res[i] == INF) return i;
    }
    return (int) a.size();
}
 
 
int main() {
 
	ll x1,y1,x2,y2;
	ll N;
	vector<ll> X,Y;
 
	cin >> x1 >> y1 >> x2 >> y2;
	cin >> N;
 
	X.resize(N);
	Y.resize(N);
	REP(i,N) cin >> X[i] >> Y[i];
 
	bool dir;
	if (x1 <= x2 && y1 <= y2) dir = true;
	if (x1 <= x2 && y1 > y2) dir = false;
	if (x1 > x2 && y1 <= y2) dir = false;
	if (x1 > x2 && y1 > y2) dir = true;
 
	ll u = max(y1,y2);
	ll d = min(y1,y2);
	ll l = min(x1,x2);
	ll r = max(x1,x2);
 
	vector< pair<ll,ll> > arr;
	REP(i,N) {
		if (X[i] >= l && X[i] <= r && Y[i] >= d && Y[i] <= u) {
			if (!dir) Y[i] *= -1;
			arr.push_back(make_pair(X[i],Y[i]));
		}
	}
 
	sort(arr.begin(), arr.end());
 
	vector<ll> lis;
	REP(i,arr.size()) lis.push_back(arr[i].second);
 
	ll cross = LIS<ll> (lis);
	ll t = abs(x1 - x2) + abs(y1 - y2);


	if (x1 == x2 || y1 == y2) {
		ans = (double) t * 100.0;
		if (cross > 0) {
			ans -= 20.0;
			ans += M_PI * 10.0;
		}
		cout << fixed << setprecision(15) << ans << endl;
		return 0;
	}


	ll over = min(abs(x1 - x2) + 1, abs(y1 - y2) + 1);
	if (cross >= over) {
		cross = over - 1;
	}

	double ans = (double) t * 100.0;
	ans -= 20.0 * (double) cross;
	ans += M_PI * (double) cross / 2.0 * 10.0;
 

	//cout << cross << endl;
 
	cout << fixed << setprecision(15) << ans << endl;
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:85:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   85 |                 ans = (double) t * 100.0;
      |                 ^~~
      |                 abs
Language: C

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<iomanip>

using namespace std;

#define INF 1e+9
#define MAX_N 200000

int dp[MAX_N];


struct Point {
  int x,y;
  bool operator<(const Point& right) {
    return x < right.x;
  }
};

int solve(int n, const vector<int>& a) {

  fill(dp, dp+n, INF);
  for (int i=0; i<n; ++i) {
    *lower_bound(dp, dp+n, a[i]) = a[i];
  }
  return lower_bound(dp, dp+n, INF) - dp ;
}

int main(){
  Point p1,p2;
  int N;
  cin>>p1.x>>p1.y>>p2.x>>p2.y;
  cin>>N;
  vector<Point> points(N);
  for(int i=0;i<N;i++)
    cin>>points[i].x>>points[i].y;

  double result;
  if(p1.x==p2.x){
    bool pexit = false;
    int ymin=min(p1.y,p2.y);
    int ymax=max(p1.y,p2.y);
    int x=p1.x;
    for(int i=0;i<N;i++){
      if(x==points[i].x){
	int y=points[i].y;
	if(ymin<y&&y<ymax){
	  pexit = true;
	}
      }
    }
    result = 100 * (ymax-ymin);
    if (pexit)result += 10 * M_PI - 20;
    
  } else if (p1.y==p2.y) {
    bool pexit = false;
    int xmin=min(p1.x,p2.x);
    int xmax=max(p1.x,p2.x);
    int y=p1.y;
    for(int i=0;i<N;i++){
      if(y==points[i].y){
	int x=points[i].x;
	if(xmin<x&&x<xmax){
	  pexit = true;
	}
      }
    }
    result = 100 * (xmax-xmin);
    if (pexit)result += 10 * M_PI - 20;

  } else {

    Point start;
    Point end;
    if (p1<p2){
      start = p1;
      end   = p2;
    }else{
      start = p2;
      end   = p1;
    }
    sort(points.begin(),points.end());

    int xmin = min(start.x,end.x);
    int xmax = max(start.x,end.x);

    int ymin = min(start.y,end.y);
    int ymax = max(start.y,end.y);
    
    vector<int> data;
    for (int i=0;i<N;i++) {
      if (start.x<=points[i].x&&points[i].x<=end.x&&
	  ymin<=points[i].y&&points[i].y<=ymax)
	{
	  int d;
	  if (start.y<start.y)
	    d=points[i].y - start.y;
	  else
	    d=start.y - points[i].y;
	  data.push_back(d);
	}
    }
    result = 100 * (xmax - xmin + ymax - ymin) + solve(data.size(), data) * (5 * M_PI - 20);
  }

  cout << setprecision(18) << result << endl;
  return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<iomanip>

using namespace std;

#define INF 1e+9
#define MAX_N 200000

int dp[MAX_N];


struct Point {
  int x,y;
  operator<(const Point& right) {
    return x < right.x;
  }
};

int solve(int n, const vector<int>& a) {

  fill(dp, dp+n, INF);
  for (int i=0; i<n; ++i) {
    *lower_bound(dp, dp+n, a[i]) = a[i];
  }
  return lower_bound(dp, dp+n, INF) - dp ;
}

int main(){
  Point p1,p2;
  int N;
  cin>>p1.x>>p1.y>>p2.x>>p2.y;
  cin>>N;
  vector<Point> points(N);
  for(int i=0;i<N;i++)
    cin>>points[i].x>>points[i].y;

  double result;
  if(p1.x==p2.x){
    bool pexit = false;
    int ymin=min(p1.y,p2.y);
    int ymax=max(p1.y,p2.y);
    int x=p1.x;
    for(int i=0;i<N;i++){
      if(x==points[i].x){
	int y=points[i].y;
	if(ymin<y&&y<ymax){
	  pexit = true;
	}
      }
    }
    result = 100 * (ymax-ymin);
    if (pexit)result += 10 * M_PI - 20;
    
  } else if (p1.y==p2.y) {
    bool pexit = false;
    int xmin=min(p1.x,p2.x);
    int xmax=max(p1.x,p2.x);
    int y=p1.y;
    for(int i=0;i<N;i++){
      if(y==points[i].y){
	int x=points[i].x;
	if(xmin<x&&x<xmax){
	  pexit = true;
	}
      }
    }
    result = 100 * (xmax-xmin);
    if (pexit)result += 10 * M_PI - 20;

  } else {

    Point start;
    Point end;
    if (p1<p2){
      start = p1;
      end   = p2;
    }else{
      start = p2;
      end   = p1;
    }
    sort(points.begin(),points.end());

    int xmin = min(start.x,end.x);
    int xmax = max(start.x,end.x);

    int ymin = min(start.y,end.y);
    int ymax = max(start.y,end.y);
    
    vector<int> data;
    for (int i=0;i<N;i++) {
      if (start.x<=points[i].x&&points[i].x<=end.x&&
	  ymin<=points[i].y&&points[i].y<=ymax)
	{
	  int d;
	  if (start.y<start.y)
	    d=points[i].y - start.y;
	  else
	    d=start.y - points[i].y;
	  data.push_back(d);
	}
    }
    result = 100 * (xmax - xmin + ymax - ymin) + solve(data.size(), data) * (5 * M_PI - 20);
  }

  cout << setprecision(18) << result << endl;
  return 0;
}


Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<iomanip>

using namespace std;

#define INF 1e+9
#define MAX_N 200000

int dp[MAX_N];


struct Point {
  int x,y;
  operator<(const Point& right) {
    return x < right.x;
  }
};

int solve(int n, const vector<int>& a) {

  fill(dp, dp+n, INF);
  for (int i=0; i<n; ++i) {
    *lower_bound(dp, dp+n, a[i]) = a[i];
  }
  return lower_bound(dp, dp+n, INF) - dp ;
}

int main(){
  Point p1,p2;
  int N;
  cin>>p1.x>>p1.y>>p2.x>>p2.y;
  cin>>N;
  vector<Point> points(N);
  for(int i=0;i<N;i++)
    cin>>points[i].x>>points[i].y;

  double result;
  if(p1.x==p2.x){
    bool pexit = false;
    int ymin=min(p1.y,p2.y);
    int ymax=max(p1.y,p2.y);
    int x=p1.x;
    for(int i=0;i<N;i++){
      if(x==points[i].x){
	int y=points[i].y;
	if(ymin<y&&y<ymax){
	  pexit = true;
	}
      }
    }
    result = 100 * (ymax-ymin);
    if (pexit)result += 10 * M_PI - 20;
    
  } else if (p1.y==p2.y) {
    bool pexit = false;
    int xmin=min(p1.x,p2.x);
    int xmax=max(p1.x,p2.x);
    int y=p1.y;
    for(int i=0;i<N;i++){
      if(y==points[i].y){
	int x=points[i].x;
	if(xmin<x&&x<xmax){
	  pexit = true;
	}
      }
    }
    result = 100 * (xmax-xmin);
    if (pexit)result += 10 * M_PI - 20;

  } else {

    Point start;
    Point end;
    if (p1<p2){
      start = p1;
      end   = p2;
    }else{
      start = p2;
      end   = p1;
    }
    sort(points.begin(),points.end());

    int xmin = min(start.x,end.x);
    int xmax = max(start.x,end.x);

    int ymin = min(start.y,end.y);
    int ymax = max(start.y,end.y);
    
    vector<int> data;
    for (int i=0;i<N;i++) {
      if (start.x<=points[i].x&&points[i].x<=end.x&&
	  ymin<=points[i].y&&points[i].y<=ymax)
	{
	  int d;
	  if (start.y<start.y)
	    d=points[i].y - start.y;
	  else
	    d=start.y - points[i].y;
	  data.push_back(d);
	}
    }
    result = 100 * (xmax - xmin + ymax - ymin) + solve(data.size(), data) * (5 * M_PI - 20);
  }

  cout << setprecision(18) << result << endl;
  return 0;
}


Compiler output:
a.cc:17:3: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
   17 |   operator<(const Point& right) {
      |   ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define double long double
using namespace std;
 
#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;
const double PI = 3.14159265358979323846264338;
 
const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
 
#define NODES 7000000
 
int siz = 1ll << 32;
int dat[NODES],lind[NODES],rind[NODES],lrange[NODES],rrange[NODES],last = 1;
 
void create(int k){
	lind[k] = last;
	rind[k] = last + 1;
	lrange[last] = lrange[k];
	rrange[last] = (lrange[k] + rrange[k]) / 2;
	lrange[last + 1] = (lrange[k] + rrange[k]) / 2;
	rrange[last + 1] = rrange[k];
	last += 2;
}
 
void update(int i,int x,int k){
	dat[k] = max(dat[k],x);
	if(rrange[k] - lrange[k] == 1) return;
	if(lind[k] == -1) create(k);
	if(lrange[lind[k]] <= i && i < rrange[lind[k]]) update(i,x,lind[k]);
	else update(i,x,rind[k]);
}
 
int get(int a,int b,int k){
	if(b <= lrange[k] || rrange[k] <= a) return 0;
	if(a <= lrange[k] && rrange[k] <= b) return dat[k];
	if(lind[k] == -1) create(k);
	return max(get(a,b,lind[k]),get(a,b,rind[k]));
}
 
 
signed main(){
	int x1,y1,x2,y2,n,ope = -1;
	P coor[200000];
	cin >> x1 >> y1 >> x2 >> y2 >> n; x1++;y1++;x2++;y2++;
	if(y1 > y2){
		swap(x1,x2);
		swap(y1,y2);
	}
	if(x1 > x2) ope = 1;
	lrange[0] = 0;
	rrange[0] = siz;
	for(int i = 0;i < NODES;i++){
		lind[i] = -1;
		rind[i] = -1;
	}
	for(int i = 0;i < n;i++){
		int x,y;
		cin >> x >> y;x++;y++;
		coor[i] = P(ope * x,-y);
		if(x1 == x2 && (y - y1) * (y2 - y) > 0){
			printf("%.15Lf\n",(double)abs(y2 - y1) * 100.0 + PI * 10.0 - 20.0);
			return 0;
		}
		if(y1 == y2 && (x - x1) * (x2 - x) > 0){
			printf("%.15Lf\n",(double)abs(x2 - x1) * 100.0 + PI * 10.0 - 20.0);
			return 0;
		}
	}
	if(x1 == x2){
		printf("%.15Lf\n",(double)abs(y2 - y1) * 100.0);
		return 0;
	}
	if(y1 == y2 && (x - x1) * (x2 - x) > 0){
		printf("%.15Lf\n",(double)abs(x2 - x1) * 100.0);
		return 0;
	}
	sort(coor,coor + n);
	for(int i = 0;i < n;i++){
		P p = coor[i];
		int x = ope * p.first,y = -p.second;
		if(y < y1 || y > y2) continue;
		if(ope == -1 && (x < x1 || x > x2)) continue;
		if(ope == 1 && (x > x1 || x < x2)) continue;
		int prev = get(0,y - 1,0);
		update(y,prev + 1,0);
	}
	printf("%.15Lf\n",(double)(abs(x2 - x1) + y2 - y1) * 100.0 + (double)dat[0] * (PI * 5.0 - 20.0));
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:90:25: error: 'x' was not declared in this scope
   90 |         if(y1 == y2 && (x - x1) * (x2 - x) > 0){
      |                         ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
#include <iostream>
#include <queue>
#include <unordered_map>
using namespace std;
typedef long long ll;
const int maxn = 200005;
const double PI = acos(-1);

int n;
int x[maxn],y[maxn];
unordered_map<int,int>mpx,mpy;

int b[maxn];
int cal(vector<int>& a) {
  if(a.size()==0)return 0;
  n = a.size();
  int len = 1; b[0] = a[0];
  for (int i = 1; i < n; i++) {
    b[a[i] > b[len - 1] ? len++ : lower_bound(b, b + len, a[i]) - b] = a[i];
  }
  return len;
}

int main() {
#ifdef suiyuan2009
  freopen("in.cpp","r",stdin);
#endif // suiyuan2009
  int x1,y1,x2,y2;
  cin>>x1>>y1>>x2>>y2;
  cin>>n;
  for(int i=0; i<n; i++) {
    cin>>x[i]>>y[i];
    mpx[x[i]]=y[i];
    mpy[y[i]]=x[i];
  }
  double ret=0,R=10.0;
  if(x1==x2) {
    int ty1=y1,ty2=y2;
    if(ty1>ty2)swap(ty1,ty2);
    if(mpx.find(x1)!=mpx.end()) {
      int tmp=mpx[x1];
      if(ty1<=tmp&&tmp<=ty2) {
        ret=(ty2-ty1)*100.0-2*R+PI*R;
      } else {
        ret=(ty2-ty1)*100.0;
      }
    } else {
      ret=(ty2-ty1)*100.0;
    }
  } else if(y1==y2) {
    int tx1=x1,tx2=x2;
    if(tx1>tx2)swap(tx1,tx2);
    if(mpy.find(y1)!=mpy.end()) {
      int tmp=mpy[y1];
      if(tx1<=tmp&&tmp<=tx2) {
        ret=(tx2-tx1)*100.0-2*R+PI*R;
      } else {
        ret=(tx2-tx1)*100.0;
      }
    } else {
      ret=(tx2-tx1)*100.0;
    }
  } else {
    if(x1>x2){
      swap(x1,x2);
      swap(y1,y2);
    }
    vector<pair<int,int>>vec;
    for(int i=0;i<n;i++){
      if(x[i]<=x2&&x[i]>=x1&&y[i]<=max(y1,y2)&&y[i]>=min(y1,y2))vec.push_back(make_pair(x[i],y[i]));
    }
    sort(vec.begin(),vec.end());
    vector<int>vec2;
    for(int i=0;i<vec.size();i++){
      vec2.push_back(vec[i].second);
    }
    if(y1>y2)reverse(vec2.begin(),vec2.end());
    int mx = cal(vec2);
    ret=abs(x2-x1)*100.0+abs(y2-y1)*100.0;
    ret=ret-mx*2*R+mx*R*PI/2;
  }
  printf("%.15f",ret);
  return 0;
}



Compiler output:
a.cc:12:19: error: 'acos' was not declared in this scope
   12 | const double PI = acos(-1);
      |                   ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<functional>
#include<vector>
#include<map>
#include<string>
#include<set>
#include<string.h>
#include<unordered_set>
#include<unordered_map>
#define double long double
#define P pair<int,int>
#define int long long
using namespace std;

P S, G;
P k[200000];
vector<int>V;
int dp[200001];
signed main(){
	bool T = false;
	cin >> S.first >> S.second;
	cin >> G.first >> G.second;
	if (abs(S.first - G.first) <= 1) { 
	T = true;
	swap(S.first, S.second);
	swap(G.first, G.second);
	}
	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> k[i].first >> k[i].second;
		if (T)swap(k[i].first, k[i].second);
	}
	if (S.first > G.first)swap(S, G);
	sort(k, k + n);
	double M = 0;
	if (S.second == G.second) {
		for (int i = 0; i < n; i++) {
			if (k[i].second == S.second&&k[i].first >= S.first&&k[i].second <= G.first) {
				M += 20 * 3.141592653589793238462*0.5 - 20;
			}
		}
	}
	for (int i = 0; i < n; i++) {
		if (G.first > k[i].first&&S.first < k[i].first&&max(S.first,G.first) >= k[i].second&&min(S.first, G.first) <= k[i].second) {
			V.push_back(k[i].second);
		}
	}
	memset(dp, 0x3f, sizeof(dp));
	dp[0] = 0;
	for (int i = 0; i < V.size(); i++) {
		*lower_bound(dp, dp + n, V[i]) = V[i];
	}
	int i = 0;
	for (i = V.size(); i >= 0; i--) {
		if (dp[i] <= 100000000000ll)break;
	}
	printf("%.50lf\n", (G.first - S.first + abs(G.second - S.second)) * 100 - (20 - double(20)*3.141592653589793238462*0.25)*i+M);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected primary-expression before 'long'
   12 | #define double long double
      |                ^~~~
a.cc:59:89: note: in expansion of macro 'double'
   59 |         printf("%.50lf\n", (G.first - S.first + abs(G.second - S.second)) * 100 - (20 - double(20)*3.141592653589793238462*0.25)*i+M);
      |                                                                                         ^~~~~~
a.cc:59:88: error: expected ')' before 'long'
   59 |         printf("%.50lf\n", (G.first - S.first + abs(G.second - S.second)) * 100 - (20 - double(20)*3.141592653589793238462*0.25)*i+M);
      |                                                                                   ~    ^
      |                                                                                        )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int lis(const vector<int>& xs)
{
    set<int> s;
    for (const int x : xs)
    {
        s.insert(x);
        const auto it = s.upper_bound(x);
        if (it != s.end())
            s.erase(it);
    }
    return int(s.size());
}

int main()
{
    cout << setprecision(15) << fixed;

    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;

    if (x1 > x2)
    {
        swap(x1, x2);
        swap(y1, y2);
    }

    const bool flipped = y1 > y2;
    if (flipped)
        y1 = -y1, y2 = -y2;

    const double path_length = 100.0*((x2-x1) + (y2-y1));

    int N;
    cin >> N;

    struct Point { int x, y; };
    vector<Point> points;
    for (int i = 0; i < N; i++)
    {
        int X, Y;
        cin >> X >> Y;

        if (flipped) Y = -Y;

        if (x1 <= X && X <= x2 && y1 <= Y && Y <= y2)
            points.push_back({X, Y});
    }

    if (x1 == x2 || y1 == y2)
    {
        assert(points.size() <= 1);
        const double extra = 2*(20*atan(1) - 10);
        cout << + path_length + (points.size() == 1) * extra << endl;
        exit(0);
    }

    const auto compare = [](const Point a, const Point b)
    {
        assert(a.x != b.x);
        return a.x < b.x;
    };
    sort(begin(points), end(points), compare);

    vector<int> ys;
    for (const Point p : points)
        ys.push_back(p.y);
    const int fountains_reached = lis(ys);

    if (fountains_reached == min(x2-x1+1, y2-y1+1))
        fountains_reached--;

    const double savings = 20 - 20*atan(1);
    cout << path_length - fountains_reached*savings << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:73:9: error: decrement of read-only variable 'fountains_reached'
   73 |         fountains_reached--;
      |         ^~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

#define F first
#define S second
#define x1 privet1
#define x2 privet2
#define y1 privet3
#define y2 privet4
#define left privet6
#define prev ppppp

using namespace std;
typedef long long ll;

const int max_n = 200011, log_n = 32, max_m = 111, mod = 1000000007, inf = 1000111222;
const double M_PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286;

vector<pair<int, int> > p;
int n, x, y, x1, y1, dp[max_n];

bool is_in(int x, int y, int x1, int y1, int x2, int y2) {
    return x >= x1 && x <= x2 && y >= y1 && y <= y2;
}

int gcnt() {
    for (int i = 0; i < p.size(); ++i) {
        dp[i] = 1;
        swap(p[i].F, p[i].S);
    }
    set<pair<pair<int, int>, int> > s;
    for (int i = 0; i < p.size(); ++i) {
        //cout << p[i].F << " " << p[i].S << endl;
        int mxres = 0;
        set<pair<pair<int, int>, int> >::iterator it = s.lower_bound(make_pair(p[i], 0));
        set<pair<pair<int, int>, int> >::iterator it1 = it;
        if (s.size() != 0 && it1 != s.begin()) {
            --it1;
            while (true) {
                mxres = max(mxres, it1->S);
                //cout << it1->S << " " << mxres << endl;
                if (it1 == s.begin()) break;
                --it1;
            }
        }
        //cout << (it == s.begin()) << endl;
        s.erase(s.begin(), it);
        s.insert(make_pair(p[i], mxres + 1));
        //cout << s.size() << endl;
    }
    int ans = 0;
    for (set<pair<pair<int, int>, int> >::iterator it = s.begin(); it != s.end(); ++it) {
        ans = max(ans, it->S);
    }
    return ans;
}

int main() {
    //freopen("input.txt", "r", stdin);
    cin >> x >> y >> x1 >> y1 >> n;
    if (x > x1) swap(x, x1);
    if (y > y1) swap(y, y1);
    for (int i = 0; i < n; ++i) {
        int f, g;
        cin >> f >> g;
        if (is_in(f, g, x, y, x1, y1)) {
            p.push_back(make_pair(f, g));
        }
    }
    sort(p.begin(), p.end());
    int cnt = gcnt();
    //cout << cnt << endl;
    double ans = 100 * (x1 - x + y1 - y) - cnt * (x == x1 || y == y1 ? (20 - 2.0 * M_PI * 5) : (20 - 1.0 * M_PI * 5));
    printf("%.14f\n", ans);
    return 0;
}


Compiler output:
In file included from /usr/include/c++/14/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114,
                 from a.cc:1:
a.cc:16:14: error: expected unqualified-id before numeric constant
   16 | const double M_PI = 3.141592653589793238462643383279502884197169399375105820974944592307816406286;
      |              ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <iomanip>

typedef long double ldouble;

using namespace std;

const int MAX_VERTEX = 1 << 18;

struct fountain {
  int x, y;

  fountain () {}

  fountain (int _x, int _y) {
    x = _x;
    y = _y;
  }
};

bool ltr (fountain p, fountain q) {
  return p.x < q.x;
}

bool rtl (fountain p, fountain q) {
  return p.x > q.x;
}

class fenwick {
  int *tree;

public:
  fenwick () {
    tree = new int [MAX_VERTEX];

    for (int i = 0; i < MAX_VERTEX; i++) {
      tree[i] = 0;
    }
  }

  void set (int index, int val) {
    for (int i = index; i < MAX_VERTEX; i += i & -i) {
      tree[i] = min(tree[i], val);
    }
  }

  int get (int index) {
    int ans = 0;
    for (int i = index; i != 0; i -= i & -i) {
      ans = min(ans, tree[i]);
    }

    return ans;
  }
};

bool between (int left, int right, int x) {
  return (min(left, right) <= x) && (x <= max(left, right));
}
  
int main () {
  int startx, starty, endx, endy;
  cin >> startx >> starty >> endx >> endy;

  if (starty > endy) {
    swap(startx, endx);
    swap(starty, endy);
  }

  vector<fountain> fountains;
  map<int, int> cmpr;

  int fountainc;
  cin >> fountainc;
  for (int i = 0; i < fountainc; i++) {
    int x, y;
    cin >> x >> y;

    if (between(startx, endx, x) &&
        between(starty, endy, y)) {
      cmpr[y] = 0;
      fountains.push_back(fountain(x, y));
    }
  }

  if (startx == endx || starty == endy) {
    int turnc = fountains.size();

    ldouble ans = abs(startx - endx) * 100.0L +
      abs(starty - endy) * 100.0L +
      turnc * (10 * M_PI - 20);

    cout << fixed << setprecision(12) << ans << endl;
    return 0;
  }

  
  int cur = 1;
  for (auto i = cmpr.begin(); i != cmpr.end(); i++) {
    i->second = cur;
    cur++;
  }

  if (startx < endx) {
    sort(fountains.begin(), fountains.end(), ltr);
  } else {
    sort(fountains.begin(), fountains.end(), rtl);
  }

  fenwick dp;
  for (int i = 0; i < (int) fountains.size(); i++) {
    dp.set(cmpr[fountains[i].y], dp.get(cmpr[fountains[i].y]) - 1);
  }

  int turnc = dp.get(MAX_VERTEX - 1);
  ldouble ans = abs(startx - endx) * 100.0L +
    abs(starty - endy) * 100.0L +
    turnc * (20 - 5 * M_PI);

  cout << fixed << setprecision(12) << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:94:21: error: 'M_PI' was not declared in this scope
   94 |       turnc * (10 * M_PI - 20);
      |                     ^~~~
a.cc:121:23: error: 'M_PI' was not declared in this scope
  121 |     turnc * (20 - 5 * M_PI);
      |                       ^~~~