Language: C++

#include <bits/stdc++.h>
using namespace std;
int compare(pair<int,int> &p1,pair<int,int> &p2)
{
	if(p1.first<p2.first)
	return 1;
	if(p1.first==p2.first)
	{
		if(p1.second<p2.second)
		return 1;
	}
	return 0;
}
int hands(vector<pair<int,int>> &v)
{
	stack<pair<int,int>> s;
	for(auto itr : v)
	{
	   int fir=itr.first,scnd=itr.second;
	   if(s.empty()==1)
	   s.push({fir,scnd});
	   else 
	   {
	       if(fir<=s.top().second && scnd < s.top().second)
	       {
	       	  s.pop();
	       	  s.push({fir,scnd});
	       }
	       else if(fir>s.top().second)
	       s.push({fir,scnd});
	   }
	}
	return s.size();
}
int main()
{
	int n,point,range;
	cin>>n;
	vector<pair<int,int>> v;
	for(int i=0;i<n;++i)
	{
		cin>>point>>range;
		v.push_back(point-range),(point+range)});
	}
	sort(v.begin(),v.end(),compare);
	int count=hands(v);
	cout<<count<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:28: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int)'
   43 |                 v.push_back(point-range),(point+range)});
      |                 ~~~~~~~~~~~^~~~~~~~~~~~~
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:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:35: note:   no known conversion for argument 1 from 'int' to 'const std::vector<std::pair<int, int> >::value_type&' {aka 'const std::pair<int, int>&'}
 1283 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:30: note:   no known conversion for argument 1 from 'int' to 'std::vector<std::pair<int, int> >::value_type&&' {aka 'std::pair<int, int>&&'}
 1300 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
a.cc:43:56: error: expected primary-expression before ')' token
   43 |                 v.push_back(point-range),(point+range)});
      |                                                        ^
a.cc: At global scope:
a.cc:45:13: error: expected constructor, destructor, or type conversion before '(' token
   45 |         sort(v.begin(),v.end(),compare);
      |             ^
a.cc:46:25: error: 'v' was not declared in this scope
   46 |         int count=hands(v);
      |                         ^
a.cc:47:9: error: 'cout' does not name a type
   47 |         cout<<count<<endl;
      |         ^~~~
a.cc:48:9: error: expected unqualified-id before 'return'
   48 |         return 0;
      |         ^~~~~~
a.cc:49:1: error: expected declaration before '}' token
   49 | }
      | ^