criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.*;
import java.util.StringTokenizer;

public class ReverseCompareG19B {
    public static void main(String[] args) throws IOException {
        FastScanner in = new FastScanner();
        String s = in.nextLine();
        long[] num = new long[26];
        for (int i = 0; i < s.length(); i++) {
            num[s.charAt(i) - 97]++;
        }
        long result = s.length() * (s.length() - 1) / 2 + 1;
        for (int i = 0; i < 26; i++) {
            result -= num[i] * (num[i] - 1) / 2;
        }
        System.out.println(result);
    }

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return null;
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}


Compiler output:
Main.java:4: error: class ReverseCompareG19B is public, should be declared in a file named ReverseCompareG19B.java
public class ReverseCompareG19B {
       ^
1 error
Language: C

#include <stdio.h>
int main(void){
    char po;
    int buri[26]={};
    int mojisu=0;
    long long int ans=1;
    while(scanf("%c",&po)!=-1&&c-'a'>=0&&c-'a'<26){
        mojisu++;
        buri[po-'a']++;
        ans+=(long long int)(mojisu-buri[po-'a']);
    }
    printf("%lld",ans);
    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:7:32: error: 'c' undeclared (first use in this function)
    7 |     while(scanf("%c",&po)!=-1&&c-'a'>=0&&c-'a'<26){
      |                                ^
main.c:7:32: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.Scanner;

/**
 *
 * @author mustafa
 */
public class B {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.nextLine();
        
        long sayac = 1;
        
        for (int i = 0; i < s.length() - 1; ++i)
        {
            for (int j = i + 1; j < s.length(); ++j)
            {
                if (s.charAt(i) == s.charAt(j))
                    continue;
                else
                    sayac++;
            }
        }
        
        System.out.println(sayac);
    }
    
}


Compiler output:
Main.java:7: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error
Language: C++

#include <cstdio>
#include <cstring>
using namespace std;
int i,n,a[30];
long long r;
char s[200004];
int main()
{
    gets(s);
    n=strlen(s);
    for (i=0;i<=(n-1);i++)
        a[s[i]-'a']++;
    r=(1LL)+(1LL)*n*(n-1)/2;
    for (i=0;i<=25;i++)
        r=(0LL)+r-(1LL)*a[i]*(a[i]-1)/2;
    printf ("%lld\n", r);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    9 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include <cstdio>
#include <cstring>

using namespace std;

char sir[200010];
int vaz[100];

int main()
{
    //freopen("file.in","r",stdin);
    //freopen("file.out","w",stdout);
    int sol=0;
    gets(sir+1);
    int l=strlen(sir+1);
    long long rez=1LL*l*(l+1)/2;
    for(int i=1;i<=l;i++)
        vaz[sir[i]-'a']++;
    for(int i=0;i<26;i++)
        sol+=1LL*vaz[i]*(vaz[i]+1)/2;
    printf("%lld",rez-sol+1);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |     gets(sir+1);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define N 100010
using namespace std;
char str[N],tmp[N<<1];
int f[N<<1],len;
ll ans;
void csh()
{
	tmp[0]='@';
	for(int i=1;i<=2*len;i+=2)
	{
		tmp[i]='#';
		tmp[i+1]=str[i/2];
	}
	tmp[len*2+1]='#';
}
void Manacher()
{
	int mx=0,id=0;
	for(int i=1;i<=len;i++)
	{
		if(mx>i)
		f[i]=min(mx-i,f[id*2-i]);
		else
		f[i]=1;
		while(tmp[i-f[i]]==tmp[i+f[i]])
		f[i]++;
		if(f[i]+i>mx)
		{
			mx=f[i]+i;
			id=i;
		}
	}
}
int main()
{
	cin>>str;
	len=strlen(str);
	csh();
	int sv=len;
	len=len*2+1;
	ans=(ll)(sv-1)*(sv)/2;
	Manacher();
	for(int i=1;i<=len;i++)
	ans-=f[i]/2;
	ans+=sv;
	cout<<ans+1<<endl;
}
/*
aaaatt
*/

Compiler output:
a.cc:9:1: error: 'll' does not name a type
    9 | ll ans;
      | ^~
a.cc: In function 'int main()':
a.cc:45:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   45 |         ans=(ll)(sv-1)*(sv)/2;
      |         ^~~
      |         abs
a.cc:45:14: error: 'll' was not declared in this scope
   45 |         ans=(ll)(sv-1)*(sv)/2;
      |              ^~
Language: C++

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

const int MAXN = 205000;

struct node {
    int next[26];
    int len;
    int sufflink;
    int num;
};

int len;
char s[MAXN];
node tree[MAXN]; 
int num;            // node 1 - root with len -1, node 2 - root with len 0
int suff;           // max suffix palindrome
long long ans;

bool addLetter(int pos) {
    int cur = suff, curlen = 0;
    int let = s[pos] - 'a';

    while (true) {
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos])     
            break;  
        cur = tree[cur].sufflink;
    }       
    if (tree[cur].next[let]) {  
        suff = tree[cur].next[let];
        return false;
    }

    num++;
    suff = num;
    tree[num].len = tree[cur].len + 2;
    tree[cur].next[let] = num;

    if (tree[num].len == 1) {
        tree[num].sufflink = 2;
        tree[num].num = 1;
        return true;
    }

    while (true) {
        cur = tree[cur].sufflink;
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos]) {
            tree[num].sufflink = tree[cur].next[let];
            break;
        }       
    }           

    tree[num].num = 1 + tree[tree[num].sufflink].num;

    return true;
}

void initTree() {
    num = 2; suff = 2;
    tree[1].len = -1; tree[1].sufflink = 1;
    tree[2].len = 0; tree[2].sufflink = 1;
}

int main() {
    //assert(freopen("input.txt", "r", stdin));
    //assert(freopen("output.txt", "w", stdout));

    gets(s);
    len = strlen(s);

    initTree();
    long long total = 0;
    for (int i = 0; i < len; i++) {
        addLetter(i);
        ans += tree[suff].num;
        total += i+1;
    }

    cout << total + 1 -ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:84:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   84 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <utility>
#include <cstring>
#include <cassert>
#include <cmath>
#include <stack>
#include <queue>

using namespace std;

const int MAXN = 205000;

struct node {
    int next[26];
    int len;
    int sufflink;
    int num;
};

int len;
char s[MAXN];
node tree[MAXN]; 
int num;            // node 1 - root with len -1, node 2 - root with len 0
int suff;           // max suffix palindrome
long long ans;

bool addLetter(int pos) {
    int cur = suff, curlen = 0;
    int let = s[pos] - 'a';

    while (true) {
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos])     
            break;  
        cur = tree[cur].sufflink;
    }       
    if (tree[cur].next[let]) {  
        suff = tree[cur].next[let];
        return false;
    }

    num++;
    suff = num;
    tree[num].len = tree[cur].len + 2;
    tree[cur].next[let] = num;

    if (tree[num].len == 1) {
        tree[num].sufflink = 2;
        tree[num].num = 1;
        return true;
    }

    while (true) {
        cur = tree[cur].sufflink;
        curlen = tree[cur].len;
        if (pos - 1 - curlen >= 0 && s[pos - 1 - curlen] == s[pos]) {
            tree[num].sufflink = tree[cur].next[let];
            break;
        }       
    }           

    tree[num].num = 1 + tree[tree[num].sufflink].num;

    return true;
}

void initTree() {
    num = 2; suff = 2;
    tree[1].len = -1; tree[1].sufflink = 1;
    tree[2].len = 0; tree[2].sufflink = 1;
}

int main() {
    //assert(freopen("input.txt", "r", stdin));
    //assert(freopen("output.txt", "w", stdout));

    gets(s);
    len = strlen(s);

    initTree();
    long long total = 0;
    for (int i = 0; i < len; i++) {
        addLetter(i);
        ans += tree[suff].num;
        total += i+1;
    }

    cout << total + 1 -ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:84:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
   84 |     gets(s);
      |     ^~~~
      |     getw
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define REPE(i, a, b) for (int i = (a); i <= int(b); ++i)
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define EB emplace_back
using LL = long long;
using PII = pair<int, int>;
#define F first
#define S second

char s[200010];
int c[128];
int main() {
  scanf("%s", s);
  int n = strlen(s);
  REP(i, n) c[s[i]]++;
  LL ans = 1, t = n;
  REP(i, n) {
    ans += ((t--) - (c[s[i]]--);
  }
  cout << ans << endl;
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:32: error: expected ')' before ';' token
   22 |     ans += ((t--) - (c[s[i]]--);
      |            ~                   ^
      |                                )
Language: Java

import java.util.Scanner;

public class B {
  static Scanner sc = new Scanner(System.in);

  public static void main(String[] args) {
    char[] A = sc.next().toCharArray();
    int N = A.length;
    int[] count = new int[26];
    for (int i = 0; i < N; i++) {
      count[A[i] - 'a']++;
    }
    long ans = 1;
    for (int i = 0; i < N; i++) {
      count[A[i] - 'a']--;
      ans += N - i - 1 - count[A[i] - 'a'];
    }
    System.out.println(ans);
  }

}


Compiler output:
Main.java:3: error: class B is public, should be declared in a file named B.java
public class B {
       ^
1 error
Language: C++

#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <string>
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
#include <iomanip>
using namespace std;
#define pb push_back
#define mp make_pair
typedef pair<int,int> pii;
typedef long long ll;
typedef double ld;
typedef vector<int> vi;
#define fi first
#define se second
#define fe first
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define Edg int M=0,fst[SZ],vb[SZ],nxt[SZ];void ad_de(int a,int b){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;}void adde(int a,int b){ad_de(a,b);ad_de(b,a);}
#define Edgc int M=0,fst[SZ],vb[SZ],nxt[SZ],vc[SZ];void ad_de(int a,int b,int c){++M;nxt[M]=fst[a];fst[a]=M;vb[M]=b;vc[M]=c;}void adde(int a,int b,int c){ad_de(a,b,c);ad_de(b,a,c);}
#define es(x,e) (int e=fst[x];e;e=nxt[e])
#define esb(x,e,b) (int e=fst[x],b=vb[e];e;e=nxt[e],b=vb[e])
#define VIZ {printf("digraph G{\n"); for(int i=1;i<=n;i++) for es(i,e) printf("%d->%d;\n",i,vb[e]); puts("}");}
#define VIZ2 {printf("graph G{\n"); for(int i=1;i<=n;i++) for es(i,e) if(vb[e]>=i)printf("%d--%d;\n",i,vb[e]); puts("}");}
#define SZ 666666
//orz kczno1    POD only
template<typename T>
struct vec{T *a;int n;void clear(){n=0;}
void pb(const T &x){if((n&-n)==n)a=(T*)realloc(a,(n*2)*sizeof(T));a[n++]=x;}
inline T* begin(){return a;}inline T* end() {return a+n;}};
char str[SZ]; int n;
int app[SZ];
int main()
{
	gets(str+1); n=strlen(str+1);
	for(int i=1;i<=n;++i)
		++app[str[i]];
	ll tot=n*(ll)(n-1)/2;
	for(int i='a';i<='z';++i)
		tot-=(app[i]-1)*ll(app[i])/2;
	cout<<tot+1<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   44 |         gets(str+1); n=strlen(str+1);
      |         ^~~~
      |         getw
Language: C++

#include <Iostream>
#include <algorithm>
#include <map>
#include <stdio.h>
using namespace std;
#define ll long long
string a;
map<char, ll> m;
ll choose(ll a){
	if (a == 1) return 0;
	return a*(a - 1)/2;
}
int main(){
	cin >> a;
	for (int i = 0; i < a.length(); i++){
		if (m.find(a[i]) == m.end()){
			m[a[i]] = 1;
		} else {
			m[a[i]] = m[a[i]] + 1;
		}
	}
	ll answer = choose((long long)a.length());
	for (map<char, ll>::iterator it = m.begin(); it != m.end(); it++){
		answer -= choose(it -> second);
	}
	printf("%lld\n", answer+1);
	
}

Compiler output:
a.cc:1:10: fatal error: Iostream: No such file or directory
    1 | #include <Iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,ssse3,popcnt,sse4.1,sse4.2,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
//using arr = array;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 105, mod = 1e9 + 7;
const ld tau = 6.28318530717958647692;
const ld A = 2.5*tau - 20.;
const ld B = 5.0*tau - 20.;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define y1 orz
int x1, n, y1, m, k;
vpi a;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> x1 >> y1 >> n >> m >> k;
	n -= x1, m -= y1;
	a.resize(k);
	for(auto &i : a) cin >> i.first >> i.second, i.first -= x1, i.second -= y1;
	if(n < 0) {
		n *= -1;
		for(auto &i : a) i.first *= -1;
	}
	if(m < 0) {
		m *= -1;
		for(auto &i : a) i.second *= -1;
	}
	map<int, int> xty, ytx;
	{
		vpi t;
		for(auto &i : a) {
			if(i.first >= 0 && i.first <= n && i.second >= 0 && i.second <= m) t.pb(i);
		}
		a = t;
		for(auto i : a) {
			xty[i.first] = i.second;
			ytx[i.second] = i.first;
		}
	}
	if(a.empty()) return cout << fixed << setprecision(15) << 100.*(n+m), 0;
	if(n == 0 || m == 0) return cout << fixed << setprecision(15) << 100.*(n+m) + lis.size()*B, 0;
	vi lis, ux, uy;
	sort(all(a));
	for(auto &i : a) {
		auto it = lower_bound
		(all(lis), i.second);
		if(it == lis.end()) {
			lis.pb(i.second), it = --lis.end();
			ux.pb(ux.size()?ux.back():0);
			uy.pb(uy.size()?uy.back():0);
		} else {
			*it = i.second;
		}
		int p = it-lis.begin();
		if(p) {
			ux[p] |= ytx[lis[p]]-ytx[lis[p-1]]>1;
			uy[p] |= lis[p]-lis[p-1]>1;
		}
	}
	int border = 0;
	pi pos;
	for(auto i : a) {
		if(!binary_search(all(lis), i.second)) continue;
		if(i.first==0 || i.first==n || i.second==0 || i.second==m) pos = i, border = 1;
	}
	if(!border || ((pos.first == 0 || pos.first == n)?ux.back():uy.back())) return cout << fixed << setprecision(15) << 100.*(n+m) + lis.size()*A, 0;
	cout << fixed << setprecision(15) << 100.*(n+m) + ((int)lis.size()-(lis.size()%2==0))*A + B*(lis.size()%2==0), 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:87: error: 'lis' was not declared in this scope
   52 |         if(n == 0 || m == 0) return cout << fixed << setprecision(15) << 100.*(n+m) + lis.size()*B, 0;
      |                                                                                       ^~~
Language: C++

#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,ssse3,popcnt,sse4.1,sse4.2,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
//using arr = array;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 105, mod = 1e9 + 7;
const ld tau = 6.28318530717958647692;
const ld A = 2.5*tau - 20.;
const ld B = 5.0*tau - 20.;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define y1 orz
int x1, n, y1, m, k;
vpi a;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> x1 >> y1 >> n >> m >> k;
	n -= x1, m -= y1;
	a.resize(k);
	for(auto &i : a) cin >> i.first >> i.second, i.first -= x1, i.second -= y1;
	if(n < 0) {
		n *= -1;
		for(auto &i : a) i.first *= -1;
	}
	if(m < 0) {
		m *= -1;
		for(auto &i : a) i.second *= -1;
	}
	map<int, int> xty, ytx;
	{
		vpi t;
		for(auto &i : a) {
			if(i.first >= 0 && i.first <= n && i.second >= 0 && i.second <= m) t.pb(i);
		}
		a = t;
		for(auto i : a) {
			xty[i.first] = i.second;
			ytx[i.second] = i.first;
		}
	}
	
	if(a.empty()) cout << fixed << setprecision(15) << 100.*(n+m), 0;
	
	vi lis, ux, uy;
	sort(all(a));
	for(auto &i : a) {
		auto it = lower_bound(all(lis), i.second);
		if(it == lis.end()) {
			lis.pb(i.second), it = --lis.end();
			ux.pb(ux.size()?ux.back():0);
			uy.pb(uy.size()?uy.back():0);
		} else {
			*it = i.second;
		}
		if(int p = it-lis.begin(); p) {
			ux[p] |= ytx[lis[p]]-ytx[lis[p-1]]>1;
			uy[p] |= lis[p]-lis[p-1]>1;
		}
	}
	int border = 0;
	pi pos;
	for(auto i : a) {
		if(!binary_search(all(lis), i.second)) continue;
		if(i.first==0 || i.first==n || i.second==0 || i.second==m) pos = i, border = 1;
	}
	if(!border || ((pos.first == 0 || pos.first == n)?ux.back():uy.back())) return cout << fixed << setprecision(15) << 100.*(n+m) + lis.size()*A, 0;
	cout << fixed << setprecision(15) << 100.*(n+m) + (lis.size()-1)*A + B, 0;
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int> > >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = std::pair<int, int>]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,ssse3,popcnt,sse4.1,sse4.2,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
//using arr = array;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 105, mod = 1e9 + 7;
const ld tau = 6.28318530717958647692;
const ld A = 2.5*tau - 20.;
const ld B = 5.0*tau - 20.;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define y1 orz
int x1, n, y1, m, k;
vpi a;
ld ans = B;
int ty = -1, rx = -1;

void solve(int fixed) {//fixed => +B
	vi lis;
	sort(all(a));
	int pmax = 0, cbef = 0;
	for(auto &i : a) {
		if(cbef++ < i.first) pmax = m+1;
		int y = i.second;
		pmax = max(pmax, y);
		if(i.fist == n) continue;
		ld cur;
		if(fixed || y != pmax) {
			auto it = lower_bound(all(lis), y);
			if(it == lis.end()) lis.pb(y), it = --lis.end();
			else *it = y;
			//if(lis.size() == 2) cout << i.first << " " << i.second << '\n';
			cur = (it - lis.begin() + !fixed)*A + fixed*B + (i.first < rx ? B : 0);
		} else {
			auto it = lower_bound(all(lis), y);
			cur = (it == lis.end() ? lis.size() : (it - lis.begin() + !fixed))*A + fixed*B + (i.first < rx ? B : 0);
			cur += B;
		}
		//cout << i.first << " " << i.second << " / " << pmax << " " << cur << " / " << ans << " " << lis.size() << " " << B << endl;
		ans = min(ans, cur);
	}
}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> x1 >> y1 >> n >> m >> k;
	n -= x1, m -= y1;
	a.resize(k);
	for(auto &i : a) cin >> i.first >> i.second, i.first -= x1, i.second -= y1;
	if(n < 0) {
		n *= -1;
		for(auto &i : a) i.first *= -1;
	}
	if(m < 0) {
		m *= -1;
		for(auto &i : a) i.second *= -1;
	}
	{
		vpi t;
		for(auto &i : a) {
			if(i.first >= 0 && i.first <= n && i.second >= 0 && i.second <= m) t.pb(i);
		}
		a = t;
	}
	
	if(a.empty()) return cout << 100.*(n+m), 0;
	//if(a.size()==1) return cout << 100.*(n+m) + A, 0;
	for(auto &i : a) {
		if(i.first == n) ty = i.second;
		if(i.second == m) rx = i.first;
		if(i.first == 0 && i.second == m) ans = -A;
		if(i.first == n && i.second == 0) ans = -A;
	}
	
	solve(0), solve(1);
	for(auto &i : a) swap(i.first, i.second);
	swap(n, m);
	swap(ty, rx);
	solve(0), solve(1);
	
	ans += 100.*(n+m);
	cout << fixed << setprecision(15) << ans;
}


Compiler output:
a.cc: In function 'void solve(int)':
a.cc:35:22: error: 'struct std::pair<int, int>' has no member named 'fist'; did you mean 'first'?
   35 |                 if(i.fist == n) continue;
      |                      ^~~~
      |                      first
Language: C++

#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,sse,sse2,ssse3,popcnt,sse4.1,sse4.2,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back
using namespace std;
using ll = long long;
//using arr = array;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vpi = vector<pi>;
using ld = long double;
const int maxn = 105, mod = 1e9 + 7;
const ld tau = 6.28318530717958647692;
const ld A = 2.5*tau - 20.;
const ld B = 5.0*tau - 20.;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define y1 orz
int x1, n, y1, m, k;
vpi a;
int ty = -1, rx = -1;
ld ans = B;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> x1 >> y1 >> n >> m >> k;
	n -= x1, m -= y1;
	a.resize(k);
	for(auto &i : a) cin >> i.first >> i.second, i.first -= x1, i.second -= y1;
	if(n < 0) {
		n *= -1;
		for(auto &i : a) i.first *= -1;
	}
	if(m < 0) {
		m *= -1;
		for(auto &i : a) i.second *= -1;
	}
	{
		vpi t;
		for(auto &i : a) {
			if(i.first >= 0 && i.first <= n && i.second >= 0 && i.second <= m) t.pb(i);
		}
		a = t;
	}
	
	sort(all(a));
	vi lis;
	for(auto _i : a) {
		int y = i.second;
		auto it = lower_bound(all(lis), y);
		if(it == lis.end()) lis.pb(y);
		else *it = y;
	}
	ans = lis.size()*A;
	ans += 100.*(n+m);
	cout << fixed << setprecision(15) << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:25: error: 'i' was not declared in this scope
   52 |                 int y = i.second;
      |                         ^
Language: C++

#include<algorithm>
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
//{{{ read()
inline int read(){
	register int x=0,f=1;
	register char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-')	f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9')	x=x*10+(ch^48),ch=getchar();
	return x*f;
}
//}}}
const double pi=acos(-1);
const int N=2e5+5;
struct each{
	int x,y;
}a[N];
int n,k,f1,f2,xl,yl,xr,yr,top,f[N];
bool com(each x,each y){
	return x.x<y.x;
}
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	xl=read(),yl=read(),xr=read(),yr=read(),n=read();
	if(xl>xr)	f1=-1;
	else	f1=1;
	if(yl>yr)	f2=-1;
	else	f2=1;
	xl*=f1,xr*=f1,yl*=f2,yr*=f2;
	for(int i=1;i<=n;i++){
		int x=read()*f1,y=read()*f2;
		if(x<xl||x>xr||y<yl||y>yr)	--i,--n;
		else	a[i].x=x,a[i].y=y;
	}
	sort(a+1,a+n+1,com),f[0]=-INT_MAX;
	for(int i=1;i<=n;i++)
		if(a[i].y>f[top])	f[++top]=a[i].y;
		else{
			int l=1,r=top;
			while(l<r){
				int mid=(l+r)>>1;
				if(f[mid]<a[i].y)	l=++mid;
				else	r=mid;
			}
			f[l]=a[i].y;
		}
	double ans=100*((xr-xl)+(yr-yl))+top*(5*pi-20);
	if(top==min(xr-xl,yr-yl)+1)	ans+=5*pi;
	printf("%.11lf\n",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int read()':
a.cc:8:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |         register int x=0,f=1;
      |                      ^
a.cc:8:26: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    8 |         register int x=0,f=1;
      |                          ^
a.cc:9:23: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
    9 |         register char ch=getchar();
      |                       ^~
a.cc: In function 'int main()':
a.cc:41:35: error: 'INT_MAX' was not declared in this scope
   41 |         sort(a+1,a+n+1,com),f[0]=-INT_MAX;
      |                                   ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include<cmath>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const double PI = acos(-1);

int main()
{
    ll sx, sy, gx, gy;
    cin >> sx >> sy >> gx >> gy;
    int n;
    cin >> n;
    P p[200002];
    for(int i = 0; i < n; i++){
        int x, y;
        cin >> x >> y;
        p[i] = P(x, y);
    }
    if(sx > gx){
        sx = -sx, gx = -gx;
        for(int i = 0; i < n; i++) p[i] = P(-p[i].first, p[i].second);
    }
    if(sy > gy){
        sy = -sy, gy = -gy;
        for(int i = 0; i < n; i++) p[i] = P(p[i].first, -p[i].second);
    }
    if(gx - sx < gy - sy){
        swap(sx, sy);
        swap(gx, gy);
        for(int i = 0; i < n; i++) p[i] = P(p[i].second, p[i].first);
    }
    sort(p, p + n);
    vector<int> v;
    for(int i = 0; i < n; i++){
        if(p[i].first < sx || p[i].first > gx) continue;
        if(p[i].second < sy || p[i].second > gy) continue;
        int k = upper_bound(v.begin(), v.end(), p[i].second) - v.begin();
        if(k == (int)v.size()) v.push_back(p[i].second);
        else v[k] = p[i].second;
    }
    int k = v.size();
    double ans = -1;
    if(k != gy - sy + 1) ans = ((gx - sx) + (gy - sy)) * 100 - 20 * k * (1 - PI / 4);
    else ans = ((gx - sx) + (gy - sy)) * 100 - 20 * (k - 1) * (1 - PI / 4) + 10 * PI - 20;
    cout << fixed << setprecision(15) << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   36 |     sort(p, p + n);
      |     ^~~~
      |     sqrt
a.cc:41:17: error: 'upper_bound' was not declared in this scope
   41 |         int k = upper_bound(v.begin(), v.end(), p[i].second) - v.begin();
      |                 ^~~~~~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
int n,sx,sy,ex,ey;
int MX[400004];
struct node{
	int ax,ay;
	int hg;
}E[200002];
double ans=1e9;
const double d=4.292036732051033807686783083602,aa=11.415926535897932384626433832795;
int Read()
{
	int s=0;char ch=getchar();
	while(ch<'0'|ch>'9')ch=getchar();
	while(ch>='0'&&ch<='9')
	s=s*10+ch-'0',ch=getchar();
	return s;
}
bool cmp0(node x,node y)
{return x.ax<y.ax;}
bool cmp1(node x,node y)
{return x.ay<y.ay;}
bool cmp2(node x,node y)
{return x.ax>y.ax;}
int G(int x)
{
	int re=0;
	while(x)
	{
		re=max(MX[x],re);
		x-=(x&(-x));
	}
	return re;
}
void add(int x,int y)
{
	while(y<=2*n)
	{
		MX[y]=max(MX[y],x);
		y+=(y&(-y));
	}
	return;
}
void work1()
{
	n=Read();
	int ct=0;
	for(int i=1,x,y;i<=n;i++)
	{
		x=Read()+2;y=Read()+2;
		if(x>=sx&&x<=ex&&y>=sy&&y<=ey)
		E[++ct].ax=x,E[ct].ay=y;
	}n=ct;
	sort(E+1,E+n+1,cmp1);
	for(int i=1,j=0;i<=n;i++)
	if(E[i].ay!=E[i-1].ay+1)
	j+=2,E[i].hg=j;
	else E[i].hg=++j;
	sort(E+1,E+n+1,cmp0);
	int la[3]={0,0,0},js=0;
	for(int i=1,tmp;i<=n;i++)
	{
		tmp=G(E[i].hg)+1;js=max(js,tmp);add(tmp,E[i].hg);
	}
	ans=-d*js+((js==ey-sy+1)||(js==ex-sx+1)?aa+d:0);
	ans+=100.0*(ex-sx);
	ans+=100.0*(ey-sy);
	return;
}
void work2()
{
	n=Read();
	int ct=0;
	for(int i=1,x,y;i<=n;i++)
	{
		x=Read()+2;y=Read()+2;
		fin>>x>>y;x+=2;y+=2;
		if(x>=ex&&x<=sx&&y>=sy&&y<=ey)
		E[++ct].ax=x,E[ct].ay=y;
	}n=ct;
	sort(E+1,E+n+1,cmp1);
	for(int i=1,j=0;i<=n;i++)
	if(E[i].ay!=E[i-1].ay+1)
	j+=2,E[i].hg=j;
	else E[i].hg=++j;
	sort(E+1,E+n+1,cmp2);
	int la[3]={0,0,0},js=0;
	for(int i=1,tmp;i<=n;i++)
	{
		tmp=G(E[i].hg)+1;js=max(js,tmp);add(tmp,E[i].hg);
	}
	ans=-d*js+((js==ey-sy+1)||(js==sx-ex+1)?aa+d:0);
	ans+=100.0*(sx-ex);
	ans+=100.0*(ey-sy);
	return;
}
int main()
{
	sx=Read()+2;sy=Read()+2;
	ex=Read()+2;ey=Read()+2;
	fin>>ex>>ey;ex+=2;ey+=2;
	if(sx==ex&&sy==ey){
		puts("0.000000");
		return 0;
	}
	if(sy>ey||sy==ey&&sx>ex){
		swap(sx,ex);
		swap(sy,ey);
	}
	if(sx<ex)work1();
	else work2();
	ans+=0.000000000001;
	/*long long tmp=10000000*ans;
	if(tmp%10>=5)tmp+=10;
	tmp/=10;ans=(double)tmp/1000000.0;
	ans+=0.00000000001;*/
	printf("%.6llf",ans);
	return 0;
}

Compiler output:
a.cc: In function 'void work2()':
a.cc:80:17: error: 'fin' was not declared in this scope
   80 |                 fin>>x>>y;x+=2;y+=2;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:104:9: error: 'fin' was not declared in this scope
  104 |         fin>>ex>>ey;ex+=2;ey+=2;
      |         ^~~
Language: C++

#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <algorithm>
#define rep(x, a, b) for(int x = (a); x <= (b); ++x)
#define rop(x, a, b) for(int x = (a); x < (b); ++x)
#define per(x, a, b) for(int x = (a); x >= (b); --x)
using namespace std;
typedef long long LL;
typedef double DB;
const LDB pi = acos(-1);
struct node {
	int x, y;
}a[200005];
bool operator < (const node & a, const node & b) {
	if(a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator == (const node & a, const node & b) {
	return a.x == b.x && a.y == b.y;
}
const int INF = 2000000000;
int x_1, x_2, y_1, y_2;
int n;
int f[200005];
int main() {
	scanf("%d%d%d%d", &x_1, &y_1, &x_2, &y_2);
	int bj = 1;
	if(x_1 > x_2) swap(x_1, x_2), bj *= -1;
	if(y_1 > y_2) swap(y_1, y_2), bj *= -1;
	scanf("%d", &n);
	rep(i, 1, n) {
		scanf("%d%d", &a[i].x, &a[i].y);
		if(x_1 == x_2 && a[i].x == x_1) {
			printf("%0.15f", (DB) ((LL) y_2 - y_1) * 100.0 - 20 + 10 * pi);
			return 0;
		}
		if(y_1 == y_2 && a[i].y == y_1) {
			printf("%0.15f", (DB) ((LL) x_2 - x_1) * 100.0 - 20 + 10 * pi);
			return 0;
		}
		if(a[i].x < x_1) a[i].x = INF, a[i].y = INF;
		else if(a[i].x > x_2) a[i].x = INF, a[i].y = INF;
		else if(a[i].y < y_1) a[i].x = INF, a[i].y = INF;
		else if(a[i].y > y_2) a[i].x = INF, a[i].y = INF;
		else a[i].x *= bj;
	}
	sort(a + 1, a + 1 + n);
	n = unique(a + 1, a + 1 + n) - a - 1 - 1;
	int as = 0;
	rep(i, 1, n) {
		if(as == 0) f[++as] = a[i].y;
		else {
			int k = upper_bound(f + 1, f + 1 + as, a[i].y) - f;
			while(k <= as && f[k] < a[i].y) ++k;
			f[k] = a[i].y;
			as = max(as, k);
		}
	}
	printf("%0.15f", (DB) ((LL) x_2 - x_1 + y_2 - y_1) * 100.0 - (20 - 5 * pi) * as);
	return 0;
}

Compiler output:
a.cc:12:7: error: 'LDB' does not name a type; did you mean 'DB'?
   12 | const LDB pi = acos(-1);
      |       ^~~
      |       DB
a.cc: In function 'int main()':
a.cc:36:84: error: 'pi' was not declared in this scope; did you mean 'i'?
   36 |                         printf("%0.15f", (DB) ((LL) y_2 - y_1) * 100.0 - 20 + 10 * pi);
      |                                                                                    ^~
      |                                                                                    i
a.cc:40:84: error: 'pi' was not declared in this scope; did you mean 'i'?
   40 |                         printf("%0.15f", (DB) ((LL) x_2 - x_1) * 100.0 - 20 + 10 * pi);
      |                                                                                    ^~
      |                                                                                    i
a.cc:61:80: error: 'pi' was not declared in this scope
   61 |         printf("%0.15f", (DB) ((LL) x_2 - x_1 + y_2 - y_1) * 100.0 - (20 - 5 * pi) * as);
      |                                                                                ^~
Language: C++

#include <bits/stdc++.h>
const int INF=1e9;
const int MOD=1e9+7;
//const int MOD=998244353;
const long long LINF=1e18;
using namespace std;
#define int long double
#define fin {cout<<fixed<<setprecision(18)<<ans<<endl;return 0;}
//template

//main
signed main(){
  const int pi=3.1415926535897932384626433832795028841971;
  int sx,sy,gx,gy;cin>>sx>>sy>>gx>>gy;
  int N;cin>>N;
  std::vector<int> x(N),y(N);
  for(int i=0;i<N;i++)cin>>x[i]>>y[i];
  if(sy<gy)swap(sx,gx),swap(sy,gy);//sの方がyが大きい
  if(sx<gx){//sの方がxが大きい
    for(int i=0;i<N;i++)x[i]*=-1;
    sx*=-1;gx*=-1;
  }
  if(sx-gx<sy-gy){//移動距離はy方向よりもx方向の方が大きい
    swap(sx,sy);
    swap(gx,gy);
    for(int i=0;i<N;i++)swap(x[i],y[i]);
  }
  typedef pair<int,int> P;
  std::vector<P> c(N);
  for(int i=0;i<N;i++)c[i]=P(y[i],x[i]);
  sort(c.rbegin(),c.rend());
  std::vector<int> v(2e5+5,-LINF);//i回くるんをする時にx座標を最大でいくつに保てるか
  v[0]=sx;
  for(int i=0;i<N;i++){
    int px=c[i].second,py=c[i].first;
    if(px>sx||px<gx||py>sy||py<gy)continue;
    int l=0,r=2e5+2;
    while(r-l>1){
      int m=(r+l)/2;
      if(v[m]>=px)l=m;
      else r=m;
    }
    v[r]=px;
  }
  int ans=0;
  for(int i=0;i<2e5+2;i++)if(v[i]>-LINF)ans=i;
  ans=100*((sx-gx)+(sy-gy))-10*(2-pi/2)*ans;
  int a=0;
  for(;a<N;a++)if(c[a].first==sy)break;
  if(c[a].first!=sy)fin;
  if(c[a].second>sx||c[a].second<gx)fin;
  for(int i=1;a+i<N&&c[a+i].first>=gy;i++)if(c[a+i].first!=sy-i||c[a+i].second>c[a+i-1].second||c[a+i].second<gx)fin;
  if(a+i==N&&c[N-1].first!=gy)fin;
  cout<<fixed<<setprecision(18)<<ans+10*pi/2<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:53:8: error: 'i' was not declared in this scope
   53 |   if(a+i==N&&c[N-1].first!=gy)fin;
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
	int x1,y1,x2,y2,n,l=0;
	double res=0.0;
	cin>>x1>>y1>>x2>>y2>>n;
	map< pair<int,int>, bool> coord;
	pair<int,int> p;
	for(int i=0;i<n;++i){
		cin>>p.first>>p.second;
		coord[p]=true;
	}
	int dx=x2-x1,dy=y2-y1;
	vector<int> f;
	if(abs(dx)>abs(dy)){
		if(y2<y1||(y2==y1&&x2<x1))swap(x1,x2),swap(y1,y2);
		f=vector<int>(abs(dy)+1,-1);
		for(int i=0;i<abs(dy)+1;++i){
			auto fnt=find_if(coord.begin(),coord.end(),[&](pair<pair<int,int>,bool> a){
				return a.second&&a.first.second==y1+i&&min(x1,x2)<=a.first.first&&a.first.first<=max(x1,x2);});
			if(fnt!=coord.end())f[i]=fnt->first.first;
		}
		f.erase(remove(f.begin(),f.end(),-1),f.end());
		vector<int> dp(f.size(),INF);
		for(int i=0;i<(int)f.size();++i)*lower_bound(dp.begin(),dp.end(),f[i])=f[i];
		l=lower_bound(dp.begin(),dp.end(),INF)-dp.begin();
	}
	else{
		if(x2<x1||(x2==x1&&y2<y1))swap(x1,x2),swap(y1,y2);
		f=vector<int>(abs(dx)+1,-1);
		for(int i=0;i<abs(dx)+1;++i){
			auto fnt=find_if(coord.begin(),coord.end(),[&](pair<pair<int,int>,bool> a){
				return a.second&&a.first.first==x1+i&&min(y1,y2)<=a.first.second&&a.first.second<=max(y1,y2);
			});
			
			if(fnt!=coord.end())f[i]=fnt->first.second;
		}
		f.erase(remove(f.begin(),f.end(),-1),f.end());
		vector<int> dp(f.size(),INF);
		for(int i=0;i<(int)f.size();++i)*lower_bound(dp.begin(),dp.end(),f[i])=f[i];
		l=lower_bound(dp.begin(),dp.end(),INF)-dp.begin();
	}
	res=(abs(x2-x1)+abs(y2-y1))*100.0+(M_PI*5.0-20.0)*l;
	if(!dx||!dy)res+=M_PI*5.0;
	cout<<fixed<<setprecision(15)<<res<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:41: error: 'INF' was not declared in this scope
   24 |                 vector<int> dp(f.size(),INF);
      |                                         ^~~
a.cc:39:41: error: 'INF' was not declared in this scope
   39 |                 vector<int> dp(f.size(),INF);
      |                                         ^~~
Language: C++

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define INF (1<<29)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;
#define PI 3.1415926535897932384626433832795028
#define max(x, y) ((x)>(y)?(x):(y))
#define min(x, y) ((x)<(y)?(x):(y))

Int x_1, y_1, x_2, y_2;
Int n;
Int x[216000], y[216000];
vector<P> nums;
int main(){
  cin >> x_1 >> y_1 >> x_2 >> y_2;
  if(x_1 > x_2){
    swap(x_1, x_2);
    swap(y_1, y_2);
  }
  cin >> n;
  for(int i = 0;i < n;i++)cin >> x[i] >> y[i];

  if(y_1 > y_2){
    y_1 = -y_1;
    y_2 = -y_2;
    for(int i = 0;i < n;i++)y[i] *= -1;
  }

  for(int i = 0;i < n;i++){
    if(x[i] < x_1 || x_2 < x[i])continue;
    if(y[i] < y_1 || y_2 < y[i])continue;
    nums.push_back(P(x[i], y[i]));
  }
  sort(nums.begin(), nums.end());
  vector<int> dp(n, INF);
  for(int i = 0;i < nums.size();i++){
    int val = nums[i].second;
    *upper_bound(dp.begin(), dp.end(), val) = val;
  }
  int cnt = 0;
  while(cnt < n && dp[cnt] != INF)cnt++;
  double ans;
  ans = (x_2 - x_1 + y_2 - y_1) * 100 + cnt * (5 * PI - 20);
  
  if(min(x2 - x1,y2- y1) + 1 == cnt){
    ans -= 5 * PI - 20;
    ans += 10 * PI - 20;
  }

  printf("%.10lf\n", ans);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:56:10: error: 'x2' was not declared in this scope; did you mean 'x_2'?
   56 |   if(min(x2 - x1,y2- y1) + 1 == cnt){
      |          ^~
a.cc:19:21: note: in definition of macro 'min'
   19 | #define min(x, y) ((x)<(y)?(x):(y))
      |                     ^
a.cc:56:15: error: 'x1' was not declared in this scope; did you mean 'y1'?
   56 |   if(min(x2 - x1,y2- y1) + 1 == cnt){
      |               ^~
a.cc:19:21: note: in definition of macro 'min'
   19 | #define min(x, y) ((x)<(y)?(x):(y))
      |                     ^
a.cc:56:18: error: 'y2' was not declared in this scope; did you mean 'yn'?
   56 |   if(min(x2 - x1,y2- y1) + 1 == cnt){
      |                  ^~
a.cc:19:25: note: in definition of macro 'min'
   19 | #define min(x, y) ((x)<(y)?(x):(y))
      |                         ^
Language: C++

#include<cstdio>
#include<iostream>
#include<stdlib.h>
#include<algorithm>
#include<queue>
#include<string.h>
#include<vector>
using namespace std;
namespace io {
	const int SIZE = (1 << 21) + 1;
	char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr;
	// getchar
	#define gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	// print the remaining part
	inline void flush () {
		fwrite (obuf, 1, oS - obuf, stdout);
		oS = obuf;
	}
	// putchar
	inline void putc (char x) {
		*oS ++ = x;
		if (oS == oT) flush ();
	}
	// input a signed integer
	template <class I>
	inline void read (I &x) {
		for (f = 1, c = gc(); c < '0' || c > '9'; c = gc()) if (c == '-') f = -1;
		for (x = 0; c <= '9' && c >= '0'; c = gc()) x = x * 10 + (c & 15); x *= f;
	}
	// print a signed integer
	template <class I>
	inline void print (I x) {
		if (!x) putc ('0'); if (x < 0) putc ('-'), x = -x;
		while (x) qu[++ qr] = x % 10 + '0',  x /= 10;
		while (qr) putc (qu[qr --]);
	}
	//no need to call flush at the end manually!
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
}
using io :: read;
using io :: putc;
using io :: print;

typedef double db;
const int maxn=200000+10,mx=100000000;
const db pi=acos(-1);
struct dong{
    int x,y;
    friend bool operator<(dong a,dong b){
        return a.x<b.x||a.x==b.x&&a.y<b.y;
    }
} a[maxn];
int b[maxn],p[maxn];
int lis[maxn];
int i,j,k,l,t,n,m,x1,y1,x2,y2,z1,z2,top;
db ans;
int main(){
	int i,j,k;
	read(x1),read(y1),read(x2),read(y2),read(n);
    for(i=1;i<=n;i++)
		read(a[i].x),read(a[i].y);
    if (x1>x2){swap(x1,x2);swap(y1,y2);}
    if (y1>y2)
	{
		y1=mx-y1;y2=mx-y2;
        for(i=1;i<=n;i++) 
			a[i].y=mx-a[i].y;
    }
    a[++n].x=x1;a[n].y=y1;a[++n].x=x2;a[n].y=y2;
    for(i=1;i<=n;i++)
		b[i]=a[i].y;
    sort(b+1,b+n+1);
    top=unique(b+1,b+n+1)-b-1;
    for(i=1;i<=n;i++) 
		a[i].y=lower_bound(b+1,b+top+1,a[i].y)-b;
    z1=y1;z2=y2;
    y1=lower_bound(b+1,b+top+1,y1)-b;
    y2=lower_bound(b+1,b+top+1,y2)-b;
    p[0]=y1;
    for(i=1;i<=n;i++) 
		p[i]=n+1;
    sort(a+1,a+n+1);
    for(i=1;i<=n;i++)
	{
        if (a[i].x<x1||a[i].y<y1||a[i].y>y2) continue;
        if (a[i].x>x2) break;
        if(a[i].x==x1&&a[i].y==y1)
        {
        	lis[i]=0;
        	continue;
        }
        lis[i]=upper_bound(p,p+n+1,a[i].y)-p;
        p[lis[i]]=a[i].y;
        if (a[i].x==x2&&a[i].y==y2) break;
    }
    k=lis[i]-1;
    ans=(x2-x1)+(z2-z1);
    ans*=100;ans+=(pi-4)*5*k;
    if (k==min(x2-x1+1,z2-z1+1)&&k) ans+=pi*5;
    printf("%.12lf\n",ans);
    return 0;
}


Compiler output:
a.cc:46:13: error: 'acos' was not declared in this scope
   46 | const db pi=acos(-1);
      |             ^~~~
a.cc:55:22: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
   55 | int i,j,k,l,t,n,m,x1,y1,x2,y2,z1,z2,top;
      |                      ^~
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
const int N=200010;
const double pi=3.14159265358979;
int n,X1,Y1,X2,Y2,tot,tp,flgx=1,flgy=1,tmp[N];
pair<int,int>p[N];
char buffer[1000010],*hd,*tl;
char Getchar(){
    if(hd==tl){
        int len=fread(buffer,1,1000000,stdin);
        hd=buffer,tl=hd+len;
        if(hd==tl)
            return EOF;
    }
    return *hd++;
}
int rd(){
    int x=0;
    char c;
    do c=Getchar();
    while(!isdigit(c));
    do{
        x=(x<<1)+(x<<3)+(c^48);
        c=Getchar();
    }while(isdigit(c));
    return x;
}
void ReadData(){
	X1=rd(),Y1=rd(),X2=rd(),Y2=rd(),n=rd();
	if(X1>X2){
		flgx=-1;
		X1=-X1;
		X2=-X2;
	}
	if(Y1>Y2){
		flgy=-1;
		Y1=-Y1;
		Y2=-Y2;
	}
	for(int i=1;i<=n;i++){
		int x=rd(),y=rd();
		x*=flgx;
		y*=flgy;
		if(X1<=x&&x<=X2&&Y1<=y&&y<=Y2)
			p[++tot]=make_pair(x,y);
	}
	return;
}
void LIS(){
	sort(p+1,p+tot+1);
	for(int i=1;i<=tot;i++){
		if(!tp||tmp[tp]<p[i].second)
			tmp[++tp]=p[i].second;
		else tmp[lower_bound(tmp+1,tmp+tp+1,p[i].second)-tmp]=p[i].second;
	}
	return;
}
double getans(){
	double ret=100.0*(X2-X1+Y2-Y1)+tp*(5.0*pi-20.0);
	if(tp==min(X2-X1+1,Y2-Y1+1))
		ret+=5.0*pi;
	return ret;
}
int main(){
	ReadData();
	LIS();
	printf("%.12lf",getans());
	return 0;
}

Compiler output:
a.cc: In function 'int rd()':
a.cc:22:12: error: 'isdigit' was not declared in this scope
   22 |     while(!isdigit(c));
      |            ^~~~~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cassert>
#define y1 DEEP_DARK_FANTASY
#define y2 VAN_YOU_SEE
#define ll long long
const double pi=acos(-1.0);
using namespace std;
inline ll read(){
	ll re=0,flag=1;char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-') flag=-1;
		ch=getchar();
	}
	while(isdigit(ch)) re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
	return re*flag;
}
ll x1,x2,y1,y2,n,x[200010],y[200010],rk[200010],dp[200010];
inline bool cmp(ll l,ll r){
	return x[l]<x[r];
}
int main(){
	x1=read();y1=read();x2=read();y2=read();n=read();
	ll i,j,t1,t2;
	for(i=1;i<=n;i++) x[i]=read(),y[i]=read(),rk[i]=i,dp[i]=1e9;
	if(x1>x2){
		swap(x1,x2);swap(y1,y2);
	}
	if(y1>y2){
		y1=1e8-y1;
		y2=1e8-y2;
		for(i=1;i<=n;i++) y[i]=1e8-y[i];
	}
	x[++n]=x1;
	y[n]=y1;rk[n]=n;dp[n]=1e9;
	x[++n]=x2;
	y[n]=y2;rk[n]=n;dp[n]=1e9;
	sort(rk+1,rk+n+1,cmp);
	t1=1;t2=1;
	while(x[rk[t1]]!=x1||y[rk[t1]]!=y1) t1++;
	while(x[rk[t2]]!=x2||y[rk[t2]]!=y2) t2++;
	dp[1]=y[rk[t1]];dp[0]=-1;
//	for(i=1;i<=n;i++) cout<<i<<' '<<rk[i]<<' '<<x[rk[i]]<<' '<<y[rk[i]]<<'\n';
	ll pos;
	for(i=t1+1;i<t2;i++){
		pos=upper_bound(dp,dp+n+1,y[rk[i]])-dp;
//		cout<<i<<' '<<pos<<'\n';
		dp[pos]=y[rk[i]];
	}
	ll len=upper_bound(dp,dp+n+1,y[rk[i]])-dp-2;
	double ans=100*(y2-y1+x2-x1);
	ans+=(pi-4.0)*5.0*len;
//	cout<<"check "<<len<<' '<<dp[len]<<'\n';
	if(len==(min(y2-y1,x2-x1)+1)) ans+=pi*5.0;
	printf("%.12lf\n",ans);
}

Compiler output:
a.cc:9:17: error: 'acos' was not declared in this scope
    9 | const double pi=acos(-1.0);
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
#define M 200005
#define D long double
#define PI acos(-1)
using namespace std;
int x1,x2,y1,y2,n;
struct node{int x,y;friend bool operator <(node a,node b){return a.x<b.x;}}a[M];
int s[M]={0},m=0;
int main(){
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	int X=x1>x2?-1:1,Y=y1>y2?-1:1;
	x1*=X; x2*=X; y1*=Y; y2*=Y;
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		scanf("%d%d",&a[i].x,&a[i].y);
		a[i].x*=X; a[i].y*=Y;
		if(!(x1<=a[i].x&&a[i].x<=x2&&y1<=a[i].y&&a[i].y<=y2)) 
		{i--; n--; continue;}
	}
	sort(a+1,a+n+1);
	for(int i=1;i<=n;i++){
		if(m==0||s[m]<a[i].y) s[++m]=a[i].y;
		else{
			int cnt=lower_bound(s+1,s+m+1,a[i].y)-s;
			s[cnt]=a[i].y;
		}
	}
	D ans=100.*((x2-x1)+(y2-y1));
	ans=ans-(20.-5.*PI)*m;
	if(m==min((x2-x1)+1,(y2-y1)+1)) ans+=5*PI;
	printf("%.20Lf\n",ans);
}

Compiler output:
a.cc:6:11: error: 'int y1' redeclared as different kind of entity
    6 | int x1,x2,y1,y2,n;
      |           ^~
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:11:30: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   11 |         int X=x1>x2?-1:1,Y=y1>y2?-1:1;
      |                            ~~^~~
a.cc:12:25: error: invalid operands of types 'double(double) noexcept' and 'int' to binary 'operator*'
   12 |         x1*=X; x2*=X; y1*=Y; y2*=Y;
      |                       ~~^~~
a.cc:12:25: note:   in evaluation of 'operator*=(double(double) noexcept, int)'
a.cc:17:48: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   17 |                 if(!(x1<=a[i].x&&a[i].x<=x2&&y1<=a[i].y&&a[i].y<=y2))
      |                                              ~~^~~~~~~~
a.cc:28:32: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   28 |         D ans=100.*((x2-x1)+(y2-y1));
      |                              ~~^~~
      |                              |  |
      |                              |  double(double) noexcept
      |                              int
a.cc:30:32: error: invalid operands of types 'int' and 'double(double) noexcept' to binary 'operator-'
   30 |         if(m==min((x2-x1)+1,(y2-y1)+1)) ans+=5*PI;
      |                              ~~^~~
      |                              |  |
      |                              |  double(double) noexcept
      |                              int