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

#include<bits/stdc++.h>
int main(){
  std::cin.tie(0);
  ios::sync_with_stdio(false);
  long  n;unsigned long tmp; long m=0;
  std::array<std::pair<unsigned long,unsigned long> > ls;
  std::cin >> n;
  unsigned long long ans[n];
  ls.resize(n+1);
  for(long i=0; i<n; ++i) {std::cin >> tmp;ls[i]=(std::make_pair(tmp,i));}
  ls[n]=(std::make_pair(0,n));
  std::stable_sort(ls.begin(),ls.end(),[](auto a,auto b){return a.first>b.first;});
  auto target=ls.begin();
  for(auto it=ls.begin();it!=ls.cend()-1;){
    if(target->second>it->second)target=it;
    ans[target->second]+=(it->first-(++it)->first)*(++m);
  }
  for(auto x : ans) std::cout<< x <<'\n';
  std::cout.flush();
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'ios' has not been declared
    4 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:6:53: error: wrong number of template arguments (1, should be 2)
    6 |   std::array<std::pair<unsigned long,unsigned long> > ls;
      |                                                     ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array'
   99 |     struct array;
      |            ^~~~~
a.cc:9:6: error: request for member 'resize' in 'ls', which is of non-class type 'int'
    9 |   ls.resize(n+1);
      |      ^~~~~~
a.cc:10:46: error: invalid types 'int[long int]' for array subscript
   10 |   for(long i=0; i<n; ++i) {std::cin >> tmp;ls[i]=(std::make_pair(tmp,i));}
      |                                              ^
a.cc:11:5: error: invalid types 'int[long int]' for array subscript
   11 |   ls[n]=(std::make_pair(0,n));
      |     ^
a.cc:12:23: error: request for member 'begin' in 'ls', which is of non-class type 'int'
   12 |   std::stable_sort(ls.begin(),ls.end(),[](auto a,auto b){return a.first>b.first;});
      |                       ^~~~~
a.cc:12:34: error: request for member 'end' in 'ls', which is of non-class type 'int'
   12 |   std::stable_sort(ls.begin(),ls.end(),[](auto a,auto b){return a.first>b.first;});
      |                                  ^~~
a.cc:13:18: error: request for member 'begin' in 'ls', which is of non-class type 'int'
   13 |   auto target=ls.begin();
      |                  ^~~~~
a.cc:14:18: error: request for member 'begin' in 'ls', which is of non-class type 'int'
   14 |   for(auto it=ls.begin();it!=ls.cend()-1;){
      |                  ^~~~~
a.cc:14:33: error: request for member 'cend' in 'ls', which is of non-class type 'int'
   14 |   for(auto it=ls.begin();it!=ls.cend()-1;){
      |                                 ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define debug0(x) printf("! %d\n", x);
#define debug1(x, a, b) for(int (ii)=(a);(ii)<(b);(ii++)) printf("%d: %d\n", ii, x[ii]);
#define nono(x, ite) for(__typeof((x).begin()) (ite)=(x).begin();(ite)!=(x).end();(ite++))

typedef long long ll;

const int N = 1e5 + 10;

int n, lv;
ll a[N], ans[N], gar[N];
bool vis[N];
vector<int> pos;

ll s[2][N];

void add(int id, int u, ll v) {
  while (u <= n) {
    s[id][u] += v;
    u += u & -u;
  }
}

ll get(int id, ll u) {
  ll res = 0;
  while (u) {
    res += s[id][u];
    u -= u & -u;
  }
  return res;
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    gar[lv++] = a[i];
  }
  if(n == 1) {
    printf("%I64d\n", a[i]);
    return 0;
  }
  ll mx = 0;
  pos.pb(0);
  for (int i = 1; i <= n; i++) {
    if (mx < a[i]) mx = a[i], pos.pb(i);
  }
  for (int i = 0; i < pos.size(); i++) {
    vis[pos[i]] = 1;
  }
  sort(gar, gar + lv);
  lv = unique(gar, gar + lv) - gar;
  for (int i = 1; i <= n; i++) {
    a[i] = lower_bound(gar, gar + lv, a[i]) - gar + 1;
  }
  ll tsum = 0;
  int len = pos.size() - 1;
  for(int i = n; i >= 1; i--) {
    add(0, a[i], 1);
    add(1, a[i], gar[a[i] - 1]);
    if(vis[i]) {
      ans[i] = (get(1, lv + 1) - get(1, a[pos[len - 1]])) - tsum - (get(0, lv + 1) - get(0, a[pos[len - 1]])) * gar[a[pos[len - 1]] - 1];
      tsum += ans[i];
      len--;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%I64d\n", ans[i]);
  }
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:47:25: error: 'i' was not declared in this scope
   47 |     printf("%I64d\n", a[i]);
      |                         ^
Language: Java

import java.util.*;

class Main {
	static int N;
	static int[] a;
	static long[][] is;
	static long[] freq;
	static long[] cum;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();
		a = new int[N];
		is = new long[2][N];
		freq = new long[N + 1];
		cum = new long[N];
		Arrays.fill(is[0], -1);
		Arrays.fill(is[1], -1);
		Arrays.fill(freq, -1);
		for (int i = 0; i < N; ++i) {
			a[i] = sc.nextInt();
		}

		int p = 0;
		for (int i = 0; i < N; ++i) {
			if (i == 0 || is[0][p - 1] < a[i]) {
				is[0][p] = a[i];
				is[1][p] = i + 1;
				++p;
			}
		}
		is[0] = Arrays.copyOf(is[0], p);
		is[1] = Arrays.copyOf(is[1], p);
		Arrays.sort(a);
		for (int i = 0; i < N; ++i) {
			cum[i] = (i > 0 ? cum[i - 1] : 0) + a[i];
		}
		for (int i = p - 1; i >= 1; --i) {
			int t = binarySearch(a, is[0][i]);
			int s = binarySearch(a, is[0][i - 1]);
			freq[is[1][i]] = cum[t - 1] - cum[s] - (t - s - 1) * is[0][i - 1] + (N - t) * (is[0][i] - is[0][i - 1]);
		}
		int t = binarySearch(a, is[0][0]);
		freq[is[1][0]] = (t > 0 ? cum[t - 1] : 0) + (N - t) * is[0][0];

		for (int i = 1; i <= N; ++i) {
			System.out.println(Math.max(freq[i], 0));
		}
	}

	// 同じ数字が続いているときは一番後ろを返す。
	static int binarySearch(int[] a, int key) {
		int s = -1;
		int t = a.length;
		while (t - s > 1) {
			int m = (s + t) / 2;
			if (a[m] > key) {
				t = m;
			} else {
				s = m;
			}
		}
		if (a[s] != key)
			s *= -1;
		return s;
	}

	static void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}

Compiler output:
Main.java:39: error: incompatible types: possible lossy conversion from long to int
			int t = binarySearch(a, is[0][i]);
			                             ^
Main.java:40: error: incompatible types: possible lossy conversion from long to int
			int s = binarySearch(a, is[0][i - 1]);
			                             ^
Main.java:41: error: incompatible types: possible lossy conversion from long to int
			freq[is[1][i]] = cum[t - 1] - cum[s] - (t - s - 1) * is[0][i - 1] + (N - t) * (is[0][i] - is[0][i - 1]);
			          ^
Main.java:43: error: incompatible types: possible lossy conversion from long to int
		int t = binarySearch(a, is[0][0]);
		                             ^
Main.java:44: error: incompatible types: possible lossy conversion from long to int
		freq[is[1][0]] = (t > 0 ? cum[t - 1] : 0) + (N - t) * is[0][0];
		          ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
5 errors
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <functional>
#include <set>
#include <cmath>
#include <map>

using namespace std;

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

int main() {
	long long int n;
	cin >> n;
	vector<long long int> a(n, 0);
	vector<long long int> b(n, 0);
	set<long long int> st;
	map<long long int, long long int> mp;
	vector<P> v;
	for (long long int i = 0; i < n; i++) {
		cin >> a[i];
		mp[a[i]]++;
		if (st.find(a[i]) == st.end()) {
			v.push_back(P(a[i], i));
			st.insert(a[i]);
			//mp[a[i]]++;
		}
	}
	sort(v.begin(), v.end(), greater<P>());

	//cout << v[0].first << ' ' << v[0].second << endl;
	
	

	for (long long int i = 0; i+1 < v.size(); i++) {
		b[v[i].second] = (v[i].first-v[i+1].first)*mp[v[i].first];
		v[i+1].second = min(v[i+1].second, v[i].second);
		mp[v[i+1].first] += mp[v[i].first];
		//cout << v[i].first << ' ' << mp[v[i].first] << endl;
	}
	b[0] = n;
	for (long long int i = 0; i < n; i++) {
		cout << b[i] << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   30 |         sort(v.begin(), v.end(), greater<P>());
      |         ^~~~
      |         sqrt
Language: C

#include<stdio.h>

long long sum[100000];

typedef struct{
	long long a;
	long id;
} stone;
stone a[100000];

int cmp(const void *a, const void *b){
	if(((stone*)a)->a==((stone)*b)->a){
		return ((stone*)a)->id-((stone)*b)->id;
	}
	return ((stone*)a)->b-((stone)*b)->a;
}

int main(int argc, char const *argv[]) {
	long n,i;
	long long max,c;
	scanf("%ld",&n);
	for(i=0;i<n;i++){
		scanf("%lld",&a[i].a);
		a[i].id=i;
	}
	qsort(a,n,sizeof(stone),cmp);
	max=a[0].a;
	c=0
	for(i=0;i<n;i++){
		if(max==a[i].a) c++;
		else{
			s[a[0].id]+=c*(max-a[i].id);
			if(a[0].id>a[i].id) a[0].id=a[i].id;
			max=a[i].a;
			c=1;
		}
	}
	s[a[0].id]+=c*max;
	for(i=0;i<n;i++){
		printf("%lld\n",s[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'cmp':
main.c:12:36: warning: dereferencing 'void *' pointer
   12 |         if(((stone*)a)->a==((stone)*b)->a){
      |                                    ^~
main.c:12:29: error: invalid use of void expression
   12 |         if(((stone*)a)->a==((stone)*b)->a){
      |                             ^
main.c:13:48: warning: dereferencing 'void *' pointer
   13 |                 return ((stone*)a)->id-((stone)*b)->id;
      |                                                ^~
main.c:13:41: error: invalid use of void expression
   13 |                 return ((stone*)a)->id-((stone)*b)->id;
      |                                         ^
main.c:15:27: error: 'stone' has no member named 'b'
   15 |         return ((stone*)a)->b-((stone)*b)->a;
      |                           ^~
main.c:15:39: warning: dereferencing 'void *' pointer
   15 |         return ((stone*)a)->b-((stone)*b)->a;
      |                                       ^~
main.c:15:32: error: invalid use of void expression
   15 |         return ((stone*)a)->b-((stone)*b)->a;
      |                                ^
main.c: In function 'main':
main.c:26:9: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
   26 |         qsort(a,n,sizeof(stone),cmp);
      |         ^~~~~
main.c:28:12: error: expected ';' before 'for'
   28 |         c=0
      |            ^
      |            ;
   29 |         for(i=0;i<n;i++){
      |         ~~~ 
main.c:40:33: error: 's' undeclared (first use in this function)
   40 |                 printf("%lld\n",s[i]);
      |                                 ^
main.c:40:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <string.h>

#define MAX_N 100005
#define MAX_BIT 1000000000


long long max[MAX_N];
long long num[MAX_N];
long long nowMax;
long long solve(void);

int bit[MAX_BIT];

void addRange(long long l,long long r);
void add(long long a, int w);
long long sum(long long a);

long long n;
int main(int argc, const char * argv[]) {
    scanf("%lld",&n);
    nowMax = 0;
    memset(bit,0,sizeof(bit));
    for(int i=0;i<n;i++){
        long long k;
        scanf("%lld",&k);
        num[i]=k;
        max[i] = nowMax;
        if(nowMax < k){
            nowMax = k;
        }
        addRange(1,k);
    }
    for(int i=0;i<n;i++){
        if(num[i] > max[i])
            printf("%lld\n",(num[i]-max[i]) * sum(num[i]));
        else
            printf("0\n");
    }
    return 0;
}

void addRange(long long l,long long r){//Add 1 to the range (l,r] : l exclusive r inclusive
    add(l,1);
    add(r+1,-1);
}

void add(long long a, int w){
    for(long long x=a;x<=n;x+=x&-x)
        bit[x] += w;
}

long long sum(long long a){
    long long ret=0;
    for(long long x=a;x>0; x-=x&-x){
        ret += bit[x];
    }
    return ret;
}

Compiler output:
/tmp/ccjbqK8e.o: in function `main':
a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjbqK8e.o
a.cc:(.text+0xf2): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjbqK8e.o
a.cc:(.text+0x1cf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjbqK8e.o
/tmp/ccjbqK8e.o: in function `add(long long, int)':
a.cc:(.text+0x279): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccjbqK8e.o
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <string.h>

#define MAX_N 100005
#define MAX_BIT 1000000000


long long max[MAX_N];
long long num[MAX_N];
long long nowMax;
long long solve(void);

long long bit[MAX_BIT];

void addRange(long long l,long long r);
void add(long long a, int w);
long long sum(long long a);

long long n;
int main(int argc, const char * argv[]) {
    scanf("%lld",&n);
    nowMax = 0;
    memset(bit,0,sizeof(bit));
    for(int i=0;i<n;i++){
        long long k;
        scanf("%lld",&k);
        num[i]=k;
        max[i] = nowMax;
        if(nowMax < k){
            nowMax = k;
        }
        addRange(1,k);
    }
    for(int i=0;i<n;i++){
        if(num[i] > max[i])
            printf("%lld\n",(num[i]-max[i]) * sum(num[i]));
        else
            printf("0\n");
    }
    return 0;
}

void addRange(long long l,long long r){//Add 1 to the range (l,r] : l exclusive r inclusive
    add(l,1);
    add(r+1,-1);
}

void add(long long a, int w){
    for(long long x=a;x<=n;x+=x&-x)
        bit[x] += w;
}

long long sum(long long a){
    long long ret=0;
    for(long long x=a;x>0; x-=x&-x){
        ret += bit[x];
    }
    return ret;
}

Compiler output:
/tmp/ccson3rM.o: in function `main':
a.cc:(.text+0x13): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccson3rM.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccson3rM.o
a.cc:(.text+0x1d4): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccson3rM.o
/tmp/ccson3rM.o: in function `add(long long, int)':
a.cc:(.text+0x283): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccson3rM.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a);i<=(b);i++)
#define ROF(i,a,b) for(int i = (a);i>=(b);i--)
#define FR(i,a,b) for(int i = (a);i<(b);i++)
#define RF(i,a,b) for(int i = (a);i>(b);i--)
#define MST(a,x) memset(a,x,sizeof(a))
#define ll long long
#define PB push_back
#define PH push
#define MP make_pair
#define FT first
#define SD second
#define N 100005
#define M 51
#define INF 100000000000000007
#define MOD 1000000007
#define MOD2 1000000009
#define eps 1e-14
using namespace std;
inline int Max(int a,int b)
{
    return (((b-a)>>(32-1))&(a^b))^b;
}
inline int Min(int a,int b)
{
    return (((b-a)>>(32-1))&(a^b))^a;
}

ll a[N];
ll rmp[N];
pair<ll,int>b[N];
vector<ll>v;
void update(int p,pair<ll,int> x)
{
    while(p<N)
    {
        b[p].FT+=x.FT;
        b[p].SD+=x.SD;
        p+=p&-p;
    }
}
pair<ll,int> query(int p)
{
    pair<ll,int> ret = MP(0,0);
    while(p>0)
    {
        ret.FT+=b[p].FT;
        ret.SD+=b[p].SD;
        p-=p&-p;
    }
    return ret;
}
int main()
{
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        v.clear();
        FOR(i,1,n)
        {
            scanf("%I64d",&a[i]);
            v.PB(a[i]);
        }
        sort(v.begin(),v.end());
        int sz = unique(v.begin(),v.end())-v.begin();
        v.resize(sz);
        rmp[0] = 0;
        FOR(i,1,n)
        {
            int p = lower_bound(v.begin(),v.end(),a[i])-v.begin()+1;
            rmp[p] = a[i];
            update(p,MP(a[i],1));
        }
        int p1 = 0,p2 = 0;
        FOR(i,1,n)
        {
            int p = lower_bound(v.begin(),v.end(),a[i])-v.begin()+1;
            if(p<p2)
            {
                update(p,MP(-a[i],-1));
                printf("0\n");
                continue;
            }
            p1 = p2;
            p2 = p;
            //cout<<p1<<" "<<p2<<endl;
            pair<ll,int> x = query(p1);
            pair<ll,int> y = query(p2);
            int tot = ;
            //cout<<tot<<" ss "<<y.FT<<" "<<y.SD<<" "<<y.FT-y.SD*rmp[p1]<<" "<<tot-y.SD<<" "<<(rmp[p2]-rmp[p1])<<endl;
            printf("%I64d\n",y.FT-(y.SD-x.SD)*rmp[p1]-x.FT+(n-i+1-y.SD)*(rmp[p2]-rmp[p1]));
            update(p,MP(-a[i],-1));
        }

    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:89:23: error: expected primary-expression before ';' token
   89 |             int tot = ;
      |                       ^
Language: C++

#include <bits/stdc++.h>

#define fs first
#define sc second
#define mp make_pair

using namespace std;

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

const int N = 100009;

ii a[N];

ll t[N];
ll ans[N];

int main () {
        int n; scanf ("%d", &n);
        for (int i = 1; i <= n; i++) {
                scanf ("%d", &a[i].fs);
                a[i].sc = i;
        }
        sort (a + 1, a + n + 1, cmp);
        a[n + 1] = mp (0, n + 1);
        int now = n + 1;
        for (int i = 1; i <= n; i++) {
                now = min (now, a[i].sc);
                int j = i;
                while (j <= n && a[j].fs == a[i].fs) {
                        j++;
                }
                i = --j;
                ans[now] += (a[i].fs - a[i + 1].fs) * 1LL * i;
        }
        for (int i = 1; i <= n; i++) {
                printf ("%lld\n", ans[i]);
        }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:33: error: 'cmp' was not declared in this scope; did you mean 'bcmp'?
   25 |         sort (a + 1, a + n + 1, cmp);
      |                                 ^~~
      |                                 bcmp
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define N 10005
int n,m,rt,g,cnt,tot,nm,I,tp,x[N][2],y[N][2],id[N*10],he[N*10],ne[N*10],to[N*10],dfn[N*10],low[N*10],sc[N*10],in[N*10],st[N*10];vector<int>s[N*2];
struct nod{int x,d;friend int operator<(nod a,nod b){if(a.x!=b.x) return a.x<b.x;return a.d<b.d;}}t[N*2];
void add(int x,int y){to[cnt]=y;ne[cnt]=he[x];he[x]=cnt++;}
int Pd(int x){return upper_bound(t+1,t+m+2,(nod){x,1e9})-t;}
int Pu(int x){return lower_bound(t+1,t+m+2,(nod){x,0})-t-1;}
void bud(int x,int l,int r)
{
	id[x]=++tot;if(l==r){for(int i=0;i<s[l].size();i++) add(id[x],s[l][i]>n?s[l][i]-n:s[l][i]+n);return;}
	int mid=(l+r)>>1;bud(x*2,l,mid);bud(x*2+1,mid+1,r);add(id[x],id[x*2]);add(id[x],id[x*2+1]);
}
void upd(int x,int l,int r,int b,int e,int v)
{
	if(b>e) return;if(b<=l&&r<=e){add(v,id[x]);return;}int mid=(l+r)>>1;
	if(b<=mid) upd(x*2,l,mid,b,e,v);if(e>mid) upd(x*2+1,mid+1,r,b,e,v);
}
void dfs(int x)
{
    dfn[x]=low[x]=++I;in[x]=1;st[++tp]=x;
    for(int i=he[x],y;~i;i=ne[i]) if(!dfn[y=to[i]]) dfs(y),low[x]=min(low[x],low[y]);else if(in[y]) low[x]=min(low[x],dfn[y]);
    if(low[x]==dfn[x]){++nm;while(tp){sc[st[tp]]=nm;in[st[tp]]=0;if(st[tp--]==x) break;}}
}
int chk(int d)
{
	memset(id,0,sizeof(id));tot=2*n;memset(he,-1,sizeof(he));cnt=0;bud(1,1,m);
	for(int i=1;i<=n;i++) for(int j=0;j<2;j++)
	{
		upd(1,1,m,Pd(y[i][j]-d),x[i][j]-1,i+j*n),upd(1,1,m,x[i][j]+1,Pu(y[i][j]+d),i+j*n);
	}
	for(int i=1;i<=tot;i++) dfn[i]=low[i]=sc[i]=in[i]=0;I=tp=nm=0;
	for(int i=1;i<=tot;i++) if(!dfn[i]) dfs(i);
	for(int i=1;i<=n;i++) if(sc[i]==sc[i+n]) return 0;return 1;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%d%d",&x[i][0],&x[i][1]),t[++m]=(nod){x[i][0],i},t[++m]=(nod){x[i][1],i+n};
	memcpy(y,x,sizeof(x));sort(t+1,t+m+1);t[m+1]=(nod){1e9,1e9};
	for(int i=1;i<=n;i++) for(int j=0;j<2;j++) x[i][j]=lower_bound(t+1,t+m+1,(nod){x[i][j],i+j*n})-t,s[x[i][j]].push_back(i+j*n);
	for(int l=0,r=1e9,mid=(l+r)>>1;l<=r;mid=(l+r)>>1) if(chk(mid)) l=mid+1,g=mid;else r=mid-1;
	printf("%d\n",g);
}

Compiler output:
a.cc: In function 'int Pd(int)':
a.cc:7:52: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing]
    7 | int Pd(int x){return upper_bound(t+1,t+m+2,(nod){x,1e9})-t;}
      |                                                    ^~~
a.cc: In function 'int main()':
a.cc:40:60: error: narrowing conversion of '1.0e+9' from 'double' to 'int' [-Wnarrowing]
   40 |         memcpy(y,x,sizeof(x));sort(t+1,t+m+1);t[m+1]=(nod){1e9,1e9};
      |                                                            ^~~
Language: C++

#include <bits/stdc++.h>
#pragma GCC optimize("Ofast");
#define tm hdwusida
using namespace std;

int n;
int dm=0;
int x[10005], y[10005], f[20005];
vector<pair<int, pair<int, int> > > cor;
vector<int> adj[20005];
int low[20005], disc[20005];
bool instack[20005];
int lmao[10005][2];
int tm=0;
stack<int> st;

int find(int i)
{
	return f[i]==i?f[i]:f[i]=find(f[i]);
}

void unionn(int u, int v)
{
	f[find(u)]=find(v);
}

void scc(int u) 
{ 
    disc[u]=low[u]=++tm;
    st.push(u);
    instack[u] = true; 
    for(auto v:adj[u]) 
    {
        if(disc[v]==-1) 
        { 
        	scc(v);
            low[u]=min(low[u], low[v]); 
        } 
        else if(instack[v]==true)
        {
            low[u]=min(low[u], disc[v]); 
        }
    }
    if(low[u]==disc[u]) 
    { 
        while(st.top()!=u) 
        { 
            int v=st.top();
            unionn(u, v);
            instack[v]=false; 
            st.pop(); 
        } 
        instack[u]=false; 
        st.pop(); 
    } 
} 

bool check(int v)
{
	dm++;
	tm=0;
	for(int i=1; i<=2*n; i++)
	{
		f[i]=i;
		low[i]=-1;
		disc[i]=-1;
		adj[i].clear();
	}
	for(int i=0; i<2*n; i++)
	{
		int now=cor[i].first, id=cor[i].second.first+n*cor[i].second.second;
		for(int j=i-1; j>=0; j--)
		{
			if(cor[j].first<=now-v) break;
			adj[id].push_back(cor[j].second.first+(cor[j].second.second^1)*n);
		}
		for(int j=i+1; j<2*n; j++)
		{
			if(cor[j].first>=now+v) break;
			adj[id].push_back(cor[j].second.first+(cor[j].second.second^1)*n);
		}
	}
	for(int i=1; i<=2*n; i++)
	{
		if(disc[i]==-1) scc(i);
	}
	for(int i=1; i<=n; i++)
	{
		if(find(i)==find(i+n)) return false;
	}
	return true;
}

signed main()
{
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		cin>>x[i]>>y[i];
		if(x[i]>y[i]) swap(x[i], y[i]);
		cor.push_back({x[i], {i, 0}});
		cor.push_back({y[i], {i, 1}});
	}
	sort(cor.begin(), cor.end());
	int lo=0, hi=1e9;
	while(lo<hi)
	{
		int mid=(lo+hi+1)/2;
		if(check(mid))
		{
			lo=mid;
		}
		else
		{
			hi=mid-1;
		}
	}
	cout<<lo;
}

Compiler output:
a.cc:2:30: error: '#pragma GCC optimize' string is badly formed
    2 | #pragma GCC optimize("Ofast");
      |                              ^
Language: C++

#include <bits/stdc++.h>
#include <windows.h>
#define il inline
#define ri register int
#define pb push_back
#define mp make_pair
#define fir first
#define sec second
#define MAXN 100050
#define MAXM
#define MOD
#define INF (1<<25)
#define eps (1e-6)
#define mid ((l+r)>>1)
#define all_edge(u) for(vector <int> :: iterator it = adj[(u)].begin(); it != adj[(u)].end(); ++it)
using namespace std;
typedef long long LL;
typedef long double LD;
typedef pair <int, int> pii;
typedef pair <LL, int> pli;
typedef pair <int, LL> pil;
typedef pair <LL, LL> pll;
int n, ver[MAXN][2], dfn[MAXN<<7], low[MAXN<<7], st[MAXN<<7], ins[MAXN<<7], top, idcnt, ccnt, col[MAXN<<7], vcnt;
struct node {
	int pos, id, ty;
	bool operator < (const node &x) const {
		if(pos == x.pos) return id < x.id;
		return pos < x.pos;
	}
}a[MAXN<<2];
vector <int> adj[MAXN<<7];
void build(int u, int l, int r) {
	vcnt = max(vcnt, u+2*n);
	if(l == r) return adj[u+2*n].pb(a[l].id + (a[l].ty^1)*n);
	build(u<<1, l, mid), build(u<<1|1, mid+1, r);
	adj[u+2*n].pb((u<<1)+2*n), adj[u+2*n].pb((u<<1|1)+2*n);
}
void link(int u, int l, int r, int tl, int tr, int p) {
//	cout<<u<<' '<<l<<' '<<r<<' '<<tl<<' '<<tr<<' '<<p<<endl;
//	Sleep(100);
	if(tl > tr) return ;
	if(tl <= l && r <= tr) {
//		cout<<"link "<<p<<' '<<u+2*n<<endl;
		return adj[p].pb(u+2*n);
	}
	if(tl <= mid) link(u<<1, l, mid, tl, tr, p);
	if(mid < tr) link(u<<1|1, mid+1, r, tl, tr, p);
}
void tarjan(int u) {
	st[++top] = u, ins[u] = 1;
	dfn[u] = low[u] = ++idcnt;
	all_edge(u) {
		if(!dfn[*it]) tarjan(*it), low[u] = min(low[u], low[*it]);
		else if(ins[*it]) low[u] = min(low[u], dfn[*it]);
	}
	if(low[u] == dfn[u]) {
		int cur; ++ccnt;
		do {
			cur = st[top--], ins[cur] = 0;
			col[cur] = ccnt;
		} while(cur != u);
	}
}
bool check(int x) {
	int L, R; idcnt = ccnt = 0;
	for(ri i = 1; i <= n*2; ++i) adj[i].clear();
	for(ri i = 1; i <= vcnt; ++i) dfn[i] = low[i] = col[i] = 0;
//	cout<<"Checking dis of "<<x<<endl;
	for(ri i = 1; i <= n; ++i) {
//		cerr<<i<<endl;
		for(ri k = 0; k <= 1; ++k) {
			L = lower_bound(a+1, a+n*2+1, node {ver[i][k]-x+1, 0, 0})-a, R = lower_bound(a+1, a+n*2+1, node {ver[i][k]+x, 0, 0})-a-1;
			int pos = lower_bound(a+1, a+n*2+1, node {ver[i][k], i, 0})-a;
//			cerr<<ver[i][k]<<' '<<L<<' '<<pos<<' '<<R<<endl;
			link(1, 1, n*2, L, pos-1, i+k*n);
//			cerr<<"KUAIKULE"<<endl;
			link(1, 1, n*2, pos+1, R, i+k*n);
//			cerr<<"KELIAN"<<endl;
		}
	}
	for(ri i = 1; i <= n*2; ++i) if(!dfn[i]) tarjan(i);
	for(ri i = 1; i <= n; ++i) {
		if(col[i] == col[i+n]) return 0;
	}
	return 1;
}	
int main() {
//	freopen("1.out", "w", stdout);
	scanf("%d", &n);
	for(ri i = 1; i <= n; ++i) 
		scanf("%d%d", &ver[i][0], &ver[i][1]), a[i*2-1] = node {ver[i][0], i, 0}, a[i*2] = node {ver[i][1], i, 1};
	sort(a+1, a+n*2+1);
//	for(ri i = 1; i <= n*2; ++i) cout<<a[i].pos<<' '<<a[i].id<<' '<<a[i].ty<<endl;
	build(1, 1, n*2);
	int l = 0, r = 1e9, ans = 0;
	while(l <= r) {
		if(check(mid)) ans = mid, l = mid+1;
		else r = mid-1;
	}
	printf("%d", ans);
	return 0;
}

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

#include<stack>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,tot,etot,ans,_clock,cnt,head[100010],to[800010],nxt[800010],scc[100010],low[100010],dfn[100010],idx[80010];
stack<int>Stack;
struct node{
	int idx,val;
	friend bool operator<(node a,node b){
		return a.val<b.val;
	}
}a[20010];
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 add_edge(int u,int v){
	nxt[++tot]=head[u];
	to[tot]=v;
	head[u]=tot;
	return;
}
void build(int o,int l,int r){
	if(l==r){
		idx[o]=a[l].idx+(n<<1);
		return;
	}
	idx[o]=++etot;
	int mid=(l+r)>>1;
	build(o<<1,l,mid);
	build(o<<1|1,mid+1,r);
	add_edge(idx[o],idx[o<<1]);
	add_edge(idx[o],idx[o<<1|1]);
	return;
}
void update(int o,int l,int r,int L,int R,int u){
	if(L<=l&&r<=R){
		add_edge(u,idx[o]);
		return;
	}
	int mid=(l+r)>>1;
	if(L<=mid)
		update(o<<1,l,mid,L,R,u);
	if(R>mid)
		update(o<<1|1,mid+1,r,L,R,u);
	return;
}
void tarjan(int u){
	low[u]=dfn[u]=++_clock;										   
	Stack.push(u);
	for(int i=head[u];~i;i=nxt[i]){
		int v=to[i];
		if(!dfn[v]){
			tarjan(v);
			low[u]=min(low[u],low[v]);
		}
		else
			if(!scc[v])
				low[u]=min(low[u],dfn[v]);
	}
	if(low[u]==dfn[u]){
		cnt++;
		int x;
		do{
			x=Stack.top();
			Stack.pop();
			scc[x]=cnt;
		}while(x!=u);
	}
	return;
}
bool check(int m){
	memset(head,-1,sizeof(head));
	memset(scc,0,sizeof(scc));
	memset(low,0,sizeof(low));
	memset(dfn,0,sizeof(dfn));
	tot=0; 
	_clock=0;
	cnt=0;
	etot=(n<<2);
	build(1,1,n<<1);
	int l=1,r=1;
	for(int i=1;i<=n;i++){
		add_edge(i,i+n+(n<<1));
		add_edge(i+n+(n<<1),i);
		add_edge(i+(n<<1),i+n);
		add_edge(i+n,i+(n<<1));
	}
	for(int i=1;i<=(n<<1);i++){
		while(a[i].val-a[l].val+1>m&&l<i)
			l++;
		while(a[r+1].val-a[i].val+1<=m&&r<(n<<1))
			r++;
		if(l<i)
			update(1,1,(n<<1),l,i-1,a[i].idx);
		if(i<r)
			update(1,1,(n<<1),i+1,r,a[i].idx);
	}
	for(int i=1;i<=(n<<1);i++)
		if(!scc[i])
			tarjan(i);
	for(int i=1;i<=(n<<1);i++)
		if(scc[i]==scc[i+(n<<1)])
			return 0;
	return 1;
}
int main(){
	n=rd();
	for(int i=1;i<=n;i++){
		a[i].val=rd();
		a[i+n].val=rd();
	}
	for(int i=1;i<=(n<<1);i++)
		a[i].idx=i;
	sort(a+1,a+(n<<1)+1);
	int l=0,r=1e9;
	while(l<=r){
		int mid=(l+r)>>1;
		if(check(mid)){
			ans=mid;
			l=mid+1;
		}
		else r=mid-1;
	}
	printf("%d",ans);
	return 0;
}

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

#include<bits/stdc++.h>
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
typedef long long ll;
using namespace std;
inline int read(){
	int n=0;char c;
	for(c=getchar();c<'0'||c>'9';c=getchar());
	for(;c>='0'&&c<='9';c=getchar())n=n*10+c-48;
	return n;
}
const int maxn=2e4+5,mn=2e7+5,inf=2e7;
int i,j,n,num,ans,l,r,m,mx,x,y;
int k[maxn],next[mn],g[mn],cnt;
int dfn[maxn],low[maxn],q[maxn],cn,ct,cx,be[maxn];
bool bz[maxn];
struct ar{
	int x,id;
}a[maxn];
bool cmp(ar a,ar b){
	return a.x<b.x;
}
int re(int x){
	return (x<=n)?x+n:x-n;
}
void add(int x,int y){
	next[++cnt]=k[x],k[x]=cnt,g[cnt]=y;
}
void dfs(int x){
	int i;
	bz[x]=1;
	dfn[x]=low[x]=++cn,q[++ct]=x;
	for(i=k[x];i;i=next[i]){
		int y=g[i];
		if (!dfn[y]) dfs(y),low[x]=min(low[x],low[y]);else
		if (bz[y]) low[x]=min(low[x],dfn[y]);
	}
	if(dfn[x]==low[x]){
		cx++;
		for(;q[ct]!=x;ct--) be[q[ct]]=cx,bz[q[ct]]=0;
		be[x]=cx,bz[x]=0,ct--;
	}
}
bool check(){
	int i;
	cn=ct=0;
	memset(bz,0,sizeof(bz));
	memset(dfn,0,sizeof(dfn));
	fo(i,1,n<<1) if (!dfn[i]) dfs(i);
	fo(i,1,n) if(be[i]==be[i+n]) return 0;
	return 1;
}
int main(){
	n=read();
	fo(i,1,n) {
		a[++num].x=read(),a[num].id=i;
		a[++num].x=read(),a[num].id=i+n;
	}
	sort(a+1,a+1+num,cmp);
	mx=a[num].x;
	l=0,r=mx/(n-1);
	for(;l<r;){
		m=(l+r+1)>>1;
		memset(k,0,sizeof(k));
		cnt=0;
		fo(i,1,num-1){
			x=a[i].id;
			fo(j,i+1,num) if (a[j].x-a[i].x<m){ 
				y=a[j].id;
				if ((x-y)%n) add(x,re(y)),add(y,re(x));
				if (cnt==inf) break;
			}else break;
			if (cnt==inf) break;
		}
		if (cnt<inf&&check()) l=m;else r=m-1;
	}
	printf("%d\n",l);
}

Compiler output:
a.cc: In function 'void add(int, int)':
a.cc:29:9: error: reference to 'next' is ambiguous
   29 |         next[++cnt]=k[x],k[x]=cnt,g[cnt]=y;
      |         ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:16:13: note:                 'int next [20000005]'
   16 | int k[maxn],next[mn],g[mn],cnt;
      |             ^~~~
a.cc: In function 'void dfs(int)':
a.cc:35:24: error: reference to 'next' is ambiguous
   35 |         for(i=k[x];i;i=next[i]){
      |                        ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:16:13: note:                 'int next [20000005]'
   16 | int k[maxn],next[mn],g[mn],cnt;
      |             ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN=2e4+5;
const int MAXM=40000010;
const int MAX=40000000;
int n;
struct node
{
	int x,y;
}sv[MAXN];
struct Edge
{
	int to,next;
}edge[MAXM];
int head[MAXN],tot;
void init()
{
	tot=0;
	memset(head,-1,sizeof(head));
}
void addedge(int u,int v)
{
	edge[tot].to=v;edge[tot].next=head[u];head[u]=tot++;
} 
bool vis[MAXN];//染色标记，为true表示选择
int S[MAXN],top;//栈
bool dfs(int u)
{
	if(vis[u^1])return false;
	if(vis[u])return true;
	vis[u]=true;
	S[top++]=u;
	for(int i=head[u];i!=-1;i=edge[i].next)
		if(!dfs(edge[i].to))
			return false;
	return true;
}
bool Twosat(int n)
{			
	memset(vis,false,sizeof(vis));
	for(int i=0;i<n;i+=2)
	{
		if(vis[i]||vis[i^1])continue;
		top=0;
		if(!dfs(i))
		{
			while(top)vis[S[--top]]=false;
			if(!dfs(i^1)) return false;
		}
	}
	return true;
}
bool judge(int now)
{
	init();
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			int u,v;
			if(i==j)
			{
				continue;
			}
			if(abs(sv[i].x-sv[j].x)<now)
			{
				u=i*2,v=j*2;
				addedge(u,v^1);
				addedge(v,u^1);
			}
			if(abs(sv[i].x-sv[j].y)<now)
			{
				u=i*2,v=(j*2)^1;
				addedge(u,v^1);
				addedge(v,u^1);
			}
			if(abs(sv[i].y-sv[j].x)<now)
			{
				u=(i*2)^1,v=j*2;
				addedge(u,v^1);
				addedge(v,u^1);
			}
			if(abs(sv[i].y-sv[j].y)<now)
			{
				u=(i*2)^1,v=(j*2)^1;
				addedge(u,v^1);
				addedge(v,u^1);
			}
			if(tot>MAX)
				return;
		}
	}
	return Twosat(2*n);
}
int cnt=0;
int tmp[MAXN];
int main()
{
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%d%d",&sv[i].x,&sv[i].y);
		tmp[cnt++]=sv[i].x,tmp[cnt++]=sv[i].y;
	}
	sort(tmp,tmp+cnt);
	int l=1,r=1e9,ans=0;
	for(int i=0;i<n-1;i++)
	{
		r=min(r,tmp[i+n+1]-tmp[i]);
	}
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(judge(mid))
		{
			ans=max(ans,mid);
			l=mid+1;
		}
		else
		{
			r=mid-1;
		}
	}
	printf("%d\n",ans);
	return 0;
}



Compiler output:
a.cc: In function 'bool judge(int)':
a.cc:90:33: error: return-statement with no value, in function returning 'bool' [-fpermissive]
   90 |                                 return;
      |                                 ^~~~~~
Language: C++

/*************************************************************************
    > File Name: test.cpp
    > Author: Akira 
    > Mail: qaq.febr2.qaq@gmail.com 
 ************************************************************************/

#include<bits/stdc++.h>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
using namespace std;

#define MaxN 10010
#define MaxM MaxN*10
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626
const int mod = 1E9+7;
const double eps = 1e-6;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x;

struct TwoSAT
{
    int n;
    vector<int> G[MaxN*2];
    int S[MaxN*2],c;
    bool mark[MaxN*2];

    bool dfs(int x)
    {
        if(mark[x^1]) return false;
        if(mark[x]) return true;
        mark[x]=true;
        S[c++]=x;
        for(int i=0;i<G[x].size();i++)
            if(!dfs(G[x][i])) return false;
        return true;
    }

    void init(int n)
    {
        this->n=n;
        for(int i=0;i<n*2;i++) G[i].clear();
        memset(mark,0,sizeof(mark));
    }

    void add_clause(int x,int xval,int y,int yval)//这里做了修改,指x与y值有冲突
    {
        x=x*2+xval;
        y=y*2+yval;
        G[x].push_back(y^1);
        G[y].push_back(x^1);
    }

    bool solve()
    {
        for(int i=0;i<2*n;i+=2)if(!mark[i] && !mark[i+1])
        {
            c=0;
            if(!dfs(i))
            {
                while(c>0) mark[S[--c]]=false;
                if(!dfs(i+1)) return false;
            }
        }
        return true;
    }
}TS;
int N;
pair<int, int> loc[MaxN];
bool judge(int x)
{
    TS.init(N);
    for(int i=0;i<N;i++)
    {
        for(int j=i+1;j<N;j++)
        {
            if( abs(loc[i].first-loc[j].first) <x ) TS.add_clause(i,0,j,0);
            if( abs(loc[i].first-loc[j].second) <x ) TS.add_clause(i,0,j,1);
            if( abs(loc[i].second-loc[j].first) <x ) TS.add_clause(i,1,j,0);
            if( abs(loc[i].second-loc[j].second) <x ) TS.add_clause(i,1,j,1);
        }
    }
    if(TS.solve()) return true;
    else return false;
}

int main()
{
    //std::ios::sync_with_stdio(false);
    while(~scanf("%d", &N))
    {
        for(int i=0;i<N;i++) scanf("%d%d", &loc[i].first, &loc[i].second);
        int l = 0, r = 1E9+7;
        while(l<r)
        {
            int mid = ((l+r)>>1)+1;
            if(judge(mid)) 
            {
                l = mid;
                ans = mid;
            }
            else r = mid-1;
        }
        printf("%d\n", l);
    }
    //system("pause");
}


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

#include <bits/stdc++.h>
#define N 30010
using namespace std;
typedef long long ll;
inline ll read()
{
	ll x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}
struct edge
{
	int u,v,next;
}vs[N*30*2];
int n,st[N*7],ee,las,id[N],nd[N*7],idx[N];
ll X[N],Y[N],V[N];
int dfn[N*7],low[N*7],tim,vis[N*7],op[N],tot,bl[N*7];
stack <int> St;

inline void addedge(int u,int v)
{
	vs[++ee].v=v;vs[ee].next=st[u];st[u]=ee;
}

inline bool cmp(const int a,const int b)
{
	return V[a]<V[b];
}
void built(int l,int r,int rt)
{
	nd[rt]=++las;
	if(l==r)
	{
		addedge(nd[rt],op[l]);
		return ;
	}
	int mid=(l+r)>>1;
	built(l,mid,rt<<1);
	built(mid+1,r,rt<<1|1);
	addedge(nd[rt],nd[rt<<1]);
	addedge(nd[rt],nd[rt<<1|1]);
}
void linkedge(int L,int R,int x,int l,int r,int rt)
{
	if(L<=l&&r<=R)
	{
		addedge(x,nd[rt]);
		return ;
	}
	int mid=(l+r)>>1;
	if(mid>=L) linkedge(L,R,x,l,mid,rt<<1);
	if(mid<R) linkedge(L,R,x,mid+1,r,rt<<1|1);
}
void dfs(int rt)
{
	vis[rt]=1; dfn[rt]=low[rt]=++tim;
	St.push(rt);
	for(int i=st[rt];i;i=vs[i].next)
	{
		if(vis[vs[i].v])
		{
			low[rt]=min(low[rt],dfn[vs[i].v]);
		}
		else if(!dfn[vs[i].v])
		{
			dfs(vs[i].v);
			low[rt]=min(low[rt],low[vs[i].v]);
		}
	}
	if(low[rt]==dfn[rt])
	{
		++tot;
		while(St.top()!=rt)
		{
			bl[St.top()]=tot;
			vis[St.top()]=0;
			St.pop();
		}
		St.pop(); bl[rt]=tot; vis[rt]=0;
	}
}
bool check(ll x)
{
	memset(st,0,sizeof st);
	ee=0; las=n+n; tim=0;
	built(1,n+n,1);
	for(int i=1;i<=n+n;i++)
	{
		int pr=upper_bound(V+1,V+1+n+n,V[i]-x)-V;
		int nx=lower_bound(V+1,V+1+n+n,V[i]+x)-V-1;
		if(pr<i) linkedge(pr,i-1,i,1,n+n,1);
		if(nx>i) linkedge(i+1,nx,i,1,n+n,1);
	}
	for(int i=1;i<=las;i++) vis[i]=dfn[i]=low[i]=0；
	for(int i=1;i<=las;i++) if(!dfn[i]) dfs(i);
	for(int i=1;i<=n+n;i++) if(bl[i]==bl[op[i]]) return 0;
	return 1;
}
int main()
{
	//freopen("read.in","r",stdin);
	n=read();
	for(int i=1;i<=n;i++)
		X[i]=read(),Y[i]=read(),
		V[++V[0]]=X[i],id[V[0]]=V[0],
		V[++V[0]]=Y[i],id[V[0]]=V[0];
	sort(id+1,id+1+n+n,cmp);
	for(int i=1;i<=n+n;i++) idx[id[i]]=i;
	for(int i=1;i<=n+n;i++) op[i]=idx[(id[i]&1)? id[i]+1: id[i]-1];
	sort(V+1,V+1+n+n);
	ll l=0,r=1000000000,ans;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(check(mid)) ans=mid,l=mid+1;
		else r=mid-1;
	}
	printf("%lld\n",ans);
}

Compiler output:
a.cc: In function 'bool check(ll)':
a.cc:95:54: error: unable to find numeric literal operator 'operator""\U0000ff1b'
   95 |         for(int i=1;i<=las;i++) vis[i]=dfn[i]=low[i]=0；
      |                                                      ^~~
a.cc:96:21: error: 'i' was not declared in this scope
   96 |         for(int i=1;i<=las;i++) if(!dfn[i]) dfs(i);
      |                     ^
Language: C++

#include <bits/stdc++.h>
#define N 30010
using namespace std;
typedef long long ll;
inline ll read()
{
	ll x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}
struct edge
{
	int u,v,next;
}vs[N*30*2];
int n,st[N*7],ee,las,id[N],nd[N*7],idx[N];
ll X[N],Y[N],V[N];
int dfn[N*7],low[N*7],tim,vis[N*7],op[N],tot,bl[N*7];
stack <int> St;

inline void addedge(int u,int v)
{
	vs[++ee].v=v;vs[ee].next=st[u];st[u]=ee;
}

inline bool cmp(const int a,const int b)
{
	return V[a]<V[b];
}
void built(int l,int r,int rt)
{
	nd[rt]=++las;
	if(l==r)
	{
		addedge(nd[rt],op[l]);
		return ;
	}
	int mid=(l+r)>>1;
	built(l,mid,rt<<1);
	built(mid+1,r,rt<<1|1);
	addedge(nd[rt],nd[rt<<1]);
	addedge(nd[rt],nd[rt<<1|1]);
}
void linkedge(int L,int R,int x,int l,int r,int rt)
{
	if(L<=l&&r<=R)
	{
		addedge(x,nd[rt]);
		return ;
	}
	int mid=(l+r)>>1;
	if(mid>=L) linkedge(L,R,x,l,mid,rt<<1);
	if(mid<R) linkedge(L,R,x,mid+1,r,rt<<1|1);
}
void dfs(int rt)
{
	vis[rt]=1; dfn[rt]=low[rt]=++tim;
	St.push(rt);
	for(int i=st[rt];i;i=vs[i].next)
	{
		if(vis[vs[i].v])
		{
			low[rt]=min(low[rt],dfn[vs[i].v]);
		}
		else if(!dfn[vs[i].v])
		{
			dfs(vs[i].v);
			low[rt]=min(low[rt],low[vs[i].v]);
		}
	}
	if(low[rt]==dfn[rt])
	{
		++tot;
		while(St.top()!=rt)
		{
			bl[St.top()]=tot;
			vis[St.top()]=0;
			St.pop();
		}
		St.pop(); bl[rt]=tot; vis[rt]=0;
	}
}
bool check(ll x)
{
	memset(st,0,sizeof st);
	ee=0; las=n+n; tim=0;
	built(1,n+n,1);
	for(int i=1;i<=n+n;i++)
	{
		int pr=upper_bound(V+1,V+1+n+n,V[i]-x)-V;
		int nx=lower_bound(V+1,V+1+n+n,V[i]+x)-V-1;
		if(pr<i) linkedge(pr,i-1,i,1,n+n,1);
		if(nx>i) linkedge(i+1,nx,i,1,n+n,1);
	}
	for(int i=1;i<=las;i++) vis[i]=dfn[i]=low[i]=0
	for(int i=1;i<=las;i++) if(!dfn[i]) dfs(i);
	for(int i=1;i<=n+n;i++) if(bl[i]==bl[op[i]]) return 0;
	return 1;
}
int main()
{
	//freopen("read.in","r",stdin);
	n=read();
	for(int i=1;i<=n;i++)
		X[i]=read(),Y[i]=read(),
		V[++V[0]]=X[i],id[V[0]]=V[0],
		V[++V[0]]=Y[i],id[V[0]]=V[0];
	sort(id+1,id+1+n+n,cmp);
	for(int i=1;i<=n+n;i++) idx[id[i]]=i;
	for(int i=1;i<=n+n;i++) op[i]=idx[(id[i]&1)? id[i]+1: id[i]-1];
	sort(V+1,V+1+n+n);
	ll l=0,r=1000000000,ans;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(check(mid)) ans=mid,l=mid+1;
		else r=mid-1;
	}
	printf("%lld\n",ans);
}

Compiler output:
a.cc: In function 'bool check(ll)':
a.cc:95:55: error: expected ';' before 'for'
   95 |         for(int i=1;i<=las;i++) vis[i]=dfn[i]=low[i]=0
      |                                                       ^
      |                                                       ;
   96 |         for(int i=1;i<=las;i++) if(!dfn[i]) dfs(i);
      |         ~~~                                            
a.cc:96:21: error: 'i' was not declared in this scope
   96 |         for(int i=1;i<=las;i++) if(!dfn[i]) dfs(i);
      |                     ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

const int INF = 1 << 30;

int N, X[20000], Y[20000];
bitset< 20000 > graph[20000];

bool used[20000];
int cmp[20000];
int order[20000];
int ptr;

void dfs(int idx)
{
  if(used[idx]++) return;
  for(int i = 0; i < N * 2; i++) if(graph[idx][i]) dfs(i);
  order[ptr++] = idx;
}

void rdfs(int idx, const int cnt)
{
  if(~cmp[idx]) return;
  cmp[idx] = cnt;
  for(int i = 0; i < N * 2; i++) if(graph[i][idx]) rdfs(i, cnt);
}

bool cross(int s, int t, int g)
{
  if(s > t) swap(t, s);
  return (t - s < g);
}

bool check(int v)
{
  for(int i = 0; i < 2 * N; i++) graph[i].reset();

  for(int i = 0; i < N; i++) {
    for(int j = i + 1; j < N; j++) {
      if(cross(X[i], X[j], v)) {
        graph[i << 1][(j << 1) | 1] = true;
        graph[j << 1][(i << 1) | 1] = true;
      }
      if(cross(X[i], Y[j], v)) {
        graph[i << 1][j << 1] = true;
        graph[(j << 1) | 1][(i << 1) | 1] = true;
      }
      if(cross(Y[i], X[j], v)) {
        graph[(i << 1) | 1][(j << 1) | 1] = true;
        graph[j << 1][i << 1] = true;
      }
      if(cross(Y[i], Y[j], v)) {
        graph[(i << 1) | 1][j << 1] = true;
        graph[(j << 1) | 1][i << 1] = true;
      }
    }
  }
  memset(used, false, sizeof(used));
  memset(cmp, -1, sizeof(cmp));
  ptr = 0;
  for(int i = 0; i < 2 * N; i++) dfs(i);
  for(int i = ptr - 1; i >= 0; i--) rdfs(order[i], i);
  for(int i = 0; i < 2 * N; i += 2) if(cmp[i] == cmp[i + 1]) return (false);
  return (true);
}

int main()
{
  scanf("%d", &N);
  for(int i = 0; i < N; i++) {
    scanf("%d %d", &X[i], &Y[i]);
  }

  int ret = INF;
  for(int i = 0; i < N; i++) {
    for(int j = i + 1; j < N; j++) {
      int st = max({X[i] - X[j], X[i] - Y[j], Y[i] - X[j], Y[i] - Y[j]});
      st = max({st, X[j] - X[i], X[j] - Y[i], Y[j] - X[i], Y[j] - Y[i]});
      ret = min(ret, st);
    }
  }

  int low = 0, high = ret;
  while(high - low > 0) {
    int mid = (low + high + 1) >> 1;
    if(check(mid)) low = mid;
    else high = mid - 1;
  }

  cout << low << endl;
}

Compiler output:
a.cc: In function 'void dfs(int)':
a.cc:17:14: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   17 |   if(used[idx]++) return;
      |      ~~~~~~~~^
Language: C++

#include <cstdio>
#include <cstdlib>
#include <vector>
#include <algorithm>
using namespace std;

const int MAXN = 20001;
int dn;
vector<int> graph[MAXN];
int up[MAXN], visit[MAXN], vtime;
vector<int> stk;
int scc_idx[MAXN], scc_cnt;

void dfs(int nod) {
	up[nod] = visit[nod] = ++vtime;
	stk.push_back(nod);
	for (int next : graph[nod]) {
		if (visit[next] == 0) {
			dfs(next);
			up[nod] = min(up[nod], up[next]);
		}
		else if (scc_idx[next] == 0)
			up[nod] = min(up[nod], visit[next]);
	}
	if (up[nod] == visit[nod]) {
		++scc_cnt;
		int t;
		do {
			t = stk.back();
			stk.pop_back();
			scc_idx[t] = scc_cnt;
		} while (!stk.empty() && t != nod);
	}
}
// find SCCs in given directed graph
// O(V+E)
void get_scc() {
	vtime = 0;
	memset(visit, 0, sizeof(visit));
	scc_cnt = 0;
	memset(scc_idx, 0, sizeof(scc_idx));
	for (int i = 0; i < dn; ++i)
		if (visit[i] == 0) dfs(i);
}

int n;
int coord[10000][2];

bool chk(int lowerlimit) {
	for (int i = 0; i < n * 2; ++i) {
		graph[i].clear();
	}
	for (int i = 0; i < n; ++i) {
		for (int j = i + 1; j < n; ++j) {

			for (int a = 0; a < 2; ++a) {
				for (int b = 0; b < 2; ++b) {
					if (abs(coord[i][a] - coord[j][b]) < lowerlimit) {
						int nodei = i * 2 + a, nodej = j * 2 + b;
						//// nodei -> !nodej , nodej -> !nodei
						graph[nodei].push_back(nodej ^ 1);
						graph[nodej].push_back(nodei ^ 1);
					}
				}
			}
		}
	}

	dn = n * 2;
	get_scc();
	for (int i = 0; i < n; ++i) {
		if (scc_idx[i * 2] == scc_idx[i * 2 + 1]) {
			return false;
		}
	}
	return true;
}

void proc() {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf("%d %d", &coord[i][0], &coord[i][1]);
	}

	int left = 0, right = 100;
	while (left <= right) {
		int mid = ((long long)left + right) / 2;
		if (chk(mid)) {
			left = mid + 1;
		}
		else {
			right = mid - 1;
		}
	}
	printf("%d", right);
}

int main() {
	//freopen("input.txt", "r", stdin);
	proc();
	return 0;
}

Compiler output:
a.cc: In function 'void get_scc()':
a.cc:39:9: error: 'memset' was not declared in this scope
   39 |         memset(visit, 0, sizeof(visit));
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <algorithm>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <iostream.h> 
using namespace std; 
int main(){
	int a,b;
	cin>>a>>b;
	int flag = 0;
	if(a == 1 && b !=1){
		cout<<"Alice"<<endl;
		flag = 1;
	}else if(b == 1 && a !=1){
		cout<<"Bob"<<endl;
		flag = 1;
	}else if(a==1 && b==1){
		cout<<"Draw"<<endl;
		flag = 1;
	}
	if(flag == 0){
		if(a > b){
			cout<<"Alice"<<endl;
		}else if(b > a){
			cout<<"Bob"<<endl;
		}else{
			cout<<"Draw"<<endl;
		}
	}
	
}


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

#include<iostream>
using namespace std;

int main(){
  int a, b;
  cin >> a >> b;
  if(a = b){
    cout << "Draw";
  }
  else if(a != 1 && b != 1){
    if(a > b){
      cout << "Alice";
    }
    else{
      cout << "Bob";
    }
  }
  else if(a = 1||b = 1){
    if(a = 1){
      cout << "Alice";
    }
    else if(b = 1){
      cout << "Bob";
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: lvalue required as left operand of assignment
   18 |   else if(a = 1||b = 1){
      |               ~^~~