Language: C++

#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;

struct name
{
	int x;
	int y;
	int z;
}list[100005];
int time[100005];
int s[100005];
int cmp(name a,name b)
{
	return a.x<b.x;
}
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	for(int i=0;i<n;i++)
	{
		scanf("%d%d%d",&list[i].x,&list[i].y,&list[i].z);
	}
		sort(list,list+n,cmp);
	int anc=1;
	time[0]=list[0].y;
	s[0]=list[0].z;
	for(int i=1;i<n;i++)
	{
		int j;
		for(j=0;j<anc;j++)
			if(s[j]==list[i].z)
			{
				time[j]=list[i].y;
				break;
			}
			else
			{
				if(time[j]<list[i].x)
				{
					time[j]=list[i].y;
					break;
				}
				
			}
		if(j==anc)
		{	
			time[anc]=list[i].y;
			s[anc]=list[i].z;
			anc++;
		
			
		}
	}
	
	
	printf("%d\n",anc);
	
	
	
	
	return 0;
}

Compiler output:
a.cc:12:16: error: 'int time [100005]' redeclared as different kind of entity
   12 | int time[100005];
      |                ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:28:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |         time[0]=list[0].y;
      |               ^
a.cc:28:16: error: assignment of read-only location '* time'
   28 |         time[0]=list[0].y;
      |         ~~~~~~~^~~~~~~~~~
a.cc:36:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                 time[j]=list[i].y;
      |                                       ^
a.cc:36:40: error: assignment of read-only location '*(time + ((sizetype)j))'
   36 |                                 time[j]=list[i].y;
      |                                 ~~~~~~~^~~~~~~~~~
a.cc:41:42: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   41 |                                 if(time[j]<list[i].x)
      |                                          ^
a.cc:41:43: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   41 |                                 if(time[j]<list[i].x)
      |                                    ~~~~~~~^~~~~~~~~~
a.cc:43:47: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   43 |                                         time[j]=list[i].y;
      |                                               ^
a.cc:43:48: error: assignment of read-only location '*(time + ((sizetype)j))'
   43 |                                         time[j]=list[i].y;
      |                                         ~~~~~~~^~~~~~~~~~
a.cc:50:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   50 |                         time[anc]=list[i].y;
      |                                 ^
a.cc:50:34: error: assignment of read-only location '*(time + ((sizetype)anc))'
   50 |                         time[anc]=list[i].y;
      |                         ~~~~~~~~~^~~~~~~~~~