Language: C++

#include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,c,k,ans,sign,sum;
int time[100010];
int main()
{
	cin>>n>>c>>k;
	for(int i=1; i<=n; i++)
		scanf("%d",&time[i]);
	sort(time+1,time+1+n);
	sum=1;
	ans=1;
	sign=time[1];
	for(int i=2; i<=n; i++)
		if(sign+c>time[i]||sum==k)
		{
			ans++;
			sum=1;
			sign=time[i];
		}
		else sum++;
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc:8:16: error: 'int time [100010]' redeclared as different kind of entity
    8 | int time[100010];
      |                ^
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:1:
/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:13:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                 scanf("%d",&time[i]);
      |                                   ^
a.cc:14:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   14 |         sort(time+1,time+1+n);
      |              ~~~~^~
a.cc:14:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   14 |         sort(time+1,time+1+n);
      |                     ~~~~^~
a.cc:14:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   14 |         sort(time+1,time+1+n);
      |                     ~~~~~~^~
a.cc:17:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   17 |         sign=time[1];
      |                    ^
a.cc:17:20: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   17 |         sign=time[1];
      |              ~~~~~~^
      |                    |
      |                    time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:19:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |                 if(sign+c>time[i]||sum==k)
      |                                 ^
a.cc:19:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   19 |                 if(sign+c>time[i]||sum==k)
      |                    ~~~~~~^~~~~~~~
a.cc:23:36: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   23 |                         sign=time[i];
      |                                    ^
a.cc:23:36: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   23 |                         sign=time[i];
      |                              ~~~~~~^
      |                                    |
      |                                    time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of 'void std::__sort(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = long int (*)(long int*) noexcept; _Compare = __gnu_cxx::__ops::_Iter_less_iter]':
/usr/include/c++/14/bits/stl_algo.h:4772:18:   required from 'void std::sort(_RAIter, _RAIter) [with _RAIter = long int (*)(long int*) noexcept]'
 4772 |       std::__sort(__first, __last, __gnu_cxx::__ops::__iter_less_iter());
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:14:6:   required from here
   14 |         sort(time+1,time+1+n);
      |         ~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1906:50: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
 1906 |                                 std::__lg(__last - __first) * 2,
      |                                           ~~~~~~~^~~~~~~~~