Language: C++

#include<iostream>
#include<cstdio>
#include<math.h>
#include<string>
#include<algorithm>
#include<functional>
#include<vector>
#include<set>
#include<map>
#define INF 999999
#define EPS 1.0e-6

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, P> PP;

int n;
int t[105];
int v[105];
int time[105];

int main()
{
	cin >> n;
	
	for (int i = 0; i < n; i++) {
		cin >> t[i];
		time[i+1] = time[i] + t[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}

	double ans = 0;
	double p = 0;
	for (double d = 0.0; d <= time[n]; d += 0.5) {
		double imin = min(d,time[n]-d);
		for (int i = 0; i < n; i++) {
			double k;
			if (time[i] >= d) k = v[i] + (time[i] - d);
			else if (time[i + 1] <= d)k = v[i] + (d - time[i + 1]);
			else k = v[i];
			imin = min(k,imin);
		}
		ans += (p + imin) / 4;
		//cout << imin << endl;
		p = imin;
	}

	printf("%lf\n", ans);

	return 0;
}

Compiler output:
a.cc:22:13: error: 'int time [105]' redeclared as different kind of entity
   22 | int time[105];
      |             ^
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:30:25: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                 time[i+1] = time[i] + t[i];
      |                         ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:30:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                 time[i+1] = time[i] + t[i];
      |                                   ^
a.cc:30:37: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   30 |                 time[i+1] = time[i] + t[i];
      |                             ~~~~~~~~^~~~~~
a.cc:30:27: error: assignment of read-only location '*(time + (((sizetype)i) + 1))'
   30 |                 time[i+1] = time[i] + t[i];
      |                 ~~~~~~~~~~^~~~~~~~~~~~~~~~
a.cc:38:41: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   38 |         for (double d = 0.0; d <= time[n]; d += 0.5) {
      |                                         ^
a.cc:38:32: error: invalid operands of types 'double' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator<='
   38 |         for (double d = 0.0; d <= time[n]; d += 0.5) {
      |                              ~ ^~ ~~~~~~~
      |                              |          |
      |                              double     time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:39:43: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   39 |                 double imin = min(d,time[n]-d);
      |                                           ^
a.cc:39:44: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'double' to binary 'operator-'
   39 |                 double imin = min(d,time[n]-d);
      |                                     ~~~~~~~^~
      |                                           | |
      |                                           | double
      |                                           time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:42:35: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   42 |                         if (time[i] >= d) k = v[i] + (time[i] - d);
      |                                   ^
a.cc:42:37: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'double' to binary 'operator>='
   42 |                         if (time[i] >= d) k = v[i] + (time[i] - d);
      |                             ~~~~~~~ ^~ ~
      |                                   |    |
      |                                   |    double
      |                                   time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:42:61: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   42 |                         if (time[i] >= d) k = v[i] + (time[i] - d);
      |                                                             ^
a.cc:42:63: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'double' to binary 'operator-'
   42 |                         if (time[i] >= d) k = v[i] + (time[i] - d);
      |                                                       ~~~~~~~ ^ ~
      |                                                             |   |
      |                                                             |   double
      |                                                             time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:43:44: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   43 |                         else if (time[i + 1] <= d)k = v[i] + (d - time[i + 1]);
      |                                            ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:43:46: error: invalid operands of types 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} and 'double' to binary 'operator<='
   43 |                         else if (time[i + 1] <= d)k = v[i] + (d - time[i + 1]);
      |                                  ~~~~~~~~~~~ ^~ ~
      |                                            |    |
      |                                            |    double
      |                                            time_t(time_t*) noexcept {aka long int(long int*) noexcept}
a.cc:43:77: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   43 |                         else if (time[i + 1] <= d)k = v[i] + (d - time[i + 1]);
      |                                                                             ^
cc1plus: warning: pointer to a function used in arithmetic [-Wpointer-arith]
a.cc:43:65: error: invalid operands of types 'double' and 'time_t(time_t*) noexcept' {aka 'long int(long int*) noexcept'} to binary 'operator-'
   43 |                         else if (time[i + 1] <= d)k = v[i] + (d - time[i + 1]);
      |                                                               ~ ^ ~~~~~~~~~~~
      |                                                               |             |
      |                                                               double        time_t(time_t*) noexcept {aka long int(long int*) noexcept}