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

#include <bits/stdc++.h>

using namespace std;

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

        pair<int,int> p;
        vector<pair<int,int>> pairs, final_pairs;

        int n, x, l;
        cin >> n;

        while (n--) {
                cin >> x >> l;
                p = make_pair(x-l,x+l);
                pairs.push_back(p);
        }

        sort(pairs.begin(), pairs.end());
        final_pairs.push_back(pairs[0]);

        for (long unsigned int i = 1; i<=pairs.size(); i++) {
                if (final_pairs[i-1].second <= pairs[i].first) {
                        if (pairs[i].first != 0 && pairs[i].second != 0)
                                final_pairs.push_back(pairs[i]);
                }
        }
        for (pair p : final_pairs)
        cout << final_pairs.size() << "\n";
        return 0;
}

~        

Compiler output:
a.cc:35:2: error: expected class-name at end of input
   35 | ~
      |  ^
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 = a;
        Long c = 0;
        Long d = 0;
		Long [] in = new Long [a];
        String [] str = new Long [a];
        for(int i=0;i<a;i++){in[i] = sc.nextLong();
                             str[i] = sc.nextLong();                             
                            }
         for(int i=0;i<a;i++){
            c = Math.max(c,in[i]+str[i]);
        d = Math.min(d,in[i]-str[i]);
         }
		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;
                 ^
Main.java:10: error: incompatible types: Long[] cannot be converted to String[]
        String [] str = new Long [a];
                        ^
Main.java:12: error: incompatible types: long cannot be converted to String
                             str[i] = sc.nextLong();                             
                                                 ^
Main.java:15: error: no suitable method found for max(Long,String)
            c = Math.max(c,in[i]+str[i]);
                    ^
    method Math.max(int,int) is not applicable
      (argument mismatch; Long cannot be converted to int)
    method Math.max(long,long) is not applicable
      (argument mismatch; String cannot be converted to long)
    method Math.max(float,float) is not applicable
      (argument mismatch; String cannot be converted to float)
    method Math.max(double,double) is not applicable
      (argument mismatch; String cannot be converted to double)
Main.java:16: error: bad operand types for binary operator '-'
        d = Math.min(d,in[i]-str[i]);
                            ^
  first type:  Long
  second type: String
6 errors
Language: C++

#include <algorithm>
#include <cmath>  
#include <map>  
#include <istream>　
#include <ostream>　
#include <queue>　
struct Meet{
	int beg;
	int end;
	int num;
}meet[100000];
class setMeet{
	public:
		void init();
		void solve();
		private:
			int n,ans;
};
void setMeet::init(){
	int s,e;
	cin>>n;
	int i;
	for(i=0;i<n;++i)
	{
		cin>>s>>e;
		int min,max;
		max=s+e;
		min=s-e;
		meet[i].beg=min;
		meet[i].end=max;
		meet[i].num=i+1;
	}
}
bool cmp(Meet x,Meet y)
{
	if(x.end==y.end)
	return x.beg>y.beg;
	return x.end<y.end;
}
void setMeet::solve(){
	sort(meet,meet+n,cmp);
	int i;
	ans=1;
	int last=meet[0].end;
	for(i=1;i<n;++i)
	{
		if(meet[i].beg>=last)
		{
			ans++;
			last=meet[i].end;
		 } 
	}
	cout<<ans<<endl;
}
int main(){
	setMeet sm;
	sm.init();
	sm.solve();
	return 0;
}

Compiler output:
a.cc:4:10: error: extended character 　 is not valid in an identifier
    4 | #include <istream>　
      |          ^
a.cc:4:10: fatal error: istream>��: No such file or directory
    4 | #include <istream>　
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
#define ll long long 
int ctoi(char c) {return c-'0';}/*char to int*/
int gcd(ll a,ll b){return b?gcd(b,a%b):a;}/*MAX*/
int lcm(ll a,ll b){return a*b/gcd(a,b);}/*MIN*/
bool primecheck(ll n){/*sosuu*/if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}
int  main(){
int n;
cin >> n;
vector<pair<ll,ll>>a(n);
for(int i=0;i<n;i++){
	ll z,zz;
	cin >> z >> zz;
	a.at(i)=make_pair(z,zz);
}
sort(a.begin(),a.end());
ll ans = n,mi = a.at(0).first+a.at(0).second,hi=a.at(0).first-a.at(0).second;
for(int i=1;i<n;i++){
 ll mii = a.at(i).first+a.at(i).second,hii = a.at(i).first-a.at(i).second;
 if(hii<hi&&hi<mii){ans--;continue;}
  if(hi<hii&&hii<mi){ans--;continue;}
   if(hi<hii&&mii<mi){ans--;continue;}
mi = max(mi,mii),hi=min(hi,hii);
}
reverse(a.begin(),a.end());
ll che = n,mi = a.at(0).first+a.at(0).second,hi=a.at(0).first-a.at(0).second;
for(int i=1;i<n;i++){
 ll mii = a.at(i).first+a.at(i).second,hii = a.at(i).first-a.at(i).second;
 if(hii<hi&&hi<mii){ans--;continue;}
  if(hi<hii&&hii<mi){ans--;continue;}
   if(hi<hii&&mii<mi){ans--;continue;}
mi = max(mi,mii),hi=min(hi,hii);
}
ans = max(ans,che);
cout << ans << endl;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: redeclaration of 'long long int mi'
   29 | ll che = n,mi = a.at(0).first+a.at(0).second,hi=a.at(0).first-a.at(0).second;
      |            ^~
a.cc:20:12: note: 'long long int mi' previously declared here
   20 | ll ans = n,mi = a.at(0).first+a.at(0).second,hi=a.at(0).first-a.at(0).second;
      |            ^~
a.cc:29:46: error: redeclaration of 'long long int hi'
   29 | ll che = n,mi = a.at(0).first+a.at(0).second,hi=a.at(0).first-a.at(0).second;
      |                                              ^~
a.cc:20:46: note: 'long long int hi' previously declared here
   20 | ll ans = n,mi = a.at(0).first+a.at(0).second,hi=a.at(0).first-a.at(0).second;
      |                                              ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef pair<int, int> PII;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(v, n) sort(v, v+n)
#define VSORT(v) sort(v.begin(), v.end())
#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define INF 999999999
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    ll n;cin>>n;
    ll ans=n;
    VL x(n);
    VL l(n);
    VL up(n);
    VL dn(n);
    VL res(n);
    REP(i,n){
        cin>>x[i]>>l[i];
        dn[i]=x[i]-l[i]+1;
        up[i]=x[i]+l[i]-1;
    }
    while(1){
        REP(i,n){
            for(ll j = 0;j < i;j++){
                if(dn[i]<=up[j]){
                    res[i]++;
                }
            }
            for(ll j = i+1;j < n;j++){
                if(up[i]>=dn[j]){
                    res[i]++;
                }
            }
        }
        REP(i,n){
            ll tmp=0;
            if(res[i]==0)tmp++;
        }
        if(tmp==n){
            cout<<ans<<endl;
            return 0;
        }
        ll max=res[0];
        ll num=0;
        REP(i,n){
            if(max<res[i]){
                max=res[i];
                num=i;
            }
        }
        dn[num]=0;
        up[num]=0;
        res[num]=0;
        ans--;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:64:12: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   64 |         if(tmp==n){
      |            ^~~
      |            tm
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 = a;
        Long c = 0;
        Long d = 0;
		Long [] in = new Long [a];
        String [] str = new Long [a];
        for(int i=0;i<a;i++){in[i] = sc.nextLong();
                             str[i] = sc.nextLong();                             
                            }
         for(int i=0;i<a;i++){
            c = Math.max(c,in[i]+str[i]);
        d = Math.min(d,in[i]-str[i]);}
         }
		System.out.println(b);
	}
}


Compiler output:
Main.java:18: error: <identifier> expected
		System.out.println(b);
		                  ^
Main.java:18: error: <identifier> expected
		System.out.println(b);
		                    ^
Main.java:20: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
const char sp = ' ';

static vector< pair<ll, ll> > robots_st, robots_en;
using namespace std;

int main(void){
    ll dp[100009];
    MEMSET(dp, 0);
    ll N;
    cin>>N;
    
    ll end[100009];
    ll x, l;
    rep(i, N){
        cin>>x>>l;
        x+=1000000000;
        robots_st.push_back({x-l+1, i});
        robots_en.push_back({x+l-1, i});
    }
    sort(all(robots_st));
    sort(all(robots_en));
    ll endmark=0;
    rep(i, N){
        while(robots_en[endmark].first<robots_st[i].first){
            robots_en[endmark].first=i;
            endmark++;
        }
        //robots_st[i].first=i;
    }
    while(endmark<N){
        robots_en[endmark].first=N;
        endmark++;
    }
    rep(i, N){
        end[robots_en[i].second]=robots_en[i].first;
    }
    rep(i, N){
        //cout<<robots_st[i].first<<endl;
        dp[i+1]=max(dp[i+1], dp[i]);
        dp[end[robots_st[i].second]]=max(dp[end[robots_st[i].second]], dp[i]+(ll)1);
    }
    cout<<dp[N]<<endl;
    return 0;
}


Compiler output:
a.cc:19:8: error: 'vector' does not name a type
   19 | static vector< pair<ll, ll> > robots_st, robots_en;
      |        ^~~~~~
a.cc: In function 'int main()':
a.cc:33:9: error: 'robots_st' was not declared in this scope
   33 |         robots_st.push_back({x-l+1, i});
      |         ^~~~~~~~~
a.cc:34:9: error: 'robots_en' was not declared in this scope
   34 |         robots_en.push_back({x+l-1, i});
      |         ^~~~~~~~~
a.cc:36:14: error: 'robots_st' was not declared in this scope
   36 |     sort(all(robots_st));
      |              ^~~~~~~~~
a.cc:14:17: note: in definition of macro 'all'
   14 | #define all(x) (x).begin(),(x).end()
      |                 ^
a.cc:37:14: error: 'robots_en' was not declared in this scope
   37 |     sort(all(robots_en));
      |              ^~~~~~~~~
a.cc:14:17: note: in definition of macro 'all'
   14 | #define all(x) (x).begin(),(x).end()
      |                 ^
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 = a;
        Long c = 0;
        Long d = 0;
		Long [] in = new Long [a];
        String [] str = new Long [a];
        for(int i=0;i<a;i++){in[i] = sc.nextLong();
                             str[i] = sc.nextLong();                             
                            }
         for(int i=0;i<a;i++){
            c = Math.max(c,in[i]+str[i]);
        d = Math.min(d,in[i]-str[i];}
         }
		System.out.println(b);
	}
}


Compiler output:
Main.java:16: error: ')' or ',' expected
        d = Math.min(d,in[i]-str[i];}
                                   ^
Main.java:18: error: <identifier> expected
		System.out.println(b);
		                  ^
Main.java:18: error: <identifier> expected
		System.out.println(b);
		                    ^
Main.java:20: error: class, interface, enum, or record expected
}
^
4 errors
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> s[i] >> t[i];
  }
  for(int i=1; i<n-1; i++){
    for(int j=1; j<n-1; j++){
      int d;
    d = 0;
      if(s(i+j)-s(i) < t(i+j)-t(i)){
        d+=1;
      }
    }
  }
  cout << n-d << endl;
  return 0;
}
        
        
      


Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: no match for call to '(std::vector<int>) (int)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |          ~^~~~~
a.cc:16:18: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                 ~^~~
a.cc:16:25: error: no match for call to '(std::vector<int>) (int)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                        ~^~~~~
a.cc:16:32: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                               ~^~~
a.cc:21:13: error: 'd' was not declared in this scope
   21 |   cout << n-d << endl;
      |             ^
Language: C++

struct Meet{
	int beg;
	int end;
	int num;
}meet[100000];

class setMeet{
	public:
		void init();
		void solve();
		private:
			int n,ans;
};
void setMeet::init(){
	int s,e;
	cin>>n;
	int i;
	for(i=0;i<n;++i)
	{
		cin>>s>>e;
		int min,max;
		max=s+e;
		min=s-e;
		meet[i].beg=min;
		meet[i].end=max;
		meet[i].num=i+1;
	}
}

bool cmp(Meet x,Meet y)
{
	if(x.end==y.end)
	return x.beg>y.beg;
	return x.end<y.end;
}

void setMeet::solve(){
	sort(meet,meet+n,cmp);
	int i;
	ans=1;
	int last=meet[0].end;
	for(i=1;i<n;++i)
	{
		if(meet[i].beg>=last)
		{
			ans++;
			last=meet[i].end;
		 } 
	}
	cout<<ans<<endl;
}
int main(){
	setMeet sm;
	sm.init();
	sm.solve();
	return 0;
}

Compiler output:
a.cc: In member function 'void setMeet::init()':
a.cc:16:9: error: 'cin' was not declared in this scope
   16 |         cin>>n;
      |         ^~~
a.cc: In member function 'void setMeet::solve()':
a.cc:38:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   38 |         sort(meet,meet+n,cmp);
      |         ^~~~
      |         short
a.cc:50:9: error: 'cout' was not declared in this scope
   50 |         cout<<ans<<endl;
      |         ^~~~
a.cc:50:20: error: 'endl' was not declared in this scope
   50 |         cout<<ans<<endl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> s[i] >> t[i];
  }
  for(int i=1; i<n-1; i++){
    for(int j=1; j<n-1; j++)
      int d;
    d = 0;
      if(s(i+j)-s(i) < t(i+j)-t(i)){
        d+=1;
      }
  }
  cout << n-d << endl;
  return 0;
}
        
        
      


Compiler output:
a.cc: In function 'int main()':
a.cc:15:5: error: 'd' was not declared in this scope
   15 |     d = 0;
      |     ^
a.cc:16:14: error: 'j' was not declared in this scope
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |              ^
a.cc:16:18: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                 ~^~~
a.cc:16:32: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                               ~^~~
a.cc:20:13: error: 'd' was not declared in this scope
   20 |   cout << n-d << endl;
      |             ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> s(i) >> t(i);
  }
  for(int i=1; i<n-1; i++){
    for(int j=1; j<n-1; j++)
      int d;
    d = 0;
      if(s(i+j)-s(i) < t(i+j)-t(i)){
        d+=1;
      }
  }
  cout << n-d << endl;
  return 0;
}
        
        
      


Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> s(i) >> t(i);
      |            ~^~~
a.cc:10:21: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> s(i) >> t(i);
      |                    ~^~~
a.cc:15:5: error: 'd' was not declared in this scope
   15 |     d = 0;
      |     ^
a.cc:16:14: error: 'j' was not declared in this scope
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |              ^
a.cc:16:18: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                 ~^~~
a.cc:16:32: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                               ~^~~
a.cc:20:13: error: 'd' was not declared in this scope
   20 |   cout << n-d << endl;
      |             ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin >> n;
  vector<int> s(n);
  vector<int> t(n);
  for(int i=0; i<n; i++){
    cin >> s(i) >> t(n);
  }
  for(int i=1; i<n-1; i++){
    for(int j=1; j<n-1; j++)
      int d;
    d = 0;
      if(s(i+j)-s(i) < t(i+j)-t(i)){
        d+=1;
      }
  }
  cout << n-d << endl;
  return 0;
}
        
        
      

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> s(i) >> t(n);
      |            ~^~~
a.cc:10:21: error: no match for call to '(std::vector<int>) (int&)'
   10 |     cin >> s(i) >> t(n);
      |                    ~^~~
a.cc:15:5: error: 'd' was not declared in this scope
   15 |     d = 0;
      |     ^
a.cc:16:14: error: 'j' was not declared in this scope
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |              ^
a.cc:16:18: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                 ~^~~
a.cc:16:32: error: no match for call to '(std::vector<int>) (int&)'
   16 |       if(s(i+j)-s(i) < t(i+j)-t(i)){
      |                               ~^~~
a.cc:20:13: error: 'd' was not declared in this scope
   20 |   cout << n-d << endl;
      |             ^
Language: C


#include<stdio.h>
#define N 200907
 
__int64 fun(__int64 m,__int64 n)
{
    __int64 b=1;
    while(n)
    {
        if(n&1)
        b=(b*m)%N;
        n/=2;
        m=(m*m)%N;
    }
    return b;
}
 
int main()
{
    __int64 t;
    __int64 a,b,c,k;
    while(~scanf("%I64d",&t))
    {
        while(t--)
        {
            scanf("%I64d%I64d%I64d%I64d",&a,&b,&c,&k);
 
            __int64 d;
            __int64 sum;
            if(b-a==c-b)
            {
                d=b-a;
                sum=(d*k-d+a)%N;
            }
 
            else if(b/a==c/b)
            {
                d=b/a;
                sum=(a*fun(d,k-1))%N;
            }
             printf("%I64d\n",sum);
 
        }
    }
    return 0;
}

Compiler output:
main.c:5:1: error: unknown type name '__int64'; did you mean '__int64_t'?
    5 | __int64 fun(__int64 m,__int64 n)
      | ^~~~~~~
      | __int64_t
main.c:5:13: error: unknown type name '__int64'; did you mean '__int64_t'?
    5 | __int64 fun(__int64 m,__int64 n)
      |             ^~~~~~~
      |             __int64_t
main.c:5:23: error: unknown type name '__int64'; did you mean '__int64_t'?
    5 | __int64 fun(__int64 m,__int64 n)
      |                       ^~~~~~~
      |                       __int64_t
main.c: In function 'main':
main.c:20:5: error: unknown type name '__int64'; did you mean '__int64_t'?
   20 |     __int64 t;
      |     ^~~~~~~
      |     __int64_t
main.c:21:5: error: unknown type name '__int64'; did you mean '__int64_t'?
   21 |     __int64 a,b,c,k;
      |     ^~~~~~~
      |     __int64_t
main.c:28:13: error: unknown type name '__int64'; did you mean '__int64_t'?
   28 |             __int64 d;
      |             ^~~~~~~
      |             __int64_t
main.c:29:13: error: unknown type name '__int64'; did you mean '__int64_t'?
   29 |             __int64 sum;
      |             ^~~~~~~
      |             __int64_t
main.c:39:24: error: implicit declaration of function 'fun' [-Wimplicit-function-declaration]
   39 |                 sum=(a*fun(d,k-1))%N;
      |                        ^~~
Language: C++

ll n, a, b;
    ll ans = 0;
    cin >> n;
    vector<pair<ll, ll>> l(n);
    rep(i, n) {
      cin >> a >> b;
      l(n) = mp(a,b);
    }
    sort(l.begin(), l.end());
    rep(j, n){
      if(l[j].first+l[j].second < l[j+1].first+l[j+1].second)
    }
    cout << ans;
    return 0;

Compiler output:
a.cc:1:1: error: 'll' does not name a type
    1 | ll n, a, b;
      | ^~
a.cc:2:5: error: 'll' does not name a type
    2 |     ll ans = 0;
      |     ^~
a.cc:3:5: error: 'cin' does not name a type
    3 |     cin >> n;
      |     ^~~
a.cc:4:5: error: 'vector' does not name a type
    4 |     vector<pair<ll, ll>> l(n);
      |     ^~~~~~
a.cc:5:8: error: expected constructor, destructor, or type conversion before '(' token
    5 |     rep(i, n) {
      |        ^
a.cc:9:9: error: expected constructor, destructor, or type conversion before '(' token
    9 |     sort(l.begin(), l.end());
      |         ^
a.cc:10:8: error: expected constructor, destructor, or type conversion before '(' token
   10 |     rep(j, n){
      |        ^
a.cc:13:5: error: 'cout' does not name a type
   13 |     cout << ans;
      |     ^~~~
a.cc:14:5: error: expected unqualified-id before 'return'
   14 |     return 0;
      |     ^~~~~~
Language: C++

#include<iostream>

int main(){
  int n,k;
  std::cin >> n;
  int x[n],l[n],z[n][n],y=0;
  for(int i=1;i < 4;i++){
    std::cin >> x[i] >> l[i];
  }
  while(y>0){
    for(int i=1;i<n+1;i++){
      for(int j=1;j<n+1,j++){
      	if(i=j){
          z[i][j]=0;
      	}else{
          z[i][j]=abs((double)x[i]-(double)x[j]))-(l[i]+l[j]);
          if(z[i][j]<0){
          	y = y+1;
            n = n-1;
            x[i] = -1;
            l[i] = 0;
              
          }else{
          	y = y;
          }
        }
      }
    }
      
  std::cout << n << std::endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:28: error: expected ';' before ')' token
   12 |       for(int j=1;j<n+1,j++){
      |                            ^
      |                            ;
a.cc:16:49: error: expected ';' before ')' token
   16 |           z[i][j]=abs((double)x[i]-(double)x[j]))-(l[i]+l[j]);
      |                                                 ^
      |                                                 ;
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#define n 100000000

void quicksort(int *A, int *B,int p, int r); /* 関数 quicksort の宣言 */
int partition(int *A, int *B,int p, int r); /* 関数 partition の宣言 */

int main(){
	int N, i,j,k; //ロボットの個数N
  	scanf("%d", &N);
  	int X[N], L[N]; 
  	int *y;
  	int count=0, loop=1, loop2=1; //取り除いた回数 count, loop=1
  
  	y = (int *)malloc(n * sizeof(int)); //メモリ
    
  
  	for(i=0; i++; i<N){
    	scanf("%d, %d", &X[i], L[i]);
    }
  	for(i=0; i++; i<n){
      y[i] = 0; //初期化
    }
  	
  	quicksort(X,L,0, N-1); /* quicksort を呼び出し */

  	
  	while(loop){
      	loop2++;
    	for(j=0;j++;j<N){
          while(loop2){
	          for(k=X[j]-L[j];k++;k<=X[j]+L[j]){
                if(k >= 0){
	    	      	if(y[k]==0){
    	    	    	y[k]++;
        	    	}
            		else{
                        //loop3--;
            			loop2--;
                  		j=N;
                  		X[k] =-1,L[k] = 0, count++; //ロボットの除去
               		}
          		  }	
              	}
            	if(loop2==1){
        			loop=0;
                  	loop2=0;
        		}
		      	else{
        	  		for(i=0; i++; i<n){
      				y[i] = 0; //初期化
    			}
          	 }
        }      	
    }
  	
  	
  	printf("%d",N - count);
	return 0;
}

void quicksort(int *A, int *B, int p, int r){
    int q;

    if(p < r){
	q = partition(A, B,p, r);
	quicksort(A,B, p, q);
	quicksort(A,B, q+1, r);
    }
    
}

int partition(int *A, int *B,int p, int r){
    int x, i, j, tmp;
    x = A[p], i = p, j= r;
    
    while(i < j){
	while(x < A[j]){
	    j--;
	}
	while(x > A[i]){
	    i++;
	    }
	if(i < j){
	    tmp = A[j];
	    A[j] = A[i];
	    A[i] = tmp;
      	tmp = B[j];
	    B[j] = B[i];
	    B[i] = tmp;
	    i++;
	    j--;
	}
	if(i == j && A[j] > x){
	    j--;
	}
    }
    return j;
}


Compiler output:
main.c: In function 'main':
main.c:99:1: error: expected declaration or statement at end of input
   99 | }
      | ^
Language: C

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

int BubSort(int x[], int l[]int n);
 
int main(void){
  int n;
  int *x, *l;
  x = (int *)malloc(sizeof(int)*n);
  l = (int *)malloc(sizeof(int)*n);
  int count = 0;
  
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%d %d", &x[i], &l[i]);
  }
  BubSort(x, l, n);
  
  for(int i=0; i<n-1; i++){
    if(x[i]+l[i] > x[i+1]-l[i+1]){
      count++;
      i++;
    }
  }
  printf("%d", n-count);
}

int BubSort(int x[], int l[], int n)
{
    int i, j, temp1, temp2;

    for (i = 0; i < n - 1; i++) {
        for (j = n - 1; j > i; j--) {
            if (x[j - 1] > x[j]) {  
                temp1 = x[j];        
                x[j] = x[j - 1];
                x[j - 1]= temp1;
              
                temp2 = l[j];        
                l[j] = l[j - 1];
                l[j - 1]= temp2;
              
            }
        }	
    }
}

Compiler output:
main.c:4:29: error: expected ';', ',' or ')' before 'int'
    4 | int BubSort(int x[], int l[]int n);
      |                             ^~~
main.c: In function 'main':
main.c:17:3: error: implicit declaration of function 'BubSort'; did you mean 'abort'? [-Wimplicit-function-declaration]
   17 |   BubSort(x, l, n);
      |   ^~~~~~~
      |   abort
Language: C++

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

int main(){
  l n,tmp1,tmp2;
  vector<int> x;
  cin >> n;
  map<l,l> x_l;
  for(int i=0;i<n;i++){
  	cin >> tmp1 >> tmp2;
    x.push_back(tmp1);
    x_l[tmp1] = tmp2;
  }
  
  sort(x.begin(), x.end());
  
  
  float eps = 0.1;
  l ans = 1;
  l l1,l2;
  int i=0;
  while(ans<x.size()){
  	l1 = x_l[x[i]];
    l2 = x_l[x[i+1]];
    //cout<<x[i+1] << l2 << "\n";
    if((x[i]+l1-eps)<(x[i+1]-l2+eps)){
      ans++;
      i++;
      continue;
    }else{
      x.erase(x.begin() + i+1);
    }
  }
  cout << ans;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'l' was not declared in this scope
    6 |   l n,tmp1,tmp2;
      |   ^
a.cc:8:10: error: 'n' was not declared in this scope
    8 |   cin >> n;
      |          ^
a.cc:9:10: error: template argument 3 is invalid
    9 |   map<l,l> x_l;
      |          ^
a.cc:9:10: error: template argument 4 is invalid
a.cc:11:16: error: 'tmp1' was not declared in this scope; did you mean 'tm'?
   11 |         cin >> tmp1 >> tmp2;
      |                ^~~~
      |                tm
a.cc:11:24: error: 'tmp2' was not declared in this scope; did you mean 'tm'?
   11 |         cin >> tmp1 >> tmp2;
      |                        ^~~~
      |                        tm
a.cc:20:4: error: expected ';' before 'ans'
   20 |   l ans = 1;
      |    ^~~~
      |    ;
a.cc:21:4: error: expected ';' before 'l1'
   21 |   l l1,l2;
      |    ^~~
      |    ;
a.cc:23:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   23 |   while(ans<x.size()){
      |         ^~~
      |         abs
a.cc:24:9: error: 'l1' was not declared in this scope; did you mean 'y1'?
   24 |         l1 = x_l[x[i]];
      |         ^~
      |         y1
a.cc:24:17: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   24 |         l1 = x_l[x[i]];
      |                 ^
a.cc:25:5: error: 'l2' was not declared in this scope
   25 |     l2 = x_l[x[i+1]];
      |     ^~
a.cc:25:13: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   25 |     l2 = x_l[x[i+1]];
      |             ^
a.cc:35:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   35 |   cout << ans;
      |           ^~~
      |           abs
Language: C

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

int abs(int a, int b) {
	if (a > b) {
		return a - b;
	}
	else {
		return b - a;
	}
}
int main() {

	int *x, *l;
	int n,temp,temp2;
	int count = 0;

	scanf("%d", &n);
	x = (int *)malloc(n * sizeof(int));
	l = (int *)malloc(n * sizeof(int));

	for (int i = 0; i < n; i++) {
		scanf("%d %d", &x[i], &l[i]);
	}

	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			if (l[i] < l[j]) {

				temp = l[i];
				l[i] = l[j];
				l[j] = temp;

				temp2 = x[i];
				x[i] = x[j];
				x[j] = temp2;

			}
		}
		
	}

	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {

			if (x[i] > 1e+9) {
				break;
			}
			if (abs(x[i],x[j]) < l[i] + l[j]) {
				count++;
				x[j] = 1e+10;
			}
		}	
	}
	printf("\n%d", n - count);

	free(x);
	free(l);

	return 0;
}

Compiler output:
main.c:4:5: error: conflicting types for 'abs'; have 'int(int,  int)'
    4 | int abs(int a, int b) {
      |     ^~~
In file included from main.c:2:
/usr/include/stdlib.h:980:12: note: previous declaration of 'abs' with type 'int(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
main.c: In function 'main':
main.c:51:40: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+10' to '2147483647' [-Woverflow]
   51 |                                 x[j] = 1e+10;
      |                                        ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
  cin >>N;
  int X[N],L[N],max[N],min[N];
  for(ll i=0;i<N;i++){
  cin >>X[i]>>L[i];
  max[i]=X[i]+L[i];
  min[i]=X[i]-L[i];}
    
  int tmp1,tmp2;
  
  /* 数値を昇順にソート */
  for (ll i=0; i<N; ++i) {
    for (ll j=i+1; j<N; ++j) {
      if (min[i] > min[j]) {
        tmp1 =  min[i];
        min[i] = min[j];
        min[j] = tmp1;
        tmp2=max[i];
        max[i]=max[j];
        max[j]=tmp2;
      }
    }
  }

  int dp[N],count;
  count=0;
  dp[0]=min[0]-1;
  for(ll i=0;i<N;i++){
  	if(dp[i]>min[i])
    {
	dp[i+1]=std::min(dp[i],max[i]);
      count=count+1;
    }
    if(dp[i]<=min[i])dp[i+1]=max[i];
  }
  
   cout << N-count<< endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'll' was not declared in this scope
    8 |   for(ll i=0;i<N;i++){
      |       ^~
a.cc:8:14: error: 'i' was not declared in this scope
    8 |   for(ll i=0;i<N;i++){
      |              ^
a.cc:16:8: error: 'll' was not declared in this scope
   16 |   for (ll i=0; i<N; ++i) {
      |        ^~
a.cc:16:16: error: 'i' was not declared in this scope
   16 |   for (ll i=0; i<N; ++i) {
      |                ^
a.cc:17:12: error: expected ';' before 'j'
   17 |     for (ll j=i+1; j<N; ++j) {
      |            ^~
      |            ;
a.cc:17:20: error: 'j' was not declared in this scope
   17 |     for (ll j=i+1; j<N; ++j) {
      |                    ^
a.cc:32:7: error: 'll' was not declared in this scope
   32 |   for(ll i=0;i<N;i++){
      |       ^~
a.cc:32:14: error: 'i' was not declared in this scope
   32 |   for(ll i=0;i<N;i++){
      |              ^
Language: C++

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

int N;
class robo {
public:
  int left;
  int right;
  int ovr;
  int ovl;
  bool omit;
  bool operator <(const robo& r) {
    return left < r.left;
  }
  rovo () {
    ovr=ovl=0;
    omit=false;
  }
};

robo r[100000];
int memo[100000];

int robonum(int);

int main()
{

  int i,j;
  int X,L;
  cin >> N;
  for (i=0; i<N; i++) {
    cin >> X >> L;
    r[i].left = X-L;
    r[i].right = X+L;
  }
  sort(&r[0], &r[N-1]+1);
  for (i=0; i<N-1; i++) {
    for (j=i+1; j<N; j++) {
      if (r[i].right > r[j].left) {
        r[i].ovr++;
        r[j].ovl++;
      }
      if (r[i].right < r[j].left) break;
    }
  }
  printf("%d\n", robonum(0));
  return 0;
}
int robonum(int p) {
  int r1,r2;
  int ret;

  if (p>=N) return 0;
  if (memo[p]) return memo[p];
  if (r[p].ovr > 0) {
    r1 = robonum(p+r[p].ovr+1)+1;
    r2 = robonum(p+1);
    if (r1>r2) ret = r1; else ret = r2;
  } else {
    ret = robonum(p+1)+1;
  }
  memo[p] = ret;
  return ret;
}


Compiler output:
a.cc:19:3: error: ISO C++ forbids declaration of 'rovo' with no type [-fpermissive]
   19 |   rovo () {
      |   ^~~~
a.cc: In member function 'int robo::rovo()':
a.cc:22:3: warning: no return statement in function returning non-void [-Wreturn-type]
   22 |   }
      |   ^
Language: C

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

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

using namespace std;

int main()
{
  //lli l[1000000001];
  lli *l = (lli *)malloc(sizeof(lli)*1000000001);
  memset(l, 0, sizeof(lli)*1000000001);
  //rep(i,1000000001) l[i]=0;
  lli n,max=0;
  scanf("%lld", &n);

  rep(i,n) {
    int x,tmp;
    scanf("%d %d", &x, &tmp);
    l[x]=tmp;
    if (max<x)
      max=x;
  }

  lli ans = n;
  for(lli i=0;i<max+1;i++){
    bool flag=true;
    if(l[i]==0)
      continue;
    
    for(lli j=1; j<=l[i]; j++) {

      if(i-j<0 || i+j>100000001) break;

      if(l[i+j]!=0) {
        flag=false;
        break;
      }

      if(l[i-j]!=0) {
        flag=false;
        break;
      }
    }

    if(flag==false){
      ans--;
      l[i]=0;
    }
  }
  
  printf("%d\n", ans);

  free(l);
  return 0;
}

Compiler output:
main.c:2:10: fatal error: bits/stdc++.h: No such file or directory
    2 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#pragma region Template
#include <bits/stdc++.h>
#ifdef _DEBUG
#include "../../../debug_print.hpp"
#else
#define debug(...)
#endif
#define sort_(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.rbegin(), a.rend())
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; 0 <= i; i--)
#define for_(i, start, end) for (int i = start; i < end; i++)
#define rfor(i, start, end) for (int i = start - 1; 0 <= i; i--)
#define all(a) a.begin(), a.end()
using ll = long long;
using ld = long double;
using namespace std;
constexpr int INF32       = 1'050'000'000;
constexpr long long INF64 = 4'000'000'000'000'000'000;
constexpr int MOD7        = 1'000'000'007;
constexpr int MOD53       = 998'244'353;
constexpr double PI       = 3.14159265358979323846;
template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
void print() { std::cout << '\n'; }
template <class H, class... T> void print(H &&head, T &&... args) {
    std::cout << head;
    sizeof...(args) == 0 ? std::cout << "" : std::cout << ' ';
    print(std::forward<T>(args)...);
}
template <class T> void print(std::vector<T> &v) {
    for (int i = 0; i < v.size(); i++) {
        std::cout << v[i];
        i == v.size() - 1 ? std::cout << '\n' : std::cout << ' ';
    }
}
template <class T> void print(std::vector<std::vector<T>> &v) {
    for (int i = 0; i < v.size(); i++) {
        for (int j = 0; j < v[i].size(); j++) {
            std::cout << v[i][j];
            j == v[i].size() - 1 ? std::cout << '\n' : std::cout << ' ';
        }
    }
}
void scan() {}
template <class H, class... T> void scan(H &&head, T &&... args) {
    std::cin >> head;
    scan(std::forward<T>(args)...);
}
template <class T> void scan(std::vector<T> &v) {
    for (auto &&i : v) {
        scan(i);
    }
}
#pragma endregion Template

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

    int N;
    scan(N);
    map<ll, ll> mp;
    rep(i, N) {
        ll x, l;
        scan(x, l);
        i   f (mp.count(x - l))
            mp[x - l]++;
        else
            mp[x - l] = 1;
        if (mp.count(x + l))
            mp[x + l]--;
        else
            mp[x + l] = -1;
    }
    ll now  = 0;
    int ans = N;
    for (auto &&i : mp) {
        ll pre = now;
        now += i.second;
        if (pre < now && 1 < now)
            ans -= max(now - pre, 1LL);
    }
    print(ans);

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:79:10: error: expected ';' before 'f'
   79 |         i   f (mp.count(x - l))
      |          ^  ~
      |          ;
a.cc:81:9: error: 'else' without a previous 'if'
   81 |         else
      |         ^~~~
Language: C++

#include<stdio.h>
void QuickSort(int *arr, int low, int high)
{
    if (low < high)
    {
        int i = low;
        int j = high;
        int k = arr[low];
        while (i < j)
        {
            while(i < j && arr[j] >= k)   
            {
                j--;
            }

            if(i < j)
            {
                arr[i++] = arr[j];
            }

            while(i < j && arr[i] < k)    
            {
                i++;
            }

            if(i < j)
            {
                arr[j--] = arr[i];
            }
        }

        arr[i] = k;

        QuickSort(arr, low, i - 1);     
        QuickSort(arr, i + 1, high);    
}

int main()
{
    int h,w,n;
    scanf("%d",&n);
    int i,rob[n],len[n];
    int maxl[n];
    int minl[n];
    for(i=0;i<n;i++)
        {
            scanf("%d %d",&rob[i],&len[i]);
        }
    int count=0,j;
    int index;
    QuickSort(rob, 0, n-1);
    for(i=0;i<n;i++)
    {
        maxl[i]=rob[i]+len[i];
        minl[i]=rob[i]-len[i];
    }
    for(i=0;i<n;i++)
        printf("(%d,%d)",minl[i],maxl[i]);
    for(i=0;i<n;i++)
    {
        for(j=i+1;j<n;j++)
            {
                if(maxl[i]>minl[j])
                    count++;
                else
                {
                    i=j;
                    break;
                }
            }
    }
    printf("%d",n-count);
    return 0;
}


Compiler output:
a.cc: In function 'void QuickSort(int*, int, int)':
a.cc:38:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   38 | int main()
      |         ^~
a.cc:38:9: note: remove parentheses to default-initialize a variable
   38 | int main()
      |         ^~
      |         --
a.cc:38:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:39:1: error: a function-definition is not allowed here before '{' token
   39 | {
      | ^
a.cc:74:2: error: expected '}' at end of input
   74 | }
      |  ^
a.cc:3:1: note: to match this '{'
    3 | {
      | ^
Language: C

#include <stdio.h>

int main(void){
  int n;
  int *x, *l;
  x = (int *)malloc(sizeof(int)*n);
  l = (int *)malloc(sizeof(int)*n);
  int count = 0;
  
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%d %d", &x[i], &l[i]);
  }
  
  for(int i=0; i<n; i++){
    if(x[i]+l[i] > x[i+1]-l[i+1]){
      count++;
      i++;
    }
  }
  pritnf("%d", count);
}

Compiler output:
main.c: In function 'main':
main.c:6:14: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    6 |   x = (int *)malloc(sizeof(int)*n);
      |              ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:6:14: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    6 |   x = (int *)malloc(sizeof(int)*n);
      |              ^~~~~~
main.c:6:14: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:21:3: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   21 |   pritnf("%d", count);
      |   ^~~~~~
      |   printf
Language: C

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

struct number {
long int a,b;
struct number* next, *prev;
};

void  insert(struct number *a, struct number *b) 
	b->next = a;
	b->prev = a->prev;
	a->prev->next = b;
	a->prev = b;
}

int main ()
{
    int N;
    int i;
    long int x,l;
    int max=0;
    int max2=0;
    struct number head,*p,*q;
   head.next=&head;
   head.prev=&head;

    scanf("%d",&N);
    for(i=0;i<N;i++)
    {
        struct number *data;
		data = (struct number *)malloc(sizeof(struct number));
        scanf("%ld %ld",&x,&l);
        data->a=x-l+1;
        data->b=x+l-1;
        insert(&head, data);
    }

    for(p=head.next;p!=&head;p=p->next)
    {
        for(q=p->next;q!=&head;q=q->next)
        {
            if(q->a<=p->a&&p->b<=q->b)
            {
                continue;
            }
            else if(p->a<=q->a&&q->b<=p->b)
            {
                continue;
            }
            else if(q->a<=p->b&&p->b<=q->b)
            {
                continue;
            }
            else if(q->a<=p->a&&p->a<=q->b)
            {
                continue;
            }
            else
            {
                max2++;
            }
            
        }

        max2++;

        if(max2>=max)
        {
            max=max2;
        }
        max2=0;
    }
    

printf("%d\n",max);

return 0;
}

Compiler output:
main.c: In function 'insert':
main.c:10:9: error: expected declaration specifiers before 'b'
   10 |         b->next = a;
      |         ^
main.c:11:9: error: expected declaration specifiers before 'b'
   11 |         b->prev = a->prev;
      |         ^
main.c:12:9: error: expected declaration specifiers before 'a'
   12 |         a->prev->next = b;
      |         ^
main.c:13:9: error: expected declaration specifiers before 'a'
   13 |         a->prev = b;
      |         ^
main.c:14:1: error: expected declaration specifiers before '}' token
   14 | }
      | ^
main.c:17:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
   17 | {
      | ^
main.c:79: error: expected '{' at end of input
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <bitset>
#include <vector>
#include <queue>
#include <map>
#include <set>

#define i64 int64_t
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define ffrvs(ii,nn,mm) for(int ii=nn;ii>=mm;ii--)
#define srt(vvv) sort(vvv.begin(),vvv.end())
#define srtrvs(vvv) reverse(vvv.begin(),vvv.end())
#define Graph vector<vector<int>>
i64 inf = 1000000007;
i64 giant = 4000000000000000037;

using namespace std;

//メモリ置き場
int n;
vector<vector<i64>> dat;

//inputします
void input() {
    cin >> n;
    dat.resize(n);
    ff(i, 0, n) {
        i64 a, b;
        cin >> a >> b;
        dat[i].push_back(a);
        dat[i].push_back(b);
    }
    srt(dat);
}

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 <iostream>
#include <vector>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;

int main(){
	
        int N,a,b,min,tem,temp=0;
        std::cin >> N;
        int X[N],L[N];
        
        rep(i,N){
            std::cin >> X[i] >> L[i];
        }
        
        for(a=0;a<N-1;a++){
            min = a;
            for(b=a+1;b<N;b++){
                if(X[min]<X[b])min = a;
                
                tem = X[a];
                X[a] = X[min];
                X[min] = tem;
                
                tem = L[a];
                L[a] = L[min];
                L[min] = tem;
            }
        }
        
        
        
        rep(i,N-1){
            if(X[i]+L[i]>X[i+1]-L[i+1]){
                temp++;
                i++;
            }
        }
        std::cout << N - temp;
        
        
        
        
        
    }
	return 0;
}

Compiler output:
a.cc:46:9: error: expected unqualified-id before 'return'
   46 |         return 0;
      |         ^~~~~~
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

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

int main() {

int N;
 cin >> N;
 int X[N],L[N];
 for(int i=0;i<N;i++){
 cin >>X[i]>>L[i];
 }
 int a=0,b=0,c=0;
for(int j=0;j<N;j++){
 for(int i=0;i<N-1;i++){
 if(X[i]<X[i+1]){
 a=X[i];
 b=L[i];
 X[i]=X[i+1];
 L[i]=L[i+1];
 X[i+1]=a;
 L[i+1]=b;}}}

 i=0;
 b=0;
 while(i<N-1){
 a=i;
 c=i;
 if((X[i]+L[i])>(X[i+1]-L[i+1]))
 {
    while((X[a]+L[a])>X[c+1]&&c<N-1)
    {
        if((X[a]+L[a])>(X[c+1]+L[c+1]))
         {
            a=c+1;
            c++;
            }
        else c++;
    
    }
    
   }
i=a+1;
b++; }
cout<<b<<endl;}

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

#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> p(n);
  rep(i, n) {
    int x, l;
    cin >> x >> l;
    p[i].first = x - l + 1;
    p[i].second = x + l - 1;
  }

  sort(p.begin(), p.end());
  int ans = 1, res = 0;
  rep(i, n) {
    if (p[i].first <= p[res].second) {
      if (p[i].second < p[res].second) res = i;
    }
    else {
      ans++;
      res = i;
    }
  }

  rep(i, n) swap(p[i].first, p[i].second);
  sort(p.begin(), p.end(), greater<pair<int, int>>());
  int ans2 = 1, res = 0;
  rep(i, n) {
    if (p[i].first >= p[res].second) {
      if (p[i].second > p[res].second) res = i;
    }
    else {
      ans2++;
      res = i;
    }
  }
  cout << max(ans, ans2) << endl;
  


  







  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:17: error: redeclaration of 'int res'
   39 |   int ans2 = 1, res = 0;
      |                 ^~~
a.cc:26:16: note: 'int res' previously declared here
   26 |   int ans = 1, res = 0;
      |                ^~~
Language: C

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

struct point{
    int x,y;
}a[100000];

int cmp(point a,point b)
{
    if(a.y!=b.y)
        return a.y<b.y;
    return a.x<b.y;
}

int main(){
    int n,k,s,cnt=1,i;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d%d",&k,&s);
        a[i].x=k-s;
        a[i].y=k+s;
    }
    sort(a,a+n,cmp);
    int start=a[0].y;
    int r=n-1;
    while(r--)
    {
        if(a[n-r].x>=start)
        {
            cnt++;
            start=a[n-r].y;
        }
    }
    printf("%d\n",cnt);
}


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