Language: C++

#include<iostream>
using namespace std;

int time[501];
int C[501],S[501],F[501];

int main(){
    int N;
    cin>>N;
    for(int i=1;i<=N-1;i++){
        cin>>C[i]>>S[i]>>F[i];
    }
    S[N]=0;
    time[N]=0;
    for(int i=N-1;i>=1;i--){
        time[i]=C[i]+S[i];
        int j=i;
        while(j<N-1){
            j++;
            if(time[i]<S[j]){
                time[i]=time[i+1];
                break;
            }
            time[i]+=C[j];
        }
    }

    for(int i=1;i<=N;i++){
        cout<<time[i]<<endl;
    }

    return 0;
}

Compiler output:
a.cc:4:13: error: 'int time [501]' redeclared as different kind of entity
    4 | int time[501];
      |             ^
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:14:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   14 |     time[N]=0;
      |           ^
a.cc:14:12: error: assignment of read-only location '*(time + ((sizetype)N))'
   14 |     time[N]=0;
      |     ~~~~~~~^~
a.cc:16:15: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   16 |         time[i]=C[i]+S[i];
      |               ^
a.cc:16:16: error: assignment of read-only location '*(time + ((sizetype)i))'
   16 |         time[i]=C[i]+S[i];
      |         ~~~~~~~^~~~~~~~~~
a.cc:20:22: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   20 |             if(time[i]<S[j]){
      |                      ^
a.cc:20:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   20 |             if(time[i]<S[j]){
      |                ~~~~~~~^~~~~
a.cc:21:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |                 time[i]=time[i+1];
      |                       ^
a.cc:21:33: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   21 |                 time[i]=time[i+1];
      |                                 ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:21:24: error: assignment of read-only location '*(time + ((sizetype)i))'
   21 |                 time[i]=time[i+1];
      |                 ~~~~~~~^~~~~~~~~~
a.cc:24:19: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |             time[i]+=C[j];
      |                   ^
a.cc:24:20: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   24 |             time[i]+=C[j];
      |             ~~~~~~~^~~~~~
a.cc:24:20: error: assignment of read-only location '*(time + ((sizetype)i))'
a.cc:29:21: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   29 |         cout<<time[i]<<endl;
      |                     ^