Language: C++

#include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<string.h>
#include<algorithm>
#include<iomanip>
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:13:16: error: 'int time [100010]' redeclared as different kind of entity
   13 | 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:18:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   18 |                 scanf("%d",&time[i]);
      |                                   ^
a.cc:19:18: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |         sort(time+1,time+1+n);
      |              ~~~~^~
a.cc:19:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |         sort(time+1,time+1+n);
      |                     ~~~~^~
a.cc:19:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   19 |         sort(time+1,time+1+n);
      |                     ~~~~~~^~
a.cc:22:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   22 |         sign=time[1];
      |                    ^
a.cc:22:20: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   22 |         sign=time[1];
      |              ~~~~~~^
      |                    |
      |                    time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:24:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |                 if(sign+c>time[i]||sum>k)
      |                                 ^
a.cc:24:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   24 |                 if(sign+c>time[i]||sum>k)
      |                    ~~~~~~^~~~~~~~
a.cc:28:36: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                         sign=time[i];
      |                                    ^
a.cc:28:36: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   28 |                         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:9:
/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:19:6:   required from here
   19 |         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,
      |                                           ~~~~~~~^~~~~~~~~