Language: C++

#include<iostream>
using namespace std;
int N,L;
int ice[100000];	//つららの長さ
int time[100000];	//伸び始め〜折れるまで
int num[100000];	//左中右とくらべて伸びる順番(0〜2)
int stime[100000];	//伸び始める時間(>=0)
int main(){
	int i,j;
	cin >> N >> L;
	for(i = 0;i < N;i++){
		cin >> ice[i];
		time[i] = L-ice[i];
	}
	for(i = 0;i < N-1;i++){
		if(ice[i] < ice[i+1])
			num[i]++;
		else
			num[i+1]++;
	}
	for(i = 0;i < N;i++){
		if(num[i] != 0)
			continue;
		for(j = i-1;j >= 0;j--){
			if(num[j] == 2){
				if(stime[j] < stime[j+1]+time[j+1]){
					stime[j] = stime[j+1]+time[j+1];
				}
				break;
			}
			stime[j] = stime[j+1]+time[j+1];
		}
		for(j = i+1;j < N;j++){
			if(num[j] == 2){
				if(stime[j] < stime[j-1]+time[j-1]){
					stime[j] = stime[j-1]+time[j-1];
				}
				break;
			}
			stime[j] = stime[j-1]+time[j-1];
		}
	}
	int max = 0;
	for(i = 0;i < N;i++){
		if(max < stime[i]+time[i])
			max = stime[i]+time[i];
	}
	cout << max << endl;
	return 0;
}

Compiler output:
a.cc:5:16: error: 'int time [100000]' redeclared as different kind of entity
    5 | int time[100000];       //伸び始め〜折れるまで
      |                ^
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:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   13 |                 time[i] = L-ice[i];
      |                       ^
a.cc:13:25: error: assignment of read-only location '*(time + ((sizetype)i))'
   13 |                 time[i] = L-ice[i];
      |                 ~~~~~~~~^~~~~~~~~~
a.cc:26:66: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                 if(stime[j] < stime[j+1]+time[j+1]){
      |                                                                  ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:26:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   26 |                                 if(stime[j] < stime[j+1]+time[j+1]){
      |                                               ~~~~~~~~~~^~~~~~~~~~
a.cc:26:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   26 |                                 if(stime[j] < stime[j+1]+time[j+1]){
      |                                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:27:71: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   27 |                                         stime[j] = stime[j+1]+time[j+1];
      |                                                                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:27:62: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   27 |                                         stime[j] = stime[j+1]+time[j+1];
      |                                                    ~~~~~~~~~~^~~~~~~~~~
a.cc:27:62: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   27 |                                         stime[j] = stime[j+1]+time[j+1];
      |                                                    ~~~~~~~~~~^~~~~~~~~~
      |                                                              |
      |                                                              time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:31:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |                         stime[j] = stime[j+1]+time[j+1];
      |                                                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:31:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   31 |                         stime[j] = stime[j+1]+time[j+1];
      |                                    ~~~~~~~~~~^~~~~~~~~~
a.cc:31:46: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   31 |                         stime[j] = stime[j+1]+time[j+1];
      |                                    ~~~~~~~~~~^~~~~~~~~~
      |                                              |
      |                                              time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:35:66: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                 if(stime[j] < stime[j-1]+time[j-1]){
      |                                                                  ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:35:57: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   35 |                                 if(stime[j] < stime[j-1]+time[j-1]){
      |                                               ~~~~~~~~~~^~~~~~~~~~
a.cc:35:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   35 |                                 if(stime[j] < stime[j-1]+time[j-1]){
      |                                    ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
a.cc:36:71: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         stime[j] = stime[j-1]+time[j-1];
      |                                                                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:36:62: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                                         stime[j] = stime[j-1]+time[j-1];
      |                                                    ~~~~~~~~~~^~~~~~~~~~
a.cc:36:62: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   36 |                                         stime[j] = stime[j-1]+time[j-1];
      |                                                    ~~~~~~~~~~^~~~~~~~~~
      |                                                              |
      |                                                              time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:40:55: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   40 |                         stime[j] = stime[j-1]+time[j-1];
      |                                                       ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:40:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   40 |                         stime[j] = stime[j-1]+time[j-1];
      |                                    ~~~~~~~~~~^~~~~~~~~~
a.cc:40:46: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   40 |                         stime[j] = stime[j-1]+time[j-1];
      |                                    ~~~~~~~~~~^~~~~~~~~~
      |                                              |
      |                                              time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}
a.cc:45:41: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   45 |                 if(max < stime[i]+time[i])
      |                                         ^
a.cc:45:34: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   45 |                 if(max < stime[i]+time[i])
      |                          ~~~~~~~~^~~~~~~~
a.cc:45:24: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   45 |                 if(max < stime[i]+time[i])
      |                    ~~~~^~~~~~~~~~~~~~~~~~
a.cc:46:46: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   46 |                         max = stime[i]+time[i];
      |                                              ^
a.cc:46:39: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   46 |                         max = stime[i]+time[i];
      |                               ~~~~~~~~^~~~~~~~
a.cc:46:39: error: invalid conversion from 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} to 'int' [-fpermissive]
   46 |                         max = stime[i]+time[i];
      |                               ~~~~~~~~^~~~~~~~
      |                                       |
      |                                       time_t (*)(time_t*) noexcept {aka long int (*)(long int*) noexcept}