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

#include<cstdio>
#include<utility>
#include<algorithm>

using namespace std;

typedef pair<int,int> P;

const int MAX_N=100000;
const int MAX_V= 1000000000;

int N;
int X[MAX_N];
int L[MAX_V];

void input(){
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        scanf("%d%d",X+i,L+i);
    }
}

P ps[MAX_N];

int solve(){
    for (int i=0;i<N;i++){
        ps[i] = P(X[i]+L[i],X[i]-L[i]);
    }
    sort(ps,ps+N);
    
    int cur=-MAX_V;
    int ans = 0;
    for(int i=0;i<N;i++){
        if(cur<=ps[i].second){
            ans++;
            cur =ps[i].first;
        }
    }
    return ans;
}

int main(){
    input();
    int ans = solve();
    printf("%d\n",ans);
    return 0;
}



Compiler output:
/tmp/ccIF1gmG.o: in function `solve()':
a.cc:(.text+0x128): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccIF1gmG.o
a.cc:(.text+0x164): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccIF1gmG.o
a.cc:(.text+0x171): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccIF1gmG.o
a.cc:(.text+0x1a4): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccIF1gmG.o
a.cc:(.text+0x1c4): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccIF1gmG.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<string>
#include<time.h>
#include<list>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<bitset>
#include <queue>
#include <map>

using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;

#define rep(i, n) for(int i = 0; i < n; ++i)

int main() {
    int n;
    cin >> n;
    vector<pair<ll, ll>> a;
    rep(i, n) {
        ll x, l;
        cin >> x >> l;
        a.push_back(pair<ll, ll>(x - l, x + l));
    }
    sort(a.begin(), a.end(), [](const pair<ll, ll>& a, const pair<ll, ll>& b) {return a.second < b.second; });
    ll cur = LONG_MIN;
    int ret = 0;
    rep(i, n) {
        if (a[i].first >= cur) {
            ++ret;
            cur = a[i].second;
        }
    }
    cout << ret << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: 'LONG_MIN' was not declared in this scope
   35 |     ll cur = LONG_MIN;
      |              ^~~~~~~~
a.cc:17:1: note: 'LONG_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   16 | #include <map>
  +++ |+#include <climits>
   17 |
Language: C++

#include <cstdio>
#include <algorithm>
using std::cin;
using std::cout;
using std::endl;
using std::pair;
using std::make_pair;

const int MAXN = 100010;
pair <int , int > robot[MAXN];
int n, x, l;
int main(){
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i){
		scanf("%d%d", &x, &l);
		robot[i] = make_pair(x - l + 1, x + l - 1);
	}
	int ans = 0;
	sort(robot + 1, robot + n + 1);
	pair <int , int > prep = make_pair(0x80000000, 0x80000000);
	for(int i = 1; i <= n ; ++i)
	if(robot[i].first > prep.second)
	prep = robot[i], ++ans;
	else if (robot[i].second < prep.second)
	prep = robot[i];
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:3:12: error: 'cin' has not been declared in 'std'
    3 | using std::cin;
      |            ^~~
a.cc:4:12: error: 'cout' has not been declared in 'std'
    4 | using std::cout;
      |            ^~~~
a.cc:5:12: error: 'endl' has not been declared in 'std'
    5 | using std::endl;
      |            ^~~~
a.cc: In function 'int main()':
a.cc:26:9: error: 'cout' was not declared in this scope
   26 |         cout << ans << endl;
      |         ^~~~
a.cc:26:24: error: 'endl' was not declared in this scope
   26 |         cout << ans << endl;
      |                        ^~~~
Language: C++

#include <bits/stdc++.h>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;


int main() {
    cin >> N;
    vector<pair<int,int>> arm(N);
    rep(i,N){
        cin >> x[i] >> l[i];
        arm[i] = make_pair(x[i]+l[i], x[i]-l[i]);
    }
    sort(arm.begin(),arm.end());
    rep(i,N){
        if(h<=arm[i].second) h = arm[i].second;
        else cn++;
    }
    cout << N-cn << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'N' was not declared in this scope
    9 |     cin >> N;
      |            ^
a.cc:12:16: error: 'x' was not declared in this scope
   12 |         cin >> x[i] >> l[i];
      |                ^
a.cc:12:24: error: 'l' was not declared in this scope
   12 |         cin >> x[i] >> l[i];
      |                        ^
a.cc:17:12: error: 'h' was not declared in this scope
   17 |         if(h<=arm[i].second) h = arm[i].second;
      |            ^
a.cc:18:14: error: 'cn' was not declared in this scope; did you mean 'yn'?
   18 |         else cn++;
      |              ^~
      |              yn
a.cc:20:15: error: 'cn' was not declared in this scope; did you mean 'yn'?
   20 |     cout << N-cn << endl;
      |               ^~
      |               yn
Language: C++

#include <bits/stdc++.h>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;


int main() {
    ll x[10010],l[10010],h=-999,cn=0,N;
    cin >> N;
    vector<pair<int,int>> arm(N);
    rep(i,N){
        cin >> x[i] >> l[i];
        arm[i] = make_pair(x[i]+l[i], x[i]-l[i]);
    }
    sort(arm.begin(),arm.end());
    rep(i,N){
        if(h<=arm[i].second)
        else cn++;
    }
    cout << N-cn << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected primary-expression before 'else'
   19 |         else cn++;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
#include <string>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
vector<vector<char>> table(10,vector<char>(10));
vector<vector<bool>> seen(10,vector<bool>(10));

int main() {
    int N;
    cin >> N;
    int x[10010],l[10010],h=-999,cn=0;
    vector<pair<int,int>> arm(N);
    rep(i,N){
        cin >> x[i] >> l[i];
        arm[i] = make_pair(x[i]+l[i], x[i]-l[i])
    }
    sort(arm.begin(),arm.end());
    rep(i,N){
        if(h<=arm[i].second){
            h = arm[i].first;
        }else{
            cn++;
        }
    }
    cout << N-cn << endl;
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:15:49: error: expected ';' before '}' token
   15 |         arm[i] = make_pair(x[i]+l[i], x[i]-l[i])
      |                                                 ^
      |                                                 ;
   16 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
const int maxn=1e6;
const int maxv=1e9;
int n;
int x[maxn],l[maxn];

int main() {
    cin >> n;
    P ps[maxn];
    for(int i=0;i<n;i++){
        cin >> x[i] >> l[i];
        ps[i]=make_pair(x[i]+l[i],x[i]-l[i]);
    }
    sort(ps,ps+n);
    int cur=-maxv;
    int ans=0;
    for(int i=0;i<n;i++){
        if(cur<=ps[i].second){
            ans++;
            cur=ps.first;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:20: error: request for member 'first' in 'ps', which is of non-class type 'P [1000000]' {aka 'std::pair<int, int> [1000000]'}
   22 |             cur=ps.first;
      |                    ^~~~~
Language: C++

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

const int maxn=1e6;
const int maxv=1e9;
int n;
int x[maxn],l[maxn];

int main() {
    cin >> n;
    pair<int,int> ps[maxn];
    for(int i=0;i<n;i++){
        cin >> x[i] >> l[i];
        ps[i].first=x[i]+l[i];
        ps[i].second=x[i]-l[i];
    }
    sort(ps,ps+n);
    int cur=-maxv;
    int ans=0;
    for(int i=0;i<n;i++){
        if(cur<=ps[i].second){
            ans++;
            cur=ps.first;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:20: error: request for member 'first' in 'ps', which is of non-class type 'std::pair<int, int> [1000000]'
   23 |             cur=ps.first;
      |                    ^~~~~
Language: C++

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

typedef pair<int,int> P;

const int maxn=1e6;
const int maxv=1e9;
int n;
int x[maxn],l[maxn];

int main() {
    cin >> n;
    pair<int,int> ps[maxn];
    for(int i=0;i<n;i++){
        cin >> x[i] >> l[i];
        ps[i].first=x[i]+l[i];
        ps[i].second=x[i]-l[i];
    }
    sort(ps,ps+n);
    int cur=-maxv;
    int ans=0;
    for(int i=0;i<n;i++){
        if(cur<=ps[i].second){
            ans++;
            cur=ps.first;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: request for member 'first' in 'ps', which is of non-class type 'std::pair<int, int> [1000000]'
   25 |             cur=ps.first;
      |                    ^~~~~
Language: C++

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

typedef pair<int,int> P;

const int maxn=1e6;
const int maxv=1e9;
int n;
int x[maxn],l[maxn];

int main() {
    cin >> n;
    P ps[maxn];
    for(int i=0;i<n;i++){
        cin >> x[i] >> l[i];
        ps[i].first=x[i]+l[i];
        ps[i].second=x[i]-l[i];
    }
    sort(ps,ps+n);
    int cur=-maxv;
    int ans=0;
    for(int i=0;i<n;i++){
        if(cur<=ps[i].second){
            ans++;
            cur=ps.first;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:20: error: request for member 'first' in 'ps', which is of non-class type 'P [1000000]' {aka 'std::pair<int, int> [1000000]'}
   25 |             cur=ps.first;
      |                    ^~~~~
Language: C++

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

typedef pair<int,int> P;

const int maxn=1e6;
const int maxv=1e9;
int n;
int x[maxn],l[maxn];

int main() {
    cin >> n;
    P ps[maxn];
    for(int i=0;i<n;i++){
        cin >> x[i] >> l[i];
        ps[i]=P(x[i]+l[i],x[i]-l[i]);
    }
    sort(ps,ps+n);
    int cur=-maxv;
    int ans=0;
    for(int i=0;i<n;i++){
        if(cur<=ps[i].second){
            ans++;
            cur=ps.first;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:20: error: request for member 'first' in 'ps', which is of non-class type 'P [1000000]' {aka 'std::pair<int, int> [1000000]'}
   24 |             cur=ps.first;
      |                    ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int f(vector<pair<int,int>>&S,int&MAX,int&N,int&p){
  while(p<N&&S.at(p).first<MAX)p++;
  if(p>=N)return 0;
  p++;
  else return max(1+f(S,S.at(p-1).second,N,p),f(S,MAX,N,p));
}
int main(){
  int N,X,L,p=0;cin>>N;
  vector<pair<int,int>>S(N);
  for(int i=0;i<N;i++){
    cin>>X>>L;
    S.at(i)=make_pair(X-L,X+L);
  }
  sort(S.begin(),S.end());
  cout<<f(S,S.at(0).first,N,p)<<endl;
}

Compiler output:
a.cc: In function 'int f(std::vector<std::pair<int, int> >&, int&, int&, int&)':
a.cc:7:3: error: 'else' without a previous 'if'
    7 |   else return max(1+f(S,S.at(p-1).second,N,p),f(S,MAX,N,p));
      |   ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  map<int,int>m;
  int flag=0,count=n;
  for(int i=0;i<n;i++)
  {
    a[i]=0;
  } 
  for(int i=0;i<n;i++)
  {
    int x,l;
    cin>>x>>l;
    m[x]=l;
    for(int i=x;i<x+l;i++)
    {
    if(a[i]==1)
    {
      --count;
      break;
    }
    else
      a[i]=1;
  }
   /*for(int i=x-l-1;i<x;i++)
   {
     if(a[i]==1)
     {
       count--;
       break;
     }
     else
       a[i]=1;
   }*/
   cout<<count;
    return 0;
 }
    
    
 
    
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:41:3: error: expected '}' at end of input
   41 |  }
      |   ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int> P;

const int MAX_N = 100000;
const int MAX_V = 1000000000;
int N;
int X[MAX_N];
int L[MAX_V];



P ps[MAX_N];

int solve(){
  for(int i = 0; i < N; i++){
    ps[i] = P(X[i] + L[i], X[i] - L[i]);
  }

  sort(ps,ps + N);
  int cur = -MAX_V;
  int ans = 0;
  for(int i = 0; i < N; i++){
    if(cur <= ps[i].second){
      ans++;
      cur = ps[i].first;
    }
  }

  return ans;
}


int main(){
  
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> X[i] >> L[i];
  }
  int ans = solve();
  cout << ans;

  return 0;
}

Compiler output:
/tmp/ccduxe4b.o: in function `solve()':
a.cc:(.text+0xa1): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccduxe4b.o
a.cc:(.text+0xdd): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccduxe4b.o
a.cc:(.text+0xea): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccduxe4b.o
a.cc:(.text+0x11d): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccduxe4b.o
a.cc:(.text+0x13d): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccduxe4b.o
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef pair<int,int> P;

const int MAX_N = 100000;
const int MAX_V = 1000000000;
int N;
int X[MAX_N];
int L[MAX_V];

void input(){
  cin >> N;
  for(int i = 0; i < N; i++){
    cin >> X[i] >> L[i];
  }
}

P ps[MAX_N];

int solve(){
  for(int i = 0; i < N; i++){
    ps[i] = P(X[i] + L[i], X[i] - L[i]);
  }

  sort(ps,ps + N);
  int cur = -MAX_V;
  int ans = 0;
  for(int i = 0; i < N; i++){
    if(cur <= ps[i].second){
      ans++;
      cur = ps[i].first;
    }
  }

  return ans;
}


int main(){
  input();
  int ans = solve();
  cout << ans;

  return 0;
}

Compiler output:
/tmp/ccvxkuFF.o: in function `solve()':
a.cc:(.text+0x12c): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccvxkuFF.o
a.cc:(.text+0x168): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccvxkuFF.o
a.cc:(.text+0x175): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccvxkuFF.o
a.cc:(.text+0x1a8): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccvxkuFF.o
a.cc:(.text+0x1c8): relocation truncated to fit: R_X86_64_PC32 against symbol `ps' defined in .bss section in /tmp/ccvxkuFF.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef long long ll;
const ll INF = 1e18L + 1;

bool comp(ii p1, ii p2)
{
  return (p1.first + p1.second) < (p2.first + p2.second);
}

int main()
{
  int N;
  cin >> N;
  vector<ii> pos(N);
  rep(i, N)
  {
    int a, b;
    cin >> a >> b;
    pos[i] = make_pair(a, b);
  }
  sort(pos.begin(), pos.end(), comp);

  int rightMost = pos[0].first + pos[0].second;
  int ans = N;
  for (int i = 1; i < N; i++)
  {
    if (pos[i].first - pos[i].second < rightMost)
    {
      ans--;
    }
    else
    {
      rightMost = pos[i].first + pos[i].second;
    }
  }
  cout << ans << endl;
  return 0;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:48:12: error: expected '}' at end of input
   48 |   return 0;
      |            ^
a.cc:22:1: note: to match this '{'
   22 | {
      | ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<pair<int, int>> XL(N);
    for(int i=0; i<N; i++){
        cin >> XL.at(i).first >> XL.at(i).second;
        XL.at(i).first += XL.at(i).second;
    }
    sort(XL.begin(), XL.end());
    int count=1;
    int last=0;
    for(int i=0; i<N; i++){
        if (XL.at(last).first <= XL.at(i).first - 2 * XL.at(i).second){
            last = i;
            count++;
        }
    }
    cout << count << endl;
}

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

#include<iostream>
#include<vector>

using namespace std;

int main(){
    int N;
    cin >> N;
    vector<vector<int>> XL(N, vector<int>(2));
    for(int i=0; i<N; i++){
        cin >> XL.at(i).at(0) >> XL.at(i).at(1);
        XL.at(i).at(0) += XL.at(i).at(1);
    }
    sort(XL.begin(), XL.end());
    int count=1;
    int last=0;
    for(int i=0; i<N; i++){
        if (XL.at(last).at(0) <= XL.at(i).at(0) - 2 * XL.at(i).at(1)){
            last = i;
            count++;
        }
    }
    cout << count << endl;
}

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

#include <iostream>
#include <vector>
using namespace std;
const int N=100000+10;

int n;
int x[N],l[N];
struct Item {
    int l,r;
    bool operator<(const Item&o)const{
        return r<o.r;
    }
} it[N];
int main() {
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d%d",&x[i],&l[i]);
        it[i]=(Item){x[i]-l[i],x[i]+l[i]};
    }
    sort(it+1,it+1+n);
    int las=-1e9,ans=0;
    for(int i=1;i<=n;i++){
        //printf("[%d,%d]\n", it[i].l,it[i].r);
        if(it[i].l>=las){
            las=it[i].r; ans++;
        }
    }
    cout<<ans<<endl;
}


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

#include<bits/stdc++.h>
using namespace std;
#define int long long 
int main(){
    int n;
    cin >> n;
    vector<pair<int,int>> a(n);
    for(int i = 0; i < n; i++){
        int b,c;
        cin >> b >> c;
        a[i] = make_pair(b + c,b - c);
    }
    sort(a.begin(),a.end());
    int ans = 0;
    int t = -1e9 - 1;
    for(int i = 0; i < n; i++){
        if(t < a[i].second){
            ans++;
            t = a[i].first;
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include <stdlib.h>
#include <stdio.h>
typedef struct{
    long long pos;
    long long len;
}pair;
int compare(const void *a,const void *b){
    pair x=*(pair *)a,y=*(pair *)b;
    long long p=x.pos+x.len,q=y.pos+y.len;
    return p>q?1:-1;
}
int main()
{   int n;
    scanf("%d",&n);
    pair a[n];
    for(int i=0;i<n;i++){
        scanf("%lld%lld",&a[i].pos,&a[i].len);
    }
    qsort(a,n,sizeof(pair),compare);
    long long max=-2000000005.len-1,ans=0;
    //printf("%d %d\n",a[0].pos,a[0].len);
    for(int i=0;i<n;i++){
        //printf("%d %d\n",a[i].pos,a[i].len);
        if(a[i].pos-a[i].len+1>max){
            ans++;
            max=a[i].pos+a[i].len-1;
        }
    }
    printf("%lld",ans);

    return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:20: error: invalid suffix "len" on floating constant
   20 |     long long max=-2000000005.len-1,ans=0;
      |                    ^~~~~~~~~~~~~~
Language: C++

n = int(input())
LeftEnd = [0 for i in range(n)]
Center = [0 for i in range(n)]
RightEnd = [0 for i in range(n)]
for i in range(n):
  robot, arm = map(int, input().split())
  LeftEnd[i] = robot - arm
  Center[i] = robot
  RightEnd[i] = robot + arm

now_rightend = min(RightEnd)

for counter in range(n):
  next_candidates = [RightEnd[i] for i, v in enumerate(LeftEnd) if v >= now_rightend]
  if not next_candidates:
    break
  now_rightend = min(next_candidates)

print(counter+1)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<cstdio>
#include<utility>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
const int MAX_N = 100000;
const int MAX_V = 1000000000;
int N;
int X[MAX_N];
int L[MAX_N];
void input(){
scanf("%d", &N);
for(int i = 0; i < N; ++i){
scanf("%d%d", X + i, L + i);
}
}
P ps[MAX_N];
int solve(){
for(int i = 0; i < N; ++i){
ps[i] = P(X[i] + L[i], X[i] - L[i]);
}
sort(ps, ps + N);
int cur = -MAX_V;
int ans = 0;
for(int i = 0; i < N; ++i){
if(cur >= ps[i].first){
ans++;
cur = ps[i].second;
}
}
return ans;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#include <stdlib.h>

int main(){
  int n,count_n;
  int *robot,*arm,*flag;
  int i,j;
  int temp,now;
  
  scanf("%d",&n);
  count_n=n;
  robot=(int*)malloc(sizeof(int)*n);
  arm=(int*)malloc(sizeof(int)*n);
  flag=(int*)malloc(sizeof(int)*n);
  
  for(i=0;i<n;i++){
    scanf("%d %d",&robot[i],&arm[i]);
    flag[i]=0;
  }
  
  for(i=n;i>0;i--){
    for(j=0;j<i-1;j++){
      if(robot[j]>robot[j+1]){
        temp=robot[j];
        robot[j]=robot[j+1];
        robot[j+1]=temp;
        
        temp=arm[j];
        arm[j]=arm[j+1];
        arm[j+1]=temp;
      }
    }
  }
  
  now=0;
  for(j=1;j<n;j++){
    if((robot[now]+arm[now]-1)>=(robot[j]-arm[j]+1)){
      count--;
    } else {
      now=j;
    }
  }
  
  printf("%d",count_n);
}
          


Compiler output:
main.c: In function 'main':
main.c:38:7: error: 'count' undeclared (first use in this function); did you mean 'count_n'?
   38 |       count--;
      |       ^~~~~
      |       count_n
main.c:38:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <bits/stdc++.h>
using namespace std;
struct node
{
    int a,b,vis;
}f[100010];
int cmp(node x,node y)
{
    return f[x].a>f[y].a;
    return f[x].b>f[y].b;
}
long long n,ans=0;
int main()
{
    cin>>n;
    for(int i=0; i<n; i++) cin>>f[i].a>>f[i].b;
    sort(f,f+m+1,cmp);
    for(int i=n-1; i>=0; i--)
    {
        for(int j=0; j<n; j++)
        {
            if(abs(f[i].a-f[j].a)<f[i].b+f[j].b && f[i].vis!=0 && i>=j)
            {
                ans++;
                f[i].vis=1;
            }
        }
    }
    cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int cmp(node, node)':
a.cc:9:13: error: no match for 'operator[]' (operand types are 'node [100010]' and 'node')
    9 |     return f[x].a>f[y].a;
      |             ^
a.cc:9:20: error: no match for 'operator[]' (operand types are 'node [100010]' and 'node')
    9 |     return f[x].a>f[y].a;
      |                    ^
a.cc:10:13: error: no match for 'operator[]' (operand types are 'node [100010]' and 'node')
   10 |     return f[x].b>f[y].b;
      |             ^
a.cc:10:20: error: no match for 'operator[]' (operand types are 'node [100010]' and 'node')
   10 |     return f[x].b>f[y].b;
      |                    ^
a.cc: In function 'int main()':
a.cc:17:14: error: 'm' was not declared in this scope; did you mean 'tm'?
   17 |     sort(f,f+m+1,cmp);
      |              ^
      |              tm
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
  int n;
  cin>>n;
  pair<ll,ll>a[n];
  for(int i=0;i<n;i++)
    cin>>a[i].first>>a[i].second;
  sort(a,a+n);
  int c=0;
  int prev=-1;
  for(int i=0;i<n;i++)
  {
    if(i!=0)
    {
      if(a[prev].first+a[prev].second-1>=a[i].first-a[i].second+1)
        c++,continue;
    }
    prev++;
  }
  int cnt=0;
  prev=n-1;
  for(int i=n-2;i>=0;i--)
  {
    if(a[prev].first-a[prev].second+1<=a[i].first+a[i].second-1)
    {
      cnt++;
      continue;
    }
    prev--;
  }
  c=min(c,cnt);
  int ans=n-c;
  cout<<ans<<"\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: expected primary-expression before 'continue'
   19 |         c++,continue;
      |             ^~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main() {
 	int n;
  	cin >> n;
  	pair<int, int> a[n];
  	for (int i = 0; i < n; i++) {
    	int x, l;
      	cin >> x >> l;
      	a[i] = {x + l, x - l};
    }
  	sort(a, a + n);
  	int end = -(1e9 + 2);
  	int ans = 0;
  	for (auto x : a) {
    	if (x.first >= end) {
        	ans++;
          	begin = x.second;
        }
    }
  	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:27: error: overloaded function with no contextual type information
   20 |                 begin = x.second;
      |                           ^~~~~~
Language: Java

mport java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[][] inter = new int[N][2];
        int a,l;

        for (int i = 0; i < N; i++) {
           a = sc.nextInt();
           l = sc.nextInt();
           inter[i][0] = a-l;
           inter[i][1] = a+l;
        }

        int res = 0;
        int now = -9999999;

        Arrays.sort(inter, (x, y) -> Integer.compare(x[1], y[1]));

        for (int i = 0; i < N; i++) {
            if (now > inter[i][0]) continue;
            res++;
            now = inter[i][1];
        }

        System.out.println(res);

    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ld long double

int main()
{
    ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
    int n;
    cin >> n;
    vector< pair<int, int> > v;
    for(int i=0;i<n;i++) {
        int x, l;
        cin >> x >> l;
        v.push_back(pair<int, int>(x + l, x - l));
    }
    sort(v.begin(), v.end());
    int ans = 0;s
    int idx = -INT_MAX / 2;
    for(auto x : v) {
        if(x.second >= idx) {
            ans++;
            idx = x.first;
        }
    }
    cout << ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 's' was not declared in this scope
   19 |     int ans = 0;s
      |                 ^
a.cc:22:24: error: 'idx' was not declared in this scope
   22 |         if(x.second >= idx) {
      |                        ^~~
Language: C

#include<cstdio>
#include<utility>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
const int MAX_N = 100000;
const int MAX_V = 1000000000;
int N;
int X[MAX_N];
int L[MAX_N];
void input(){
scanf("%d", &N);
for(int i = 0; i < N; ++i){
scanf("%d%d", X + i, L + i);
}
}
P ps[MAX_N];
int solve(){
for(int i = 0; i < N; ++i){
ps[i] = P(X[i] + L[i], X[i] - L[i]);
}
sort(ps, ps + N);
int cur = -MAX_V;
int ans = 0;
for(int i = 0; i < N; ++i){
if(cur <= ps[i].second){
ans++;
cur = ps[i].first;
}
}
return ans;
}
int main(){
input();
int ans = solve();
printf("%d\n", ans);
return 0;
}

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

#include<cstdio>
#include<utility>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
const int MAX_N = 100000;
const int MAX_V = 1000000000;
int N;
int X[MAX_N];
int L[MAX_N];
void input(){
scanf("%d", &N);
for(int i = 0; i < N; ++i){
scanf("%d%d", X + i, L + i);
}
}
P ps[MAX_N];
int solve(){
for(int i = 0; i < N; ++i){
2
ps[i] = P(X[i] + L[i], X[i] - L[i]);
}
sort(ps, ps + N);
int cur = -MAX_V;
int ans = 0;
for(int i = 0; i < N; ++i){
if(cur <= ps[i].second){
ans++;
cur = ps[i].first;
}
}
return ans;
}
int main(){
input();
int ans = solve();
printf("%d\n", ans);
return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main(){
ll n;
cin>>n;
 vector<pair<ll,ll> > v;
ll x,l,a[n+1]={0},b[n+1]={0};
for(ll i=0;i<n;i++){
cin>>x>>l;
v.push_back({x+l,x-l});
}
ll now=-(1e18);
ll ans=0;
sort(v.begin(),v.end());
for(ll i=0li<n;i++)
{
	if(now<=v[i].second)
    {
      ans++;
      now=v[i].first;
    }
}
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: invalid operands of types '__complex__ long int' and 'long long int' to binary 'operator<'
   16 | for(ll i=0li<n;i++)
      |          ~~~^~
      |          |   |
      |          |   long long int
      |          __complex__ long int
a.cc:16:19: error: expected ';' before ')' token
   16 | for(ll i=0li<n;i++)
      |                   ^
      |                   ;
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);				
		int a = sc.nextInt();		
		int robot[][] = new int[a][2];		
		for(int i=0;i<n;i++) {
			int b = sc.nextInt(), c = sc.nextInt();
			robot[i][0] = b-c;
			robot[i][1] = b+c;
		}		
		Arrays.sort(robot, Comparator.comparingInt(arr -> arr[1]));
		
		int d = 0;
		int e = Integer.MIN_VALUE;
		for(int i=0;i<a;i++) {
			if(robot[i][0] >= e) {
				d++;
				e = robot[i][1];
			}
		}		
		System.out.println(d);				
	} 
}


Compiler output:
Main.java:9: error: cannot find symbol
		for(int i=0;i<n;i++) {
		              ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);				
		int a = sc.nextInt();		
		int robot[][] = new int[a][2];		
		for(int i=0;i<n;i++) {
			int b = sc.nextInt(), c = sc.nextInt();
			robot[i][0] = b-c;
			robot[i][1] = b+c;
		}		
		Arrays.sort(robot, Comparator.comparingInt(arr[0] -> arr[1]));
		
		int d = 0;
		int e = Integer.MIN_VALUE;
		for(int i=0;i<a;i++) {
			if(robot[i][0] >= e) {
				d++;
				e = robot[i][1];
			}
		}		
		System.out.println(d);				
	} 
}

Compiler output:
Main.java:14: error: ')' or ',' expected
		Arrays.sort(robot, Comparator.comparingInt(arr[0] -> arr[1]));
		                                                 ^
Main.java:14: error: not a statement
		Arrays.sort(robot, Comparator.comparingInt(arr[0] -> arr[1]));
		                                                        ^
Main.java:14: error: ';' expected
		Arrays.sort(robot, Comparator.comparingInt(arr[0] -> arr[1]));
		                                                           ^
3 errors
Language: C

/* Atcoder　キーエンスプログラミングコンテスト2020 */

/* A */
#include <stdio.h>

int main(void)
{
    int H, W, N;
    int big;
    int result;

    scanf("%d", &H);
    scanf("%d", &W);
    scanf("%d", &N);

    if (H >= W) {
        big = H;
    } else {
        big = W;
    }

    result = ((N % big) == 0) ? (N / big) : ((N / big) + 1 );

    printf("%d", result);

    return 0;
}

/* B */
#include <stdio.h>
#include <stdlib.h>

int sort[100000][2];

int comp(const void *a, const void *b)
{
    int v1 = *((int *)a);
    int v2 = *((int *)b);

    if (v1 > v2) {
      return 1;
    } else if (v1 < v2) {
      return -1;
    } else {
      return 0;
    }
}

int main(void)
{
    int N, X, L;
    int cnt = 1;
    int idx= 0;
    int i;

    scanf("%d", &N);
    for (i = 0; i < N; i++) {
        scanf("%d %d", &X, &L);
        sort[i][0] = X - L;
        sort[i][1] = X + L;
    }
    qsort(sort, N, 8, comp);

    for (i = 0; i < N; i++) {
        if (sort[idx][1] <= sort[i + 1][0]){
            cnt++;
            idx = i + 1;
        }
    }

    printf("%d", cnt);

    return 0;
}

Compiler output:
main.c:49:5: error: redefinition of 'main'
   49 | int main(void)
      |     ^~~~
main.c:6:5: note: previous definition of 'main' with type 'int(void)'
    6 | int main(void)
      |     ^~~~
Language: C++

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long double ld; 
typedef vector vec;

ll mod = 1e9 + 7;

#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
// cout<<endl;


int main()
{
	fastio();
	ll n;
	cin>>n;
	vector<ii> v;
	// map<ll, ll> m;
	ll x, l;
	rep(i, n) cin>>x>>l, v.pb(mp(x+l, x-l));
	sort(range(v));
	ll b = -1e9, ans = 0;
	rep(i, n)
	{
		if(b <= v[i].se)
		{
			b = v[i].fi;
			ans++;
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc:17:9: error: typedef declared 'auto'
   17 | typedef vector vec;
      |         ^~~~~~
Language: C++

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define LB(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define UB(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef unsigned long long ull;
typedef long double ld; 

ll mod = 1e9 + 7;

#define each(a,x) for( auto &a:(x))
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define repr(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define rep2(i, l, r) for (ll i = (l); i < (r); i++)
#define rep2r(i, l, r) for (ll i = (r) - 1; i >= (l); i--)
#define range(a) a.begin(), a.end()
// cout<<endl;


int main()
{
	fastio();
	ll n;
	cin>>n;
	vector<ii> v;
	// map<ll, ll> m;
	ll x, l;
	rep(i, n) cin>>x>>l, v.pb(mp(x-l, x+l));
	sort(range(v));
	ll b = -1e9, ans = 0;
	rep(i, n)
	{
		if(b <= v[i].se)
		{
			b = r;
			ans++;
		}
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:29: error: 'r' was not declared in this scope
   44 |                         b = r;
      |                             ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;

import static sun.jvm.hotspot.code.CompressedStream.H;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        List<Pair> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            int X = scan.nextInt();
            int L = scan.nextInt();
            list.add(new Pair(X, L));
        }
        list.sort(new PairComparator());
        int ans = 0;
        int right = Integer.MIN_VALUE;
        for (int i = 0; i < N; i++) {
            Pair p = list.get(i);
            if (right <= p.X - p.L) {
                ans += 1;
                right = p.X + p.L;
            }
        }
        System.out.println(ans);
    }
    class Pair{
        int LEFT;
        int X;
        int L;
        Pair(int X, int L) {
            this.X = X;
            this.L = L;
            this.LEFT = X - L;
        }
    }
    class PairComparator implements Comparator<Pair> {
        @Override
        public int compare(Pair o1, Pair o2) {
            if (o1.LEFT != o2.LEFT){
                return Integer.compare(o1.LEFT, o2.LEFT);
            }
            return Integer.compare(o1.L, o2.L);
        }
    }
}


Compiler output:
Main.java:8: error: package sun.jvm.hotspot.code is not visible
import static sun.jvm.hotspot.code.CompressedStream.H;
                             ^
  (package sun.jvm.hotspot.code is declared in module jdk.hotspot.agent, which is not in the module graph)
Main.java:8: error: static import only from classes and interfaces
import static sun.jvm.hotspot.code.CompressedStream.H;
^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
        int b = 1;
        Long c = 0;
        Long d = 0;
        Long e,f;
		Long [][] in = new Long [a][2];
        for(int i=0;i<a;i++){e = sc.nextLong();
                             f = sc.nextLong();
                             in[i][0] = e-f;
                             in[i][1] = e+f;
                            }
        Arrays.sort(in);
         for(int i=1;i<a;i++){if(d<=in[i][0]){b++;
                                             d=in[i][1];}
            
         }
		System.out.println(b);
	}
}


Compiler output:
Main.java:7: error: incompatible types: int cannot be converted to Long
        Long c = 0;
                 ^
Main.java:8: error: incompatible types: int cannot be converted to Long
        Long d = 0;
                 ^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
        int b = 1;
        Long c = 0;
        Long d = 0;
        Long e,f;
		Long [][] in = new Long [a][2];
        for(int i=0;i<a;i++){e = sc.nextLong();
                             f = sc.nextLong();
                             in[i][0] = e-f;
                             in[i][1] = e+f;
                            }
        Arrays.sort(in[][1]);
         for(int i=1;i<a;i++){if(d<=in[i][0]){b++;
                                             d=in[i][1];}
            
         }
		System.out.println(b);
	}
}


Compiler output:
Main.java:16: error: ']' expected
        Arrays.sort(in[][1]);
                         ^
1 error
Language: C++


#include <iostream>
#include <string>
#include<cstring>
#include<stdio.h>
using namespace std;
const int MAX = 1e9 + 5;
int Xi[MAX]; int Li[MAX];int yes[MAX] ;
int cmp(const void *a, const void *b)
{
	return *(char *)a - *(int *)b;
}
int  main() {
	int N = 0, maxN = 0, maxNUM = 0; int cnt = 1; int maxX=0,minX=0;
	cin >> N;
	int n = N;
	while(n--){
		cin >> Xi[cnt] >> Li[cnt];
		if (maxX < Xi[cnt])maxX = Xi[cnt];
		if (minX > Xi[cnt])minX = Xi[cnt];
		cnt++;
		
	}
	qsort(Xi, N+1, sizeof(Xi[N - 1]), cmp);






for (int i =1;i<=N;i++)
{
	if (yes[i])continue;
	maxN = 1;
	for (int j = i; j <= N; j++) {
		if (Xi[j] >= Xi[i] + Li[i]) { maxN++; i = j; yes[i] = 1; }
	}
	if (maxNUM < maxN)maxNUM = maxN;
}
cout << maxNUM;

	return 0;

}

Compiler output:
/tmp/ccmwKtxL.o: in function `main':
a.cc:(.text+0xb1): relocation truncated to fit: R_X86_64_PC32 against symbol `Li' defined in .bss section in /tmp/ccmwKtxL.o
a.cc:(.text+0x18e): relocation truncated to fit: R_X86_64_PC32 against symbol `yes' defined in .bss section in /tmp/ccmwKtxL.o
a.cc:(.text+0x1ea): relocation truncated to fit: R_X86_64_PC32 against symbol `Li' defined in .bss section in /tmp/ccmwKtxL.o
a.cc:(.text+0x211): relocation truncated to fit: R_X86_64_PC32 against symbol `yes' defined in .bss section in /tmp/ccmwKtxL.o
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<utility>
#include<algorithm>
using namespace std;
typedef pair<int, int> P;
const int MAX_N = 100000;
const int MAX_V = 1000000000;
int N;
int X[MAX_N];
int L[MAX_N];
void input(){
    scanf("%d", &N);
    for(int i = 0; i < N; ++i){
        scanf("%d%d", X + i, L + i);
    }
}
P ps[MAX_N];
int solve(){
    for(int i = 0; i < N; ++i){
        2
        ps[i] = P(X[i] + L[i], X[i] - L[i]);
    }
    sort(ps, ps + N);
    int cur = -MAX_V;
    int ans = 0;
    for(int i = 0; i < N; ++i){
        if(cur <= ps[i].second){
            ans++;
            cur = ps[i].first;
        }
    }
    return ans; }
int main(){
    input();
    int ans = solve();
    printf("%d\n", ans);
    return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:20:10: error: expected ';' before 'ps'
   20 |         2
      |          ^
      |          ;
   21 |         ps[i] = P(X[i] + L[i], X[i] - L[i]);
      |         ~~
Language: C++

#include <iostream>
using namespace std;
int main ()
{
	int n, j=1; cin>>n; 
	int zamjena=n;
	int x[n+1], l[n+1];
	for (int i=0; i<n; i++) cin>>x[i]>>l[i];
	for (int i=0; i<n; i++)
	{
		int proba;
		while (j<n)
		{
			proba=zamjena;
			if (x[i]<=x[j])
			{
				if(x[i]+l[i]>x[j]-l[j])
				{
					--zamjena;
					j+=2;
				}
			}
			else if (x[i]>=x[j])
			{	
				if(x[j]+l[j]>x[i]-l[i])
				{
					--zamjena;
					j+=2;
				}
			}
			if (proba==zamjena) j++;	
		}
		if (proba!=zamjena) i++
	}
	cout<<zamjena<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:40: error: expected ';' before '}' token
   33 |                 if (proba!=zamjena) i++
      |                                        ^
      |                                        ;
   34 |         }
      |         ~
Language: C++

#include <iostream>
using namespace std;
int main ()
{
	int n, j=1; cin>>n; 
	int zamjena=n;
	int x[n+1], l[n+1];
	for (int i=0; i<n; i++) cin>>x[i]>>l[i];
	for (int i=0; i<n; i++)
	{
		while (j<n)
		{
			int proba=zamjena;
			if (x[i]<=x[j])
			{
				if(x[i]+l[i]>x[j]-l[j])
				{
					--zamjena;
					j+=2;
				}
			}
			else if (x[i]>=x[j])
			{	
				if(x[j]+l[j]>x[i]-l[i])
				{
					--zamjena;
					j+=2;
				}
			}
			if (proba==zamjena) j++;	
		}
		if (proba!=zamjena) i++
	}
	cout<<zamjena<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:21: error: 'proba' was not declared in this scope
   32 |                 if (proba!=zamjena) i++
      |                     ^~~~~
a.cc:32:40: error: expected ';' before '}' token
   32 |                 if (proba!=zamjena) i++
      |                                        ^
      |                                        ;
   33 |         }
      |         ~
Language: C++

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

int main() {
  int a, n, count;
  count = 0;
  cin >> n;
  vector<int> x(n), l(n);
  for (int i = 0; i < n; i++) {
    cin >> x.at(i) >> l.at(i);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (i != j && l.at(i) > 0 && l.at(j) > 0 && x.at(i) + l.at(i) + l.at(j) > x.at(j)) {
        count++;
        a = max(i, j)
        l.at(a) = 0;
        cout << x.at(j) << endl; 
      }
    }
  }
  cout << n - count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: expected ';' before 'l'
   16 |         a = max(i, j)
      |                      ^
      |                      ;
   17 |         l.at(a) = 0;
      |         ~
Language: C

#include<iostream>
#include<cstdlib>
#include<algorithm>
#include<stdio.h>
using namespace std;
struct robot
{
    int x;
    int y;
}a[100100];
int cmp(robot  x,robot  y)
{
    return x.x<y.x;
}
int main()
{
 int n,i,x,y,temp,count=1;
 scanf("%d",&n);
 for(i=0;i<n;i++)
 {
     scanf("%d%d",&x,&y);
     a[i].x=x-y;
     a[i].y=x+y;
 }
 sort(a,a+n+1,cmp);
 temp=a[0].y;
 for(i=1;i<n;i++)
 {
     if(temp<=a[i].x)
     {
         temp=a[i].y;
         count++;
     }
 }
 printf("%d",count);
return 0;
}

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

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

int main() {
      int N;
      int ans = 0;
      cin >> N;

      vector<pair<long long,long long>> robots;

      for (int i = 0; i < N; i++) {
            long long x,l;
            cin >> x >> l;
            robots.push_back(make_pair(x + l, x - l));
      }
      sort(robots.begin(), robots.end());

      int ans = 1;
      int i = 0;

      while (i < N - 1) {
            if ( robots.at(i).first <= robots.at(i + 1).second) {
                  ans++;
            }
            ++i;
      }

      cout << ans <<endl;
      return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: redeclaration of 'int ans'
   20 |       int ans = 1;
      |           ^~~
a.cc:8:11: note: 'int ans' previously declared here
    8 |       int ans = 0;
      |           ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>

typedef long long ll;
ll N, X[100000], L[100000];
ll l_c[100000], r_c[100000];

int comp(const void* a, const void* b){
    if(L[*(int*)a]-L[*(int*)b]>=0){
        return 1;
    }else{
        return -1;
    }
}

int compl(const void* a, const void* b){
    if(l_c[*(int*)a]-l_c[*(int*)b]>0){
        return 1;
    }else if(l_c[*(int*)a]-l_c[*(int*)b]==0){
        return 0;
    }else{
        return -1;
    }
}


int main(void){
    int a[100000];
    int b[100000];
    int ans=0;
    ll i;

    scanf("%d", &N);

    for(i=0;i<N;i++){
        scanf("%d %d", &X[i], &L[i]);
        a[i]=i;
        b[i]=i;
        l_c[i]=X[i]-L[i]+1;
        r_c[i]=X[i]+L[i]-1;
    }

    qsort(a, N, sizeof(int), compl);

    for(i=0;i<N-1;i++){
        if(l_c[a[i]]<=r_c[a[i-1]] && l_c[a[i+1]]<=r_c[a[i]] && i!=0){
            l_c[a[i]]=1000000000*2+1;
            r_c[a[i]]=-1000000000*2-1;
            N--;
        }else if(l_c[a[i]]<=l_c[a[i+1]] && r_c[a[i+1]]<=r_c[a[i]]){
            l_c[a[i]]=1000000000*2+1;
            r_c[a[i]]=-1000000000*2-1;
            N--;
        }else if(l_c[a[i]]<=r_c[a[i-1]] && i!=0){
            N--;
        }else{
            continue;
        }
    }

    if(l_c[a[i]]<=r_c[a[i-1]] i!= 0){
        N--;
    }

    printf("%lld", N);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:61:30: error: expected ')' before 'i'
   61 |     if(l_c[a[i]]<=r_c[a[i-1]] i!= 0){
      |       ~                      ^~
      |                              )
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	int n;
  	cin >> n;
  	vector<pair<int, int>> a(n);
  	for (int i = 0; i < n; ++i) {
    	int x, r;
      	cin >> x >> r;
      	a.emplace(x + r - 1, x - r + 1);
    }
  	sort(a.begin(), a.end());
  	int cnt = 1;
  	int prevID = 0;
  	for (int i = 1; i < n; ++i) {
     	if (a[i].second > a[prevID].first) {
        	prevID = i;
          	++cnt;
        }
    }
  	cout << cnt << '\n';
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: no matching function for call to 'std::vector<std::pair<int, int> >::emplace(int, int)'
   12 |         a.emplace(x + r - 1, x - r + 1);
      |         ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
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,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1348:9: note: candidate: 'template<class ... _Args> std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::emplace(const_iterator, _Args&& ...) [with _Args = {_Args ...}; _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >]'
 1348 |         emplace(const_iterator __position, _Args&&... __args)
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1348:9: note:   template argument deduction/substitution failed:
a.cc:12:25: note:   cannot convert '((x + r) - 1)' (type 'int') to type 'std::vector<std::pair<int, int> >::const_iterator'
   12 |         a.emplace(x + r - 1, x - r + 1);
      |                   ~~~~~~^~~
Language: C++

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

int main() {
  int N;
  cin >>N;
  vector<int>X(N);
  vector<int>L(N);
  vector<int>S(N);
  for(int i=0;i<N;i++){
    cin>>X[i]>>L[i];
    S[i]=X[i]+L[i];
  }
  for(int i=N-2;i>0;i--){
    if(S[i]>=)
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:14: error: expected primary-expression before ')' token
   15 |     if(S[i]>=)
      |              ^
a.cc:16:3: error: expected primary-expression before '}' token
   16 |   }
      |   ^