Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstring>
using namespaece std;
typedef pair<int,int> P;
#define pb push_back
#define mp make_pair
vector<P>vec[10005];
int num[10005];
int rank[10005];
int par[10005];
void init(int n)
{
  for(int i=0;i<n;i++)
    {
      rank[i]=0;
      par[i]=i;
    }
}
int find(int x)
{
  if(x==par[x])
    {
      return x;
    }
  else
    {
      return find(par[x]);
    }
}
void update(int x,int y)
{
  if(par[x]==par[y])
    {
      return ;
    }
  else
    {
      if(rank[x]<rank[y])
	{
	  par[x]=y;
	}
      else
	{
	  par[y]=x;
	  if(rank[x]==rank[y])
	    {
	      rank[x]++;
	    }
	}
    }
}
bool same(int a,int b)
{
  return par[a]==par[b];
}
int main()
{
  int n,m;
  while(1)
    {
      int ans1=0;
      int ans2=0;
      scanf("%d %d",&n,&m);
      for(int i=0;i<=10000;i++)
	{
	  vec[i].resize(0);
	}
      if(!n && !m) break;
      for(int w=0;w<n;w++)
	{
	  int a,b,c,d;
	  scanf("%d %d %d %d",&a,&b,&c,&d);
	  for(int i=a;i<c;i++)
	    {
	      vec[i].pb(mp(b,d-b));
	    }
	}
      for(int i=0;i<=10000;i++)
	    {
	      if(vec[i].size())
		{
		  memset(num,0,sizeof(num));
		  for(int j=0;j<vec[i].size();j++)
		    {
		      num[vec[i][j].first]=max(num[vec[i][j].first],vec[i][j].second);
		    }
		  for(int j=0;j<=10000;j++)
		    {
		      if(j!=0)
			{
			  num[j]=max(num[j],num[j-1]+1);
			}
		      if(num[j]!=0)
			{
			  ans1++;
			}

		    }
		}
	    }
      printf("%d\n",ans1);
    }
}

Compiler output:
a.cc:5:7: error: expected nested-name-specifier before 'namespaece'
    5 | using namespaece std;
      |       ^~~~~~~~~~
a.cc:6:9: error: 'pair' does not name a type
    6 | typedef pair<int,int> P;
      |         ^~~~
a.cc:9:1: error: 'vector' does not name a type
    9 | vector<P>vec[10005];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:68:11: error: 'vec' was not declared in this scope
   68 |           vec[i].resize(0);
      |           ^~~
a.cc:77:15: error: 'vec' was not declared in this scope
   77 |               vec[i].pb(mp(b,d-b));
      |               ^~~
a.cc:8:12: error: 'make_pair' was not declared in this scope; did you mean 'std::make_pair'?
    8 | #define mp make_pair
      |            ^~~~~~~~~
a.cc:77:25: note: in expansion of macro 'mp'
   77 |               vec[i].pb(mp(b,d-b));
      |                         ^~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1132:5: note: 'std::make_pair' declared here
 1132 |     make_pair(_T1&& __x, _T2&& __y)
      |     ^~~~~~~~~
a.cc:82:18: error: 'vec' was not declared in this scope
   82 |               if(vec[i].size())
      |                  ^~~
a.cc:87:44: error: 'max' was not declared in this scope; did you mean 'std::max'?
   87 |                       num[vec[i][j].first]=max(num[vec[i][j].first],vec[i][j].second);
      |                                            ^~~
      |                                            std::max
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:93:34: error: 'max' was not declared in this scope; did you mean 'std::max'?
   93 |                           num[j]=max(num[j],num[j-1]+1);
      |                                  ^~~
      |                                  std::max
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: 'std::max' declared here
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~