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

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int MAXN=200005;

int N,M,x1,y1,x2,y2;
pair<int,int> P[MAXN];
int dp[MAXN];

int main()
{
	scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&N);
	for(int i=1;i<=N;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		if(min(x1,x2)<=x&&x<=max(x1,x2)&&min(y1,y2)<=y&&y<=max(y1,y2))
			P[++M]=make_pair(x,y);
	}
	if(x1>x2)
	{
		swap(x1,x2);
		swap(y1,y2);
	}
	if(y1>y2)
	{
		for(int i=1;i<=M;i++)
			P[i].second=y2+y1-P[i].second;
		swap(y1,y2);
	}
	
	sort(P+1,P+M+1);
	memset(dp,0x3F,sizeof dp);
	dp[0]=0;
	int lis=0;
	for(int i=1;i<=M;i++)
	{
		int j=upper_bound(dp,dp+i,i)-dp;
		dp[j]=min(dp[j],P[i].second);
		lis=max(lis,j);
	}
	double ans=0;
	ans=100*(x2-x1+y2-y1)-20.0*lis+5.0*lis*acos(-1);
	if(lis==min(y2-y1+1,x2-x1+1))
		ans+=5.0*acos(-1);
	printf("%.11f\n",ans);
	
	return 0;
}


Compiler output:
a.cc:7:12: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
    7 | int N,M,x1,y1,x2,y2;
      |            ^~
a.cc: In function 'int main()':
a.cc:44:48: error: 'acos' was not declared in this scope
   44 |         ans=100*(x2-x1+y2-y1)-20.0*lis+5.0*lis*acos(-1);
      |                                                ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstdlib>
#define LL long long
#define LD long double
using namespace std;
const int NN=200000 +117;
const int MM= +117;
int read(){
	int fl=1,x;char c;
	for(c=getchar();(c<'0'||c>'9')&&c!='-';c=getchar());
	if(c=='-'){fl=-1;c=getchar();}
	for(x=0;c>='0'&&c<='9';c=getchar())
		x=(x<<3)+(x<<1)+c-'0';
	return x*fl;
}
void open(){
	freopen("019c.in","r",stdin);
	//freopen(".out","w",stdout);
}
void close(){
	fclose(stdin);
	fclose(stdout);
}


int m,n;
struct node{
	int x,y;
	void get(){
		x=read();
		y=read();
	}
}st,fin,a[NN];
int l,r,u,d;
int dp[NN]={};
bool cmp(node a,node b){
	return a.x<b.x;
}
int main(){
	//open();
	st.get();
	fin.get();
	n=read();
	l=min(st.x,fin.x);
	r=max(st.x,fin.x);
	u=max(st.y,fin.y);
	d=min(st.y,fin.y);
	int cnt=0;
	LD res=100ll*(abs(st.y-fin.y)+abs(st.x-fin.x));
	LD hu=acos((LD)-1)*5;
	for(int i=1;i<=n;++i){
		node tp;
		tp.get();
		if(l<=tp.x&&tp.x<=r&&d<=tp.y&&tp.y<=u){
			a[++cnt]=tp;
		}
	}

	if(cnt==min(abs(l-r),abs(u-d)+1){
		if(cnt){
			printf("%.13Lf\n",res-20+hu*2);
		}
		else{
			printf("%.13Lf\n",res);
		}
		return 0;
	}
	if(st.x>fin.x)swap(st,fin);
	if(st.y>fin.y){
		for(int i=1;i<=cnt;++i){
			a[i].y=-a[i].y;		
		}
	}
	sort(a+1,a+1+cnt,cmp);
	memset(dp,127,sizeof dp);
	dp[0]=-1000000000;
	for(int i=1;i<=cnt;++i){
		int pos=upper_bound(dp,dp+cnt+1,a[i].y)-dp;
		dp[pos]=a[i].y;
	}
	for(int i=cnt;i>=1;--i){
		if(dp[i]<1000000000){
			res+=(hu-20)*i;
			break;
		}
	}
	printf("%.13Lf\n",res);

	close();
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:65:41: error: expected ';' before '{' token
   65 |         if(cnt==min(abs(l-r),abs(u-d)+1){
      |                                         ^
      |                                         ;
a.cc:74:9: error: expected primary-expression before 'if'
   74 |         if(st.x>fin.x)swap(st,fin);
      |         ^~
a.cc:73:10: error: expected ')' before 'if'
   73 |         }
      |          ^
      |          )
   74 |         if(st.x>fin.x)swap(st,fin);
      |         ~~
a.cc:65:11: note: to match this '('
   65 |         if(cnt==min(abs(l-r),abs(u-d)+1){
      |           ^
Language: C++

#include<bits/stdc++.h>
#define double long double
using namespace std;
const int N=200005;
struct node{
	int x,y;
	bool operator <(const node &a)const{
		return x<a.x;
	}
}a[N];
int q[N],t;
int sx,sy,tx,ty;
int find(int k){
	int l=1,r=t+1;
	while (l<r){
		int mid=(l+r)/2;
		if (k<q[mid]) r=mid;
		else l=mid+1;
	}
	return l;
}
void add(int k){
	int x=find(k);
	q[x]=k; t=max(t,x);
}
int main(){
	scanf("%d%d%d%d",&sx,&sy,&tx,&ty);
	if (sx>tx) swap(sx,tx),swap(sy,ty);
	int num,n=0; scanf("%d",&num);
	while (num--){
		int x,y;
		scanf("%d%d",&x,&y);
		if (x>=sx&&x<=tx) a[++n]=(node){x,y};
	}
	sort(a+1,a+n+1);
	if (sy<ty){
		for (int i=1;i<=n;i++)
			if (a[i].y>=sy) add(a[i].y);
	}
	else{
		swap(sy,ty);
		for (int i=n;i;i--)
			if (a[i].y>=sy) add(a[i].y);
	}
	int k=find(ty)-1;
	int v=k>=min(tx-sx,ty-sy)+1);
	double pi=acos(-1);
	printf("%.15Lf\n",(tx+ty-sx-sy)*100.0+k*(5.0*pi-20.0)+v*5.0*pi);
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:46:36: error: expected ',' or ';' before ')' token
   46 |         int v=k>=min(tx-sx,ty-sy)+1);
      |                                    ^
Language: C++

#include<cstdio>
#include<algorithm>
#define pi 3.14159265358979343846
using namespace std;
struct N{
	int x,y;
}s,t,f[200005];
int n,start,endd,opt[200005],k,opt_n,flag;
double ans;
bool comp(N a,N b){return a.x<b.y;}
int search(int h){
    int l=1,mid,r=opt_n;
    while(l<=r){
        mid=(l+r)/2;
        if(opt[mid]>=h)
            if(mid+1<=r&&opt[mid+1]>=h) l=mid+1;
            else return(mid);
        else r=mid-1; 
    }
    return r;
}
int main(){
	scanf("%d%d%d%d",&s.x,&s.y,&t.x,&t.y);
	scanf("%d",&n);
	for(int i=1;i<=n;++i) scanf("%d%d",&f[i].x,&f[i].y);
	sort(f+1,f+n+1,comp);
	//for(int i=1;i<=n;++i) printf("%d %d\n",f[i].x,f[i].y);
	if(s.x>t.x){
		int temp=s.x;
		s.x=t.x;
		t.x=temp;
	}
	if(t.y>s.y) flag=-1;
	else flag=1;
	for(int i=1;i<=n;++i){
		if(f[i].x>s.x&&(i-1<1||f[i-1].x<=s.x)&&flag*s.y>=flag*f[i].y&&flag*t.y<=flag*f[i].y) start=i;
		if(f[i].x<t.x&&(i+1>n||f[i+1].x>=t.x)&&flag*s.y>=flag*f[i].y&&flag*t.y<=flag*f[i].y) endd=i;
	}
	if(start==0&&endd==0&&s.x!=t.x){
		printf("%.15lf",(double)100*(t.x-s.x)+100*(-flag*(t.y-s.y)));
		return 0;
	}
	
	opt[1]=flag*f[start].y; opt_n=1;
	//printf("%d\n",flag);
    for(int i=start+1;i<=endd;++i){
        int h=flag*f[i].y;
        if(flag*t.y-h>0) continue;
        if(h<opt[opt_n]) k=++opt_n;
        else k=search(h)+1;
        //printf("%d\n",k);
        opt[k]=h;
    }
	if(s.x==t.x){
		int cnt=0;
		for(int i=1;i<=n;++i)
			if(f[i].x==s.x)
				cnt++;
		printf("%.15lf",100*(-flag*t.y-s.y)-20*cnt+10*pi*cnt);
		return 0;
	}
	if(s.y==t.y){
		int cnt=0;
		for(int i=1;i<=n;++i)
			if(f[i].x>s.x&&f[i].x<t.x&&f[i].y==s.y)
				cnt++;
		printf("%.15lf",100*(t.x-s.x)-20*cnt+10*pi*cnt);
		return 0;
	}
    //printf("%d %d %d\n",start,end,opt_n);
    printf("%.15lf",100*(t.x-s.x)+100*(-flag*(t.y-s.y))-opt_n*20+opt_n*pi*5);
    */
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:6: error: expected primary-expression before '/' token
   72 |     */
      |      ^
a.cc:73:1: error: expected primary-expression before '}' token
   73 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define se second
#define fi first
#define pb push_back
const int N=2e5 + 5;
const long double arc=acos(-1) * 5;
vector<pair<int, int> > v;

void print(long double ans){
	cout << fixed << setprecision(12) << ans << endl;
	exit(0);
}

int lis(){
	vector<int> temp;
	for(int i=0,a;i < v.size();i++){
		a=v[i].se;
		if(!i || a > temp.back()){
			temp.pb(a);
			continue;
		}
		int l=upper_bound(temp.begin(),temp.end(),a) - temp.begin();
		temp[l]=a;
	}
	return temp.size();
}

int main(){

//	freopen("in.txt","r",stdin);

	int x1,y1,x2,y2,n;
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	bool f=0,c1=0;
	if(x1 > x2) swap(x1,x2), swap(y1,y2), f=1;
	scanf("%d",&n);
	for(int i=0,x,y;i < n;i++){
		scanf("%d%d",&x,&y);
		if(y >= min(y1,y2) && y <= max(y1,y2) && x >= min(x1,x2) && x <= max(x1,x2)) ;
		else continue;
		if(x1 == x2 && x1 == x){
			if(y > min(y1,y2) && y < max(y1,y2)) c1=1;
		}
		else if(y1 == y2 && y1 == y){
			if(x > min(x1,x2) && x < max(x1,x2)) c1=1;
		}
		else if(f) y=-y;
		v.pb({ x, y });
	}
	if(x1 == x2){f
		long double ans=abs(y1 - y2) * 100.0 - 20 + 2 * arc;
		print(ans);
	}
	if(y1 == y2){
		long double ans=abs(x1 - x2) * 100.0 - 20 + 2 * arc;
		print(ans);
	}
	sort(v.begin(),v.end());
	long double ans=-min(y1,y2) + max(y1,y2) - min(x1,x2) + max(x1,x2);
	ans*=100;
	ans-=(20 - arc) * lis();
	print(ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:23: error: expected ';' before 'long'
   52 |         if(x1 == x2){f
      |                       ^
      |                       ;
   53 |                 long double ans=abs(y1 - y2) * 100.0 - 20 + 2 * arc;
      |                 ~~~~   
a.cc:54:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |                 print(ans);
      |                       ^~~
      |                       abs
Language: C++

#include<bits/stdc++.h>
#define L long long
#define vi vector<int>
#define pb push_back
#define pi pair<int,int>
#define pii pair<pi,int>
#define aa first
#define bb second
#define xx aa.aa
#define yy aa.bb
#define zz bb
#define mp make_pair
#define mpp(a,b,c) mp(mp(a,b),c)
using namespace std;
const double r=acos(-1)*5;
int n,sx,sy,tx,ty,x,y,f[200010],b[200010],c[200010];
pi a[200010];
inline int maxx(int i)
{
	int k=0;
	for(;i;i^=i&-i)
	  k=max(k,f[i]);
	return k;
}
inline void mdf(int i,int k)
{
	for(;i<=n;i+=i&-i)
	  f[i]=max(f[i],k);
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int i,j,k,l;
	scanf("%d%d%d%d",&sx,&sy,&tx,&ty);
	if(sx>tx)
	  {
	   x=1;
	   sx*=-1;
	   tx*=-1;
	  }
	if(sy>ty)
	  {
	   y=1;
	   sy*=-1;
	   ty*=-1;
	  }
	scanf("%d",&n);
	for(i=1,l=0;i<=n;i++)
	  {
	   scanf("%d%d",&j,&k);
	   if(x)
	     j*=-1;
	   if(y)
	     k*=-1;
	   if(sx<=j && j<=tx && sy<=k && k<=ty)
	     {
	      a[++l]=mp(j,k);
	      b[l]=j;
	      c[l]=k;
		 }
	  }
	n=l;
	sort(b+1,b+n+1);
	sort(c+1,c+n+1);
	for(i=1;i<=n;i++)
	  {
	   a[i].aa=lower_bound(b+1,b+n+1,a[i].aa)-b;
	   a[i].bb=lower_bound(c+1,c+n+1,a[i].bb)-c;
	  }
	sort(a+1,a+n+1);
	if(sx==tx || sy==ty)
	  {
	   printf("%.15lf\n",(tx-sx+ty-sy)*100.0+(n?(2*r-20):0));
	   return 0;
	  }
	for(i=1;i<=n;i++)
	  {
	   k=maxx(a[i].bb);
	   mdf(a[i].bb,k+1);
	  }
	k=maxx(n);
	printf("%.15lf\n",(tx-sx+ty-sy)*100.0+k*(r-20)+(k==min(tx-sx+1,ty-sy+1)?0:10);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:83:86: error: expected ')' before ';' token
   83 |         printf("%.15lf\n",(tx-sx+ty-sy)*100.0+k*(r-20)+(k==min(tx-sx+1,ty-sy+1)?0:10);
      |               ~                                                                      ^
      |                                                                                      )
Language: C++

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>

using namespace std;

const double pi = acos(-1);

int n, X1, Y1, X2, Y2, X[200010], Y[200010], tmp[200010];

vector <int> V;

bool cmp(int x, int y) {
    return X[x] < X[y];
}

int main() {
    scanf("%d%d%d%d%d", &X1, &Y1, &X2, &Y2, &n);
    for(int i = 1; i <= n; i++) scanf("%d%d", &X[i], &Y[i]);
    for(int i = 1; i <= n; i++) tmp[i] = i;
    if(X1 > X2) {
        swap(X1, X2);
        swap(Y1, Y2);
    }
    sort(tmp + 1, tmp + n + 1, cmp);
    int l = 1, r = n;
    while(l != n + 1 && X[tmp[l]] < X1) l++;
    while(r != 0 && X[tmp[r]] > X2) r--;
    X[tmp[l - 1]] = X1;
    Y[tmp[l - 1]] = Y1;
    X[tmp[r + 1] = n + 1] = X2;
    Y[tmp[r + 1]] = Y2;
    if(Y1 > Y2) {
        for(int i = l - 1; i <= r + 1; i++) Y[tmp[i]] *= -1;
        Y1 = -Y1;
        Y2 = -Y2;
    }
    if(X1 == X2) {
        printf("%.13lf\n", (Y2 - Y1) * 100ll + (r == l && Y[r] <= Y2 && Y[r] >= Y1) * (pi * 10 - 20));
        return 0;åç
    }
    if(Y1 == Y2) {
        int flag = 0;
        for(int i = l; i <= r; i++) if(Y[tmp[i]] == Y1) flag = 1;
        printf("%.13lf\n", (X2 - X1) * 100ll + flag * (pi * 10 - 20));
        return 0;
    }
    Y[tmp[l - 1]]--;
    Y[tmp[r + 1]]++;
    for(int i = l - 1; i <= r + 1; i++) if(Y[tmp[i]] > Y[tmp[l - 1]] && Y[tmp[i]] < Y[tmp[r + 1]]){
        int w = lower_bound(V.begin(), V.end(), Y[tmp[i]]) - V.begin();
        if(w == V.size()) V.push_back(Y[tmp[i]]); else V[w] = Y[tmp[i]];
    }
    printf("%.13lf\n", (X2 - X1 + Y2 - Y1) * 100ll - V.size() * (20 - pi * 10 / 2));
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:18: error: '\U000000e5\U000000e7' was not declared in this scope
   42 |         return 0;åç
      |                  ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <cmath>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define FI first
#define SE second
#define MA(i,j) make_pair(i,j)
#define PA pair<int,int>
#define PB push_back
#define PQ priority_queue<int>
#define PGQ priority_queue<int,vector<int>,greater<int> >
#define VE vector<int>
#define VP vector<PA>
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define MOD 1000000007
#define INF 1000000007
#define PI 3.14159265358979323846264338
using namespace std;
//
int main(){
  long long nx,ny,gx,gy;
  int N;
  cin>>nx>>ny>>gx>>gy;
  if(nx>gx){
    swap(nx,gx);
  }
  if(ny>gy){
    swap(ny,gy);
  }
  cin>>N;
  vector<pair<long long,long long> > V;
  FOR(i,0,N){
    long long X,Y;
    cin>>X>>Y;
    if(nx<=X&&X<=gx&&ny<=Y&&Y<=gy){
      V.PB(MA(X,Y));
    }
  }
  if(V.empty()){
    printf("%.15f\n",(double)(gx-nx)*100+(gy-ny)*100);
    return 0;
  }
  sort(V.begin(),V.end());
  int DP[200000];
  int M=V.size();
  fill(DP,DP+M,INF);
  FOR(i,0,M){
    *lower_bound(DP,DP+M,V[i].SE)=V[i].SE;
  }
  int res=lower_bound(DP,DP+M,INF)-DP;
  if(nx==gx||ny==gy){
    printf("%.15f\n",res*PI*20/2+(max(gx-nx,gy-ny)-res*2)*100+res*2*90);
  }else{
    printf("%.15f\n",cnt*PI*20/2+cnt*2*90+res*PI*20/4+(gx-nx-res)*100+(gy-ny-res)*100+res*2*90);
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:61:22: error: 'cnt' was not declared in this scope; did you mean 'int'?
   61 |     printf("%.15f\n",cnt*PI*20/2+cnt*2*90+res*PI*20/4+(gx-nx-res)*100+(gy-ny-res)*100+res*2*90);
      |                      ^~~
      |                      int
Language: C++

#include<bits/stdc++.h>
#define N 200005
#define pii pair<int,int>
using namespace std;
#define low(x) ((x)&(-(x)))
int bits[N];
void modify(int x,int val){
    for(;x<N;x+=low(x)) bits[x]=max(bits[x],val);
}
int query(int x){
    int ret=0;
    for(;x!=0;x-=low(x)) ret=max(ret,bits[x]);
    return ret;
}
vector<pii> p;
vector<int> val;
int x1,y1,x2,y2,n,fx,fy;
int main(){
    scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&n);
    fx = x1<x2? 1:-1;x1*=fx,x2*=fx;
    fy = y1<y2? 1:-1;y1*=fy,y2*=fy;
    for(int i=1,x,y;i<=n;i++) {
        scanf("%d%d",&x,&y);x*=fx,y*=fy;
        if(x1<=x&&x<=x2&&y1<=y&&y<=y2)
            p.push_back(make_pair(x,y)),
            val.push_back(x),val.push_back(y);
    }
    sort(val.begin(),val.end());
    val.erase(unique(val.begin(),val.end()),val.end());
    for(pii &x:p)
        x.second=lower_bound(val.begin(),val.end(),x.second)-val.begin()+1;
    sort(p.begin(),p.end());
    int len=0;
    for(pii x:p){
        int v=query(x.second)+1;
        len=max(len,v);
        modify(x.second,v);
    }
    long double pi5=5*acos((long double)-1);
    int num=len+(len==min(x2-x1,y2-y1)+1? 1:0);
    double ans=(x2-x1+y2-y1)*100-20*len+pi5*num;
    printf("%.15lf\n",ans);
    return 0;
}

Compiler output:
a.cc:17:8: error: 'int y1' redeclared as different kind of entity
   17 | int x1,y1,x2,y2,n,fx,fy;
      |        ^~
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:12: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   21 |     fy = y1<y2? 1:-1;y1*=fy,y2*=fy;
      |          ~~^~~
a.cc:21:24: error: invalid operands of types 'double(double) noexcept' and 'int' to binary 'operator*'
   21 |     fy = y1<y2? 1:-1;y1*=fy,y2*=fy;
      |                      ~~^~~~
a.cc:21:24: note:   in evaluation of 'operator*=(double(double) noexcept, int)'
a.cc:24:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |         if(x1<=x&&x<=x2&&y1<=y&&y<=y2)
      |                          ~~^~~
a.cc:40:35: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   40 |     int num=len+(len==min(x2-x1,y2-y1)+1? 1:0);
      |                                 ~~^~~
      |                                 |  |
      |                                 |  double(double) noexcept
      |                                 int
a.cc:41:25: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   41 |     double ans=(x2-x1+y2-y1)*100-20*len+pi5*num;
      |                 ~~~~~~~~^~~
      |                      |   |
      |                      int double(double) noexcept
Language: C++

#include <algorithm>
#include <vector>
#include <cstdio>
using namespace std;
 
int main(){
	int x1,y1,x2,y2,n,xf=1,yf=1,x,y;
	scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&n);
	if(x1>x2)swap(x1,x2),xf=-1;
	if(y1>y2)swap(y1,y2),yf=-1;
	vector<pair<int,int>>v;
	for(int i=0;i<n;i++){
		scanf("%d%d",&x,&y);
		if(x1<=x&&x<=x2 && y1<=y&&y<=y2)v.push_back(x*xf,y*yf);
	}
	sort(v.begin(),v.end());
	vector<int>d(v.size(),1<<30);
	for(auto &e:v)n=e.second,*lower_bound(d.begin(),d.end(),n)=n;
	n=lower_bound(d.begin(),d.end(),1<<30)-d.begin();
	printf("%.9f\n",100.0*(x2-x1+y2-y1)-20*n+5*(n+(n>=min(x2-x1,y2-y1)+1))*3.14159265359);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:60: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int, int)'
   14 |                 if(x1<=x&&x<=x2 && y1<=y&&y<=y2)v.push_back(x*xf,y*yf);
      |                                                 ~~~~~~~~~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
Language: C++

def abs(x):
	return x if x >= 0 else -x

def lower_bound(X, y):
	L, R = 0, len(X)
	while L < R:
		M = (L + R) >> 1
		if y > X[M]:
			L = M + 1
		else:
			R = M
	return L
			
	
ADJUST = 10**49
PI = 31415926535897932384626433832795028841971693993751
ax, ay, bx, by = list(map(int, input().split()))
a = (ax, ay)
b = (bx, by)
n = int(input())
p = [list(map(int, input().split())) for i in range(n)]
p.sort()
if a[0] > b[0]:
	a, b = b, a
ans = 100 * ADJUST * (abs(a[0] - b[0]) + abs(a[1] - b[1]))
mx = min(a[0], b[0])
Mx = max(a[0], b[0])
my = min(a[1], b[1])
My = max(a[1], b[1])
if a[0] == b[0]:
	for point in p:
		if point[0] == a[0]:
			if my < point[1] and point[1] < My:
				ans += 10*PI - 20*ADJUST
elif a[1] == b[1]:
	for point in p:
		if point[1] == a[1]:
			if mx < point[0] and point[0] < Mx:
				ans += 10*PI - 20*ADJUST
else:
	lis = []
	for point in p:
		if point[0] < mx or point[0] > Mx or point[1] < my or point[1] > My:
			continue
		y = abs(point[1] - a[1])
		lb = lower_bound(lis, y)
		if lb == len(lis):
			lis.append(y)
		else:
			lis[lb] = y
	size = len(lis)
	ans += size * (5*PI - 20*ADJUST)

print('%d.%049d' % (ans//ADJUST, ans%ADJUST))

Compiler output:
a.cc:16:6: warning: integer constant is too large for its type
   16 | PI = 31415926535897932384626433832795028841971693993751
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:54:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   54 | print('%d.%049d' % (ans//ADJUST, ans%ADJUST))
      |       ^~~~~~~~~~
a.cc:1:1: error: 'def' does not name a type
    1 | def abs(x):
      | ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>

int main()
{
	int x1, y1, x2, y2;
	std::cin >> x1 >> y1 >> x2 >> y2;
	
	int n;
	std::pair<int, int> point[100010];
	std::cin >> n;
	
	for (int i = 0; i < n; ++i)
		std::cin >> point[i].first >> point[i].second;
	
	if (x1 > x2)
	{
		x1 = 100000000 - x1;
		x2 = 100000000 - x2;
		for (int i = 0; i < n; ++i)
			point[i].first = 100000000 - point[i].first;
	}
	if (y1 > y2)
	{
		y1 = 100000000 - y1;
		y2 = 100000000 - y2;
		for (int i = 0; i < n; ++i)
			point[i].second = 100000000 - point[i].second;
	}
	
	std::vector< std::pair<int, int> > points;
	for (int i = 0; i < n; ++i)
	{
		if (point[i].first >= x1 && point[i].first <= x2 && point[i].second >= y1 && point[i].second <= y2)
			points.push_back(point[i]);
	}
	
	std::sort(points.begin(), points.end());
	
	int length = 0, dist[100010] = { 0 };
	long double pi = acos(-1);
	for (int i = 0; i < points.size(); ++i)
	{
		int value = points[i].second;
		int temp = std::lower_bound(dist, dist + length, value) - dist;
		if (temp == length)
			++length;
		
		dist[temp] = points[i].second;
	}
	
	long double ans = 100.0 * (x2 - x1 + y2 - y1);
	ans += (5 * pi - 20) * length;
	
	if (length == std::min(x2 - x1, y2 - y1) + 1)
		ans += 5 * pi;
	
	std::cout << std::fixed << std::setprecision(18) << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: 'vector' is not a member of 'std'
   32 |         std::vector< std::pair<int, int> > points;
      |              ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <iomanip>
  +++ |+#include <vector>
    4 | 
a.cc:32:42: error: expected primary-expression before '>' token
   32 |         std::vector< std::pair<int, int> > points;
      |                                          ^
a.cc:32:44: error: 'points' was not declared in this scope; did you mean 'point'?
   32 |         std::vector< std::pair<int, int> > points;
      |                                            ^~~~~~
      |                                            point
a.cc:42:26: error: 'acos' was not declared in this scope
   42 |         long double pi = acos(-1);
      |                          ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>

int main()
{
	int x1, y1, x2, y2;
	std::cin >> x1 >> y1 >> x2 >> y2;
	
	int n;
	std::pair<int, int> point[100010];
	std::cin >> n;
	
	for (int i = 0; i < n; ++i)
		std::cin >> point[i].first >> point[i].second;
	
	if (x1 > x2)
	{
		x1 = 100000000 - x1;
		x2 = 100000000 - x2;
		for (int i = 0; i < n; ++i)
			point[i].first = 100000000 - point[i].first;
	}
	if (y1 > y2)
	{
		y1 = 100000000 - y1;
		y2 = 100000000 - y2;
		for (int i = 0; i < n; ++i)
			point[i].second = 100000000 - point[i].second;
	}
	
	std::vector< std::pair<int, int> > points;
	for (int i = 0; i < n; ++i)
	{
		if (point[i].first >= x1 && point[i].first <= x2 && point[i].second >= y1 && point[i].second <= y2)
			points.push_back(point[i]);
	}
	
	std::sort(points.begin(), points.end());
	
	int length = 0, dist[100010] = { 0 };
	long double pi = 3.141592653589793238462643383;
	for (int i = 0; i < points.size(); ++i)
	{
		int value = points[i].second;
		int temp = std::lower_bound(dist, dist + length, value) - dist;
		if (temp == length)
			++length;
		
		dist[temp] = points[i].second;
	}
	
	long double ans = 100 * (x2 - x1 + y2 - y1);
	ans += (5 * pi - 20) * length;
	
	if (length == std::min(x2 - x1, y2 - y1) + 1)
		ans += 5 * pi;
	
	std::cout << std::fixed << std::setprecision(18) << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: 'vector' is not a member of 'std'
   32 |         std::vector< std::pair<int, int> > points;
      |              ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <iomanip>
  +++ |+#include <vector>
    4 | 
a.cc:32:42: error: expected primary-expression before '>' token
   32 |         std::vector< std::pair<int, int> > points;
      |                                          ^
a.cc:32:44: error: 'points' was not declared in this scope; did you mean 'point'?
   32 |         std::vector< std::pair<int, int> > points;
      |                                            ^~~~~~
      |                                            point
Language: C++

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

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

    if(x2<x1){
        x2=-x2;
        x1=-x1;
    }
    if(y2<y1){
        y2=-y2;
        y1=-y1;
    }
    vector<int> px,py;
    for(int i=0;i<n;i++){
        if(x1<=x[i] && x[i]<=x2 && y1<=y[i] && y[i]<=y2){
            px.push_back(x[i]);
            py.push_back(y[i]);
        }
    }
    
    int s=p.size();
    vector<pair<int,int>> pxy(s);

    for(int i=0;i<s;i++){
        pxy[i]={x[i],y[i]};
    }
    sort(pxy.begin(),pxy.end());
    const int INF=1e9;
    vector<int> dp(s+1,INF);
    int cnt=0;
    dp[0]=-INF;
    for(int i=0;i<n;i++){
        int val=xy[i].second;
        auto it=lower_bound(dp.begin(),dp.end(),val);
        *it=val;
        cnt=max(cnt,int(it-dp.begin()));
    }
    const long double PI=acos(-1);
    long double cut=20-PI*5;
    long double dis=PI*10-20;
    int ccnt=cnt;
    int dcnt=0;
    if(cnt==min(x2-x1,y2-y1)+1){
        ccnt--;
        dcnt++;
    }
    long double res=100*(x2-x1+y2-y1)-ccnt*cut+dcnt*dis;
    cout<<setprecision(12)<<fixed;
    cout<<res<<endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:11: error: 'p' was not declared in this scope
   33 |     int s=p.size();
      |           ^
a.cc:45:17: error: 'xy' was not declared in this scope; did you mean 'pxy'?
   45 |         int val=xy[i].second;
      |                 ^~
      |                 pxy
Language: C++

#include<bits/stdc++.h>
using namespace std;
struct pos
{
	int x,y;
	bool operator<(pos w)const{return x<w.x;}
}pos[200007];
vector<int> ans;
int main()
{
	int x1,y1,x2,y2,x,y,n,xs=1,ys=1,pp=0;
	scanf("%d%d",&x1,&y1);
	scanf("%d%d",&x2,&y2);
	if(x1>x2)xs=-1,x1*=-1,x2*=-1;
	if(y1>y2)ys=-1,y1*=-1,y2*=-1;
	scanf("%d",&n);
	for(int i=0;i<n;++i)
	{
		scanf("%d%d",&x,&y);
		x*=xs,y*=ys;
		if(x<x1||x2<x||y<y1||y2<y)continue;
		pos[pp++]=(pos){x,y};
	}
	sort(pos,pos+pp);
	for(int i=0;i<pp;++i){
		int v=pos[i].y;
		if(!ans.size()||v>ans[ans.size()-1])ans.push_back(v);
		else *std::lower_bound(ans.begin(),ans.end(),v)=v;
	}
	double val=0;
	if(std::min(y2-y1,x2-x1)+1==ans.size()){
		val+=10*acos(-1)-20;
		ans.pop_back();
	}
	val+=(y2-y1+x2-x1)*100.-(20-acos(-1)*5)*ans.size();
	printf("%.15f",val);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:31: error: no match for 'operator=' (operand types are 'pos' and 'pos [200007]')
   22 |                 pos[pp++]=(pos){x,y};
      |                               ^
a.cc:3:8: note: candidate: 'constexpr pos& pos::operator=(const pos&)'
    3 | struct pos
      |        ^~~
a.cc:3:8: note:   no known conversion for argument 1 from 'pos [200007]' to 'const pos&'
a.cc:3:8: note: candidate: 'constexpr pos& pos::operator=(pos&&)'
a.cc:3:8: note:   no known conversion for argument 1 from 'pos [200007]' to 'pos&&'
Language: C++

#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

const int N = 200005;

inline void read( int &res )
{
	static char ch = getchar(); res = 0;
	while(ch < '0' || ch > '9') ch = getchar();
	while(ch >= '0' && ch <= '9') res = res * 10 + ch - 48, ch = getchar();
}

int xs, ys, xt, yt, n;

struct Node
{
	int x, y;
	Node(){	}
	Node( int x, int y ) : x(x), y(y) {	}
	inline bool operator < ( const Node &a ) const
	{
		return x < a.x;
	}
} fnd[N];

int sta[N], tp;

int main()
{
	double pai = acos(-1.0);
	double nin = 20.0 - 5.0 * pai, nan = 10.0 * pai - 20;
	double ans = 0;
/
	tp = 0;
	cin >> xs >> ys >> xt >> yt >> n;
	if(xs > xt) swap(xs, xt), swap(ys, yt);

	Node st = Node(xs, ys), ed = Node(xt, yt);
	for(int i = 1, x, y; i <= n; ++i)
		read(x), read(y), fnd[i] = Node(x, y);
	sort(fnd + 1, fnd + n + 1);
	int l = lower_bound(fnd + 1, fnd + n + 1, st) - fnd;
	int r = upper_bound(fnd + 1, fnd + n + 1, ed) - fnd - 1;
	if(ys == yt)
	{
		ans = fabs(xs - xt) * 100;
		for(int i = l; i <= r; ++i) 
			if(fnd[i].y == ys) ans += nan;
		printf( "%.15lf\n", ans );
		return 0;
	}
	else if(xs == xt)
	{
		if(ys > yt) swap(ys, yt);
		ans = fabs(ys - yt) * 100;
		for(int i = l; i <= r; ++i)
			if(fnd[i].y <=  yt && fnd[i].y >= ys) ans += nan;
		printf( "%.15lf\n", ans );
		return 0;
	}

	int mx = 0;
	if(ys <= yt)
		for(int i = l; i <= r; ++i)
		{
			if(fnd[i].y < ys || fnd[i].y > yt) continue;
			while(tp && fnd[sta[tp]].y > fnd[i].y) tp--;
			sta[++tp] = i;
			mx = max(mx, tp);
		}
	else
	{
		for(int i = r; i >= l; --i)
		{
			if(fnd[i].y > ys || fnd[i].y < yt) continue;
			while(tp && fnd[sta[tp]].y > fnd[i].y) tp--;
			sta[++tp] = i;
			mx = max(mx, tp);
		}
	}
	
	ans = 100.0 * (fabs(yt - ys) + fabs(xt - xs)) - mx * nin;
	printf( "%.15lf\n", ans );
	return 0;
}
/*
1 10 10 1 8
2 1
3 4
4 2
5 7
6 5
7 3
8 6
9 10
*/

Compiler output:
a.cc: In function 'int main()':
a.cc:37:1: error: expected primary-expression before '/' token
   37 | /
      | ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>

using namespace std;
struct miau{int x,y;} v[200005],p1,p2,aux,pmin,pmax;
int n,i,j,aint[400005],poz,st,dr,d[200005],k;
long long m,mini;
double sol;

bool cmp1(miau a, miau b)
{
    return a.x<b.x;
}

bool cmp2(miau a, miau b)
{
    return b.x<a.x;
}

void update(int nod, int l, int r)
{
    int mid=(l+r)/2;
    if(l==r)
    {
        aint[nod]=d[poz];
        return;
    }
    else
    {
        if(poz<=mid) update(2*nod,l,mid);
        else update(2*nod+1,mid+1,r);
        aint[nod]=max(aint[2*nod],aint[2*nod+1]);
    }
}

void query(int nod, int l, int r)
{
    int mid=(l+r)/2;
    if(l>=st && r<=dr) val=max(val,aint[nod]);
    else
    {
        if(dr<=mid) query(2*nod,l,mid);
        if(st>mid) query(2*nod+1,mid+1,r);
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin>>p1.x>>p1.y>>p2.x>>p2.y;
    cin>>n;
    m=0;
    if(p1.x>p2.x) swap(p1,p2);
    pmin.x=p1.x;
    pmax.x=p2.x;
    pmin.y=min(p1.y,p2.y);
    pmax.y=max(p1.y,p2.y);
    for(i=1;i<=n;i++)
    {
        cin>>aux.x>>aux.y;
        if(aux.x>=pmin.x && aux.x<=pmax.x && aux.y>=pmin.y && aux.y<=pmax.y) v[++m]=aux;
    }
    n=m;
    k=0;
    if(p1.y>p2.y) sort(v+1,v+n+1,cmp2);
    else sort(v+1,v+n+1,cmp1);
    for(i=1;i<=n;i++)
    {
        st=1; dr=v[i].y-1;
        val=0;
        query(1,1,n);
        d[i]=val+1;
        poz=v[i].y;
        update(1,1,n);
        k=max(k,d[i]);
    }
    m=(pmax.x-pmin.x)*100+(pmax.y-pmin.y)*100;
    mini=min(pmax.x-pmin.x,pmax.y-pmin.y);
    if(k<mini+1) sol=(double)m-(double)k*4.2920367320510338;
    else k--, sol=(double)m-(double)k*4.2920367320510338+11.415926535897938;
    cout<<fixed<<setprecision(13)<<sol<<'\n';
    return 0;
}


Compiler output:
a.cc: In function 'void query(int, int, int)':
a.cc:39:24: error: 'val' was not declared in this scope
   39 |     if(l>=st && r<=dr) val=max(val,aint[nod]);
      |                        ^~~
a.cc: In function 'int main()':
a.cc:70:9: error: 'val' was not declared in this scope
   70 |         val=0;
      |         ^~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
const double pi = acos(-1.0);
int n;

double ans=0;
struct node
{
   int x,y;
   bool operator<(const node &p)const
   {
      return (x==p.x)?y<p.y:x<p.x;
   }
}a[200200];
double c[200200];
int main()
{
   double x1,y1,x2,y2;
   cin>>x1>>y1>>x2>>y2;
   ans=(abs(x1-x2)+abs(y1-y2))*(100);
   double X1=min(x1,x2),X2=max(x1,x2),Y1=min(y1,y2),Y2=max(y1,y2);
   cin>>n;
   int length=0;
   F(i,1,n)
   {
      double x,y;
      cin>>x>>y;
      if((x>=X1)&&(x<=X2)&&(y>=Y1)&&(y<=Y2)) a[++length].x=x,a[length].y=y;
   }
   n=length;
   if(n==0)
   {
      printf("%.15f\n",ans);return 0;
   }
   sort(a+1,a+1+n);
   int len=0;
   c[++len]=a[i].y;
   F(i,2,n)
   {
      if(c[len]<a[i].y) c[++len]=a[i].y;
      else c[lower_bound(c+1,c+1+len,a[i].y)-c]=a[i].y;
   }
   ans=ans-(20-5*pi)*len;
   int check=min(abs(y1-y2),abs(x1-x2))+1;
   if(len==check)  { ans+=5*pi;}
   printf("%.15f\n",ans );
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:15: error: 'i' was not declared in this scope; did you mean 'pi'?
   45 |    c[++len]=a[i].y;
      |               ^
      |               pi
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;

#define ll long long
#define F(i,a,b) for(int i=a;i<=b;++i)
#define R(i,a,b) for(int i=a;i<b;++i)
#define mem(a,b) memset(a,b,sizeof(a))
const double pi = acos(-1.0);
double x1,y1,x2,y2;
int n;

double ans=0;
struct node
{
   int x,y;
   bool operator<(const node &p)const
   {
      return (x==p.x)?y<p.y:x<p.x;
   }
}a[200200];
double c[200200];
int main()
{
   cin>>x1>>y1>>x2>>y2;
   ans=(abs(x1-x2)+abs(y1-y2))*(100);
   double X1=min(x1,x2),X2=max(x1,x2),Y1=min(y1,y2),Y2=max(y1,y2);
   cin>>n;
   int length=0;
   F(i,1,n)
   {
      double x,y;
      cin>>x>>y;
      if((x>=X1)&&(x<=X2)&&(y>=Y1)&&(y<=Y2)) a[++length].x=x,a[length].y=y;
   }
   n=length;
   if(n==0)
   {
      cout<<ans<<endl;return 0;
   }
   sort(a+1,a+1+n);
   F(i,1,n) c[i]=a[i].y;
   int len=1;
   F(i,2,n)
   {
      if(c[len]<=c[i]) c[++len]=c[i];
      else c[lower_bound(c+1,c+1+len,c[i])-c]=c[i];
   }
   ans=ans-(20-5*pi)*len;
   int check=min(abs(y1-y2),abs(x1-x2))+1;
   if(len==check)  { ans=ans+(20-5*pi)+10*pi-20; }
   cout<<ans<<endl;
   return 0;
}

Compiler output:
a.cc:9:19: error: 'acos' was not declared in this scope
    9 | const double pi = acos(-1.0);
      |                   ^~~~
a.cc:10:11: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
   10 | double x1,y1,x2,y2;
      |           ^~
Language: C++

#pragma comment(linker, "/STACK:102400000,102400000")
#include <bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000007
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";
//#define dprintf(...) 
#define hash _hash
//#define dprintf(...) fprintf(outFile,__VA_ARGS__)
 
#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 200010
 
template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}
 
//FILE* outFile;
 
inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}
 
int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}

pii a[N];
int f[N];
int b[N];
void upd(int x,int v){
    while(x<N)Max(f[x],v),x+=x&-x;
}
int query(int x){
    int ans=0;
    while(x>0)Max(ans,f[x]),x-=x&-x;
    return ans;
}
void upd1(int x,int v){
    while(x)Max(f[x],v),x-=x&-x;
}
int query1(int x){
    int ans=0;
    while(x<N)Max(ans,f[x]),x+=x&-x;
    return ans;
}
int main(){
    int T,i,j,k,n,m=0,K;
    int x1,y1,x2,y2;
    cout<<setprecision(12)<<fixed;
    scanf("%d%d%d%d%d",&x1,&y1,&x2,&y2,&n);
    if(x1>x2)swap(x1,x2),swap(y1,y2);
    int l=min(y1,y2),r=max(y1,y2);
    rep(i,0,n){
        scanf("%d%d",&a[i].x,&a[i].y);
        if(a[i].x>=x1&&a[i].x<=x2&&a[i].y>=l&&a[i].y<=r){
            a[m++]=a[i];
        }
    }
    n=m;
    sort(a,a+n);
    if(x1==x2){
        if(y1>y2)swap(y1,y2);
        double ans=(y2-y1)*100.0;
        if(n)ans+=pi*10-2*10;
        cout<<ans<<"\n";return 0;
    }
    if(y1==y2){
        double ans=(x2-x1)*100.0;
        if(n)ans+=pi*10-2*10;
        cout<<ans<<"\n";return 0;
    }
    rep(i,0,n)b[i]=a[i].y;
    sort(b,b+n);
    int ans=0;
    if(y2>=y1)
    rep(i,0,n){
        j=lower_bound(b,b+n,a[i].y)-b+1;
        int w=query(j)+1;
        upd(j,w);
        Max(ans,w);
    }
    else
    rep(i,0,n){
        j=lower_bound(b,b+n,a[i].y)-b+1;
        int w=query1(j)+1;
        upd1(j,w);
        Max(ans,w);
    }
    double w=(abs(x1-x2)+abs(y2-y1))*100.0-20*ans+5*ans*pi+eps;
    printf("%.12f\n",w);
    return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:105:60: error: 'eps' was not declared in this scope
  105 |     double w=(abs(x1-x2)+abs(y2-y1))*100.0-20*ans+5*ans*pi+eps;
      |                                                            ^~~
Language: C++

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

#define f first
#define s second
#define p pair<int,int>
#define P pair<ll,ll>
#define pb push_back
#define ll long long
#define db double
#define zero(a) memset(a,0,sizeof(a))
#define inff(a,n) fill(a,a+n+1,inf)
#define all(a) a.begin(),a.end()
#define sz(a) int((a).size())
#define read(x) scanf("%lld",&x)
#define read2(x,y) scanf("%lld%lld",&x,&y)
#define write(x) printf("%lld\n",x)

const int maxn=2e5+5;
const ll inf=1e9;
const db pi=acos(-1);

ll x1,x2,Y1,y2,n,x[maxn],dp[maxn],a,b,num,sum,ans;
vector<P>v(maxn);

int main()
{
    read2(x1,Y1),read2(x2,y2);
    if(x1>x2)swap(x1,x2);
    if(Y1>y2)swap(Y1,y2);
    read(n);
    if(x1==x2&&Y1==y2)printf("0");
    else if(x1==x2)
    {
        for(int i=0; i<n; i++)
        {
            read2(a,b);
            if(a==x1&&b>Y1&&b<y2)
            {
                sum++;
            }
        }
        db xy=(y2-Y1)*100,res=0;
        if(sum>0)res=20-5*pi;
        printf("%.12f",min(xy+(10*pi-20)*sum,xy+200-res));
    }
    else if(Y1==y2)
    {
        for(int i=0; i<n; i++)
        {
            read2(a,b);
            if(a>x1&&a<x2&&b==y2)
            {
                sum++;
            }
        }
        db xy=(x2-x1)*100,res=0;
        if(sum>0)res=20-5*pi;
        printf("%.12f",min(xy+(10*pi-20)*sum,xy+200-res));
    }
    else
    {
        int per=0;
        for(int i=0; i<n; i++)
        {
            read2(a,b);
            if(a>x1&&a<x2&&b>Y1&&b<y2)
            {
                v[per].f=a;
                v[per++].s=b;
            }
        }
        sort(v.begin(),v.begin()+per);
        //for(int i=0;i<per;i++)cout<<v[i].s<<endl;
        fill(dp,dp+per+1,inf);
        for(int i=0; i<per; i++)
        {
            *lower_bound(dp,dp+n,v[i].s)=v[i].s;
        }
        if(per==0)num=0;
        else num=lower_bound(dp,dp+n,inf)-dp;
        db xy=(y2-Y1+x2-x1)*100;
        if(num>=min(x2-x1,y2-y1))xy=xy-(20-5*pi)*(num-1)+10*pi-20;
        xy-=(20-5*pi)*num;
        printf("%.12f",xy);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:29: error: invalid operands of types 'long long int' and 'double(double) noexcept' to binary 'operator-'
   83 |         if(num>=min(x2-x1,y2-y1))xy=xy-(20-5*pi)*(num-1)+10*pi-20;
      |                           ~~^~~
      |                           |  |
      |                           |  double(double) noexcept
      |                           long long int
Language: C++

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <map>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define whole(x) begin(x), end(x)
using namespace std;

template <typename T>
vector<T> longest_increasing_subsequence(vector<T> const & xs) {
    vector<T> l; // l[i] is the last element of the increasing subsequence whose length is i+1
    l.push_back(xs.front());
    for (auto && x : xs) {
        auto it = lower_bound(l.begin(), l.end(), x);
        if (it == l.end()) {
            l.push_back(x);
        } else {
            *it = x;
        }
    }
    return l;
}

int main() {
    // input
    int lx, ly, rx, ry, n; scanf("%d%d%d%d%d", &lx, &ly, &rx, &ry, &n);
    int h = abs<int>(ry - ly);
    int w = abs<int>(rx - lx);
    vector<pair<int, int> > f;
    repeat (i, n) {
        int x, y; scanf("%d%d", &x, &y);
        x = lx <= rx ? x - lx : x - rx;
        y = ly <= ry ? y - ly : y - ry;
        if (0 <= x and x <= w and 0 <= y and y <= h) {
            f.emplace_back(x, y);
        }
    }
    // solve
    vector<int> lis;
    if (not f.empty()) {
        vector<int> g;
        sort(whole(f));
        for (auto it : f) g.push_back(it.second);
        lis = longest_increasing_subsequence(g);
    }
    double result = 100 * (h + w) - (20 - 5 * M_PI) * lis.size();
    if (lis.size() == h + 1 or lis.size() == w + 1) {
        result += 5 * M_PI;
    }
    // output
    printf("%.15lf\n", result);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:17: error: expected primary-expression before 'int'
   28 |     int h = abs<int>(ry - ly);
      |                 ^~~
a.cc:29:17: error: expected primary-expression before 'int'
   29 |     int w = abs<int>(rx - lx);
      |                 ^~~
Language: C++

#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

long INF = numeric_limits<long>::max();

int main()
{
  long sx, sy, gx, gy;
  cin >> sx >> sy >> gx >> gy;

  int N;
  cin >> N;

  vector<pair<long, long>> F(N);
  for (int i = 0; i < N; ++i) {
    long x, y;
    cin >> x >> y;
    F[i] = make_pair(x, y);
  }

  while (!(sx <= gx && sy <= gy)) {
    tie(sx, sy) = make_pair(-sy, sx);
    tie(gx, gy) = make_pair(-gy, gx);
    for (auto& p : F)
      p = make_pair(-p.second, p.first);
  }

  sort(F.begin(), F.end());

  int bi = lower_bound(F.begin(), F.end(), make_pair(sx, 0),
		       [](pair<long, long> p, pair<long, long> q) {
			 return p.first < q.first;
		       }) - F.begin();
  int ei = upper_bound(F.begin(), F.end(), make_pair(gx, 0),
		       [](pair<long, long> p, pair<long, long> q) {
			 return p.first < q.first;
		       }) - F.begin();

  vector<long> tab(N + 2, INF);
  tab[0] = sy;

  // cerr << "sx = " << sx << ", sy = " << sy << endl;
  // cerr << "gx = " << gx << ", gy = " << gy << endl;

  for (int i = bi; i < ei; ++i) {
    long x, y;
    tie(x, y) = F[i];
    // cerr << i << ": " << x << " " << y << endl;
    if (y < sy || y > gy)
      continue;

    int j = lower_bound(tab.begin(), tab.end(), y) - tab.begin();
    if (tab[j] > y) {
      assert(j > 0);
      --j;
    }
    assert(tab[j] <= y);
    // cerr << "tab =";
    // for (int k = 0; k < 5; ++k)
    //     cerr << ' ' << tab[k];
    // cerr << endl;
    // cerr << "lb = " << j << ": " << tab[j] << endl;
    if (tab[j + 1] > y)
      tab[j + 1] = y;
  }

  int cnt = 0;
  for (int i = N; i >= 0; --i) {
    if (tab[i] != INF) {
      cnt = i;
      break;
    }
  }

  double ans = 100. * (gx - sx + gy - sy) + cnt * (-20. + 5. * M_PI);
  if ((sx == gx) || (sy == gy) || cnt == min(gx-sx,gy-sy) )
    ans += 5. * M_PI);
  cout << setprecision(20) << ans << '\n';

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:92:21: error: expected ';' before ')' token
   92 |     ans += 5. * M_PI);
      |                     ^
Language: C++

main(){puts("nan");}

Compiler output:
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    1 | main(){puts("nan");}
      | ^~~~
a.cc: In function 'int main()':
a.cc:1:8: error: 'puts' was not declared in this scope
    1 | main(){puts("nan");}
      |        ^~~~
Language: C++

#include <cstdio>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <vector>
#include <iostream>
#include <ctime>
#include <unistd.h>

using namespace std;

#define TRACE(x) cerr << #x <<  " = " << x << endl
#define _ << " " <<
#define FOR(i, a, b) for (int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)

#define X first
#define Y second

typedef pair<int, int> P;
typedef long long ll;

const int MAX = 1<<18;

double PI = acos(-1);
P poc, kraj;
vector <P> V;
int dp[MAX];

int unutra(P tmp) {
  return (tmp.X >= poc.X && tmp.X <= kraj.X &&
	  tmp.Y >= poc.Y && tmp.Y <= kraj.Y);
}

int main()
{
  scanf("%d%d%d%d", &poc.X, &poc.Y, &kraj.X, &kraj.Y);
  int n;
  scanf("%d", &n);

  REP(i, n) {
    P tmp;
    scanf("%d%d", &tmp.X, &tmp.Y);
    V.push_back(tmp);
  }
  
  if (poc.X > kraj.X)
    swap(poc, kraj);

  if (poc.Y > kraj.Y) {
    poc.Y = -poc.Y;
    kraj.Y = -kraj.Y;
    REP(i, n) V[i].Y *= -1;
  }

  sort(V.begin(), V.end());
  REP(i, MAX) dp[i] = 1e9;
  dp[0] = -1e9;

  for (auto it : V) {
    if (!unutra(it)) continue;
    int lo = 0, hi = MAX-5;
    for (; lo<hi; ) {
      int mid = (lo + hi + 1) / 2;
      if (dp[mid] < it.Y) lo = mid;
      else hi = mid - 1;	
    }

    dp[lo+1] = it.Y;
  }

  int kol = 0;
  REP(i, MAX)
    if (dp[i] != 1e9)
      kol = i;

  double rje = 100.0 * (kraj.Y - poc.Y + kraj.X - poc.X);
  double koef = 10 * (PI/2 - 2);

  TRACE(rje);
  
  if (kol == min(kraj.Y - poc.Y, kraj.X - poc.X) + 1) {
    rje += koef * (kol - 1);
    rje += 10.0 * (PI - 2);
  }
  else
    rje += koef * kol;

  printf("%.15lf\n", rje);    

  return 0;
}


Compiler output:
a.cc:25:13: error: 'acos' was not declared in this scope
   25 | double PI = acos(-1);
      |             ^~~~