Language: C++

//============================================================================
// Name        : tiny.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cstring>
#include <vector>
typedef unsigned int uint;
typedef unsigned long ul;
#define rep(i,n) for(long i = 0;i<n;i++)
using namespace std;

long happy[3010],time[3010];
long dp[3010][3010];
int main() {
	long N,T,S;
	memset(dp,0,sizeof(dp));
	memset(happy,0,sizeof(happy));
	memset(time,0,sizeof(time));
	cin >> N >> T >> S;
	rep(i,N){
		uint A,B;
		cin >> A >> B;
		happy[i] = A;time[i] = B;
	}
	for(long i = 0;i<N;i++)for(long j = 0;j<T;j++){
		if(j - time[i] >S){
			dp[i][j] = max(dp[i-1][j],dp[i-1][j-time[i]] + happy[i]);
		}
		else if(j-time[i] < S && j-time[i] >=0){
			dp[i][j] = max(dp[i-1][j],dp[i-1][j-time[i]] + happy[i]);
		}
	}
	//ul result = 0;
	rep(i,T){
		//cout << dp[N-1][i] << " ";
	}
	cout << dp[N-1][T-1];
	return 0;
}

Compiler output:
a.cc:17:27: error: 'long int time [3010]' redeclared as different kind of entity
   17 | long happy[3010],time[3010];
      |                           ^
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:9:
/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:23:30: error: ISO C++ forbids applying 'sizeof' to an expression of function type [-fpermissive]
   23 |         memset(time,0,sizeof(time));
      |                             ~^~~~~
a.cc:23:16: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'void*' [-fpermissive]
   23 |         memset(time,0,sizeof(time));
      |                ^~~~
      |                |
      |                time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
In file included from /usr/include/c++/14/cstring:43,
                 from a.cc:10:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
a.cc:28:36: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   28 |                 happy[i] = A;time[i] = B;
      |                                    ^
a.cc:28:38: error: assignment of read-only location '*(time + ((sizetype)i))'
   28 |                 happy[i] = A;time[i] = B;
      |                              ~~~~~~~~^~~
a.cc:31:30: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |                 if(j - time[i] >S){
      |                              ^
a.cc:31:22: error: invalid operands of types 'long int' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator-'
   31 |                 if(j - time[i] >S){
      |                    ~ ^ ~~~~~~~
      |                    |         |
      |                    long int  time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:32:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   32 |                         dp[i][j] = max(dp[i-1][j],dp[i-1][j-time[i]] + happy[i]);
      |                                                                   ^
a.cc:32:60: error: invalid operands of types 'long int' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator-'
   32 |                         dp[i][j] = max(dp[i-1][j],dp[i-1][j-time[i]] + happy[i]);
      |                                                           ~^~~~~~~~
      |                                                           |       |
      |                                                           |       time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                                                           long int
a.cc:34:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   34 |                 else if(j-time[i] < S && j-time[i] >=0){
      |                                 ^
a.cc:34:26: error: invalid operands of types 'long int' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator-'
   34 |                 else if(j-time[i] < S && j-time[i] >=0){
      |                         ~^~~~~~~~
      |                         |       |
      |                         |       time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                         long int
a.cc:34:50: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   34 |                 else if(j-time[i] < S && j-time[i] >=0){
      |                                                  ^
a.cc:34:43: error: invalid operands of types 'long int' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator-'
   34 |                 else if(j-time[i] < S && j-time[i] >=0){
      |                                          ~^~~~~~~~
      |                                          |       |
      |                                          |       time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                                          long int
a.cc:35:67: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                         dp[i][j] = max(dp[i-1][j],dp[i-1][j-time[i]] + happy[i]);
      |                                                                   ^
a.cc:35:60: error: invalid operands of types 'long int' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator-'
   35 |                         dp[i][j] = max(dp[i-1][j],dp[i-1][j-time[i]] + happy[i]);
      |                                                           ~^~~~~~~~
      |                                                           |       |
      |                                                           |       time_t(time_t*) noexcept {aka long int(long int*) noexcept}
      |                                                           long int