criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <bits/stdc++.h>

using namespace std;

int N;
int t[110], v[110];
int lim[50010];
 
int dp[5][205];
 
int main() {
    while (cin >> N) {
        for (int i = 0; i < N; ++i) 
          cin >> t[i], t[i] *= 2;
        int ans = 0;
        for (int i = 0; i < N; ++i) {
            cin >> v[i], v[i] *= 2;
            for (int j = ans; j < ans + t[i]; ++j) {
                lim[j] = v[i];
            }
            ans += t[i];
        }
        
        for (int i = 0; i < 5; ++i){
          for (int j = 0; j < 205; ++j){
            dp[i][j] = -1e27;
          }
        }
      
        dp[0][0] = 0;
        for (int i = 0; i < ans; ++i) {
          
            for (int j = 0; j < 205; ++j) {
                
                if (j + 1 <= min(lim[i], lim[i+1])) {
                  chmax(dp[(i+1)%2][j+1], dp[i%2][j] + j*2+1);
                }
              
                if (j <= min(lim[i], lim[i+1])){
                  chmax(dp[(i+1)%2][j], dp[i%2][j] + j*2);
                }
              
                if (j - 1 >= 0 && j - 1 <= min(lim[i], lim[i+1])){
                  chmax(dp[(i+1)%2][j-1], dp[i%2][j] + j*2-1);
                }
            }
            
            for (int j = 0; j < 205; ++j) dp[i%2][j] = -1e27;
          
        }
        
       printf("%.10lf\n",(double)dp[0][0]*0.125);
    }
}
 
 
 


Compiler output:
a.cc: In function 'int main()':
a.cc:27:24: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+27' to '-2147483648' [-Woverflow]
   27 |             dp[i][j] = -1e27;
      |                        ^~~~~
a.cc:37:19: error: 'chmax' was not declared in this scope
   37 |                   chmax(dp[(i+1)%2][j+1], dp[i%2][j] + j*2+1);
      |                   ^~~~~
a.cc:41:19: error: 'chmax' was not declared in this scope
   41 |                   chmax(dp[(i+1)%2][j], dp[i%2][j] + j*2);
      |                   ^~~~~
a.cc:45:19: error: 'chmax' was not declared in this scope
   45 |                   chmax(dp[(i+1)%2][j-1], dp[i%2][j] + j*2-1);
      |                   ^~~~~
a.cc:49:56: warning: overflow in conversion from 'double' to 'int' changes value from '-1.0e+27' to '-2147483648' [-Woverflow]
   49 |             for (int j = 0; j < 205; ++j) dp[i%2][j] = -1e27;
      |                                                        ^~~~~
Language: C++

#include <iostream>
using namespace std;

int main() {
	int n, sum = 0;
	int t[201],v[201];
	double tl[40001];
	cin>>n;
	for(int i = 0; n > i; i++)
		cin >> t[i];
	for(int i = 0; n > i; i++)
		cin >> v[i];
		
	for(int i = 0; n > i; i++){
		int tc = t[i] * 2,vc = v[i];
		tl[sum] = min(tl[sum],vc);
		for(int i = 1+sum; sum + tc >= i; i++)
			tl[i] = vc;
		
		for(int i = 0; sum >= i; i++)
			tl[i] = min(tl[i], vc + (sum - i)*0.5);
		sum += tc;
	}
	
	double ans = 0;
	double cur = 0,bef = 0;
	for(int i = 1; sum >= i; i++){
		tl[i] = min(1.0*tl[i], (sum - i)*0.5);
		cur = min(bef + 0.5, 1.0*tl[i]);
		
		ans += (cur + bef) / 4.0;
		bef = cur;
	}
	
	cout << ans << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:30: error: no matching function for call to 'min(double&, int&)'
   16 |                 tl[sum] = min(tl[sum],vc);
      |                           ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 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/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:16:30: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   16 |                 tl[sum] = min(tl[sum],vc);
      |                           ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define d_5 100000
#define d9_7 1000000007
#define vll vector<vector<long long>>
#define vl vector<long long>
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define pf push_front
int main(void){
  int n;
  cin>>n;
  long double sumt=0;
  vector<long double> t(n),v(n),accumt(n);
  rep(i,n){
    cin>>t[i];
    sumt+=t[i];
  }
  rep(i,n){
    cin>>v[i];
  }
  accumt[0]=0;
  rep(i,n-1){
    accumt[i+1]=accumt[i]+t[i];//以前まで何秒立ったかの、累積
  }
  vi posnum(2*(int)(sumt)+1,-1);
  int now=0;
  rep(i,n){
    rep(j,t[i]*2){
      posnum[now]=i;
      now++;
    }
  }
  posnum[2*sumt]=n-1;
  posnum[2*sumt-1]=n-1;
  /*cout<<"posnum ";
  rep(i,2*(int)(sumt)+1){
    cout<<posnum[i]<<" ";
  }
  cout<<endl;*/
  vector<long double> points(2*(int)(sumt)+1,99999);
  rep(i,2*sumt+1){
    long double tmp=min(((long double)(i))*0.5,sumt-((long double)(i))*0.5);
    rep(j,n){
      if(posnum[i]==j){
        tmp=min(v[j],tmp);
        //cout<<" == "<<i<<" p "<<posnum[i];
      }
        if(((long double)(i))*0.5<=accumt[j]){
          tmp=min(tmp,v[j]+(accumt[j]-((long double)(i))*0.5));
        }
        if(((long double)(i))*0.5>=accumt[j]+t[j]){
          tmp=min(tmp,v[j]+(((long double)(i))*0.5-(accumt[j]+t[j])));
        }
      }
    }
    points[i]=tmp;
  }
  long double ans=0;
  rep(i,2*((int)sumt)){
    ans+=(points[i]+points[i+1])*0.25;
  }
  /*rep(i,2*(int)(sumt)+1){
    cout<<points[i]<<" ";
  }
  cout<<endl;*/
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:12: error: 'i' was not declared in this scope
   62 |     points[i]=tmp;
      |            ^
a.cc:62:15: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   62 |     points[i]=tmp;
      |               ^~~
      |               tm
a.cc: At global scope:
a.cc:2:18: error: expected unqualified-id before 'for'
    2 | #define rep(i,n) for(int i = 0; i < n; i++)
      |                  ^~~
a.cc:65:3: note: in expansion of macro 'rep'
   65 |   rep(i,2*((int)sumt)){
      |   ^~~
a.cc:65:7: error: 'i' does not name a type; did you mean 'vi'?
   65 |   rep(i,2*((int)sumt)){
      |       ^
a.cc:2:33: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0; i < n; i++)
      |                                 ^
a.cc:65:7: error: 'i' does not name a type; did you mean 'vi'?
   65 |   rep(i,2*((int)sumt)){
      |       ^
a.cc:2:40: note: in definition of macro 'rep'
    2 | #define rep(i,n) for(int i = 0; i < n; i++)
      |                                        ^
a.cc:72:3: error: 'cout' does not name a type
   72 |   cout<<ans<<endl;
      |   ^~~~
a.cc:73:3: error: expected unqualified-id before 'return'
   73 |   return 0;
      |   ^~~~~~
a.cc:74:1: error: expected declaration before '}' token
   74 | }
      | ^
Language: C++


def main():
    buf = input()
    N = int(buf)
    buf = input()
    buflist = buf.split()
    t = list(map(int, buflist))
    buf = input()
    buflist = buf.split()
    v = list(map(int, buflist))
    t.append(0)
    v.append(0)
    for i, _ in enumerate(t): # double time and speed to make calculation easier
        t[i] *= 2
        v[i] *= 2
    time = 0
    last_speed = 0
    speed = 0
    distance = 0.0
    point = 0
    spd_time_list = []
    for i, _ in enumerate(t):
        spd_time_list.append((v[i], (0 if not spd_time_list else t[i-1] + spd_time_list[-1][1])))
    while time < spd_time_list[-1][1]:
        last_speed = speed
        brake = False
        for i in range(point+1, len(spd_time_list)):
            if speed >= spd_time_list[i][0] + (spd_time_list[i][1] - time):
                brake = True
                break
        if brake:
            speed -= 1
        elif speed < spd_time_list[point][0]:
            speed += 1
        distance += (last_speed + speed) / 2
        time += 1
        if time >= spd_time_list[point+1][1]:
            point += 1
    distance /= 4 # roll back time and speed (and so the distance)
    print(distance)

if __name__ == '__main__':
    main()


Compiler output:
a.cc:13:31: error: stray '#' in program
   13 |     for i, _ in enumerate(t): # double time and speed to make calculation easier
      |                               ^
a.cc:39:19: error: stray '#' in program
   39 |     distance /= 4 # roll back time and speed (and so the distance)
      |                   ^
a.cc:42:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   42 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:1: error: 'def' does not name a type
    2 | def main():
      | ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
vector<double>t,v,ts;

double fni(int i,double tn){
	if(tn<ts[i])return(v[i]+ts[i]-tn);
	else if(tn>ts[i+1])return(v[i]+tn-ts[i+1]);
	else return v[i];
}
double fn(double tn){
	double ret=0.0;
	for(int i=0;i<=n;i++)ret=max(ret,fni(i,tn));
	return ret;
}


int main(){
	int n;cin>>n;
	 t.resize(n);
	ts.resize(n+1,0);
	v.resize(n);
	for(auto&& w:t)cin>>w;
	for(auto&& w:v)cin>>w;
	for(int i=0,i<n;i++)ts[i+1]=ts[i]+t[i];
	double v0=0.0;
	double d=0.0
	for(int i=0<i<ts[n+1];i++){
	double v1=fn(i+0.5); double v2=fn(i+1);
	d+=(v0+2*v1+v2)/2;
	v0=v2;
	}
	cout<<d<<endl;
}

Compiler output:
a.cc: In function 'double fn(double)':
a.cc:12:24: error: 'n' was not declared in this scope
   12 |         for(int i=0;i<=n;i++)ret=max(ret,fni(i,tn));
      |                        ^
a.cc: In function 'int main()':
a.cc:24:22: error: expected ';' before '<' token
   24 |         for(int i=0,i<n;i++)ts[i+1]=ts[i]+t[i];
      |                      ^
      |                      ;
a.cc:24:22: error: expected primary-expression before '<' token
a.cc:27:9: error: expected ',' or ';' before 'for'
   27 |         for(int i=0<i<ts[n+1];i++){
      |         ^~~
a.cc:27:31: error: 'i' was not declared in this scope
   27 |         for(int i=0<i<ts[n+1];i++){
      |                               ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>


#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;

int n;
vector<double> v;
vector<double> l;
vector<double> r;
double speed(double t) {
	double maxV = 100;
	rep(0, n + 2) {
		double reti = 0;
		if (t <= l[i]) reti = v[i] + l[i] - t;
		else if (r[i] <= t) reti = v[i] + t - r[i];
		else reti = v[i];
		maxV = min(maxV, reti);
	}
	return maxV;
}

//D

int main(void) {
	
	cin >> n;	
	v = vector<double>(n + 2);
	l = vector<double>(n + 2);
	r = vector<double>(n + 2);
	v[0] = 0; l[0] = 0; r[0] = 0;
	v[n + 1] = 0;
	int T= 0;
	rep(1, n+1) {
		int ti = 0;
		cin >> ti;
		r[i] = r[i - 1] + ti;
		l[i] = r[i - 1];
		T += ti;
	}
	l[n] = r[n - 1];
	rep(1, n + 1) {
		cin >> v[i];
	}
	l[n + 1] = T; r[n + 1] = T;
	double ans = 0;
	for (double i = 0; i < T; i += 0.5) {
		double s1 = speed(i);
		double s2 = speed(i + 0.5);
		ans += 0.25*(s1 + s2);
	}
	cout << setprecision(14) << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:17: error: 'setprecision' was not declared in this scope
   63 |         cout << setprecision(14) << ans << endl;
      |                 ^~~~~~~~~~~~
a.cc:9:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    8 | #include <map>
  +++ |+#include <iomanip>
    9 |
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>


#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;

int n;
vector<double> v;
vector<double> l;
vector<double> r;
double speed(double t) {
	double maxV = 100;
	rep(0, n + 2) {
		double reti = 0;
		if (t <= l[i]) reti = v[i] + l[i] - t;
		else if (r[i] <= t) reti = v[i] + t - r[i];
		else reti = v[i];
		maxV = min(maxV, reti);
	}
	return maxV;
}

//D

int main(void) {
	cout<<fixed<<setprecision(4);
	cin >> n;	
	v = vector<double>(n + 2);
	l = vector<double>(n + 2);
	r = vector<double>(n + 2);
	v[0] = 0; l[0] = 0; r[0] = 0;
	v[n + 1] = 0;
	int T= 0;
	rep(1, n+1) {
		int ti = 0;
		cin >> ti;
		r[i] = r[i - 1] + ti;
		l[i] = r[i - 1];
		T += ti;
	}
	l[n] = r[n - 1];
	rep(1, n + 1) {
		cin >> v[i];
	}
	l[n + 1] = T; r[n + 1] = T;
	double ans = 0;
	for (double i = 0; i < T; i += 0.5) {
		double s1 = speed(i);
		double s2 = speed(i + 0.5);
		ans += 0.25*(s1 + s2);
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:22: error: 'setprecision' was not declared in this scope
   37 |         cout<<fixed<<setprecision(4);
      |                      ^~~~~~~~~~~~
a.cc:9:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    8 | #include <map>
  +++ |+#include <iomanip>
    9 |
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>
#include"bits\stdc++.h"

#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;

int n;
vector<double> v;
vector<double> l;
vector<double> r;
double speed(double t) {
	double maxV = 100;
	rep(0, n + 2) {
		double reti = 0;
		if (t <= l[i]) reti = v[i] + l[i] - t;
		else if (r[i] <= t) reti = v[i] + t - r[i];
		else reti = v[i];
		maxV = min(maxV, reti);
	}
	return maxV;
}

//D

int main(void) {

	cin >> n;
	v = vector<double>(n + 2);
	l = vector<double>(n + 2);
	r = vector<double>(n + 2);
	v[0] = 0; l[0] = 0; r[0] = 0;
	v[n + 1] = 0;
	int T = 0;
	rep(1, n + 1) {
		int ti = 0;
		cin >> ti;
		r[i] = r[i - 1] + ti;
		l[i] = r[i - 1];
		T += ti;
	}
	l[n] = r[n - 1];
	rep(1, n + 1) {
		cin >> v[i];
	}
	l[n + 1] = T; r[n + 1] = T;
	double ans = 0;
	for (double i = 0; i < T-0.1; i += 0.5) {
		double s1 = speed(i);
		double s2 = speed(i + 0.5);
		ans += 0.25*(s1 + s2);
	}
	cout << fixed<<setprecision(10)<<ans << endl;
	return 0;
}

Compiler output:
a.cc:9:9: fatal error: bits\stdc++.h: No such file or directory
    9 | #include"bits\stdc++.h"
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include <cmath>
#include <limits>
#include <utility>
#include <map>


#define rep(p,q) for(int i = p;i < q;i++)
#define ll long long

using namespace std;

const int cons = 1e9 + 7;

int n;
vector<double> v;
vector<double> l;
vector<double> r;
double speed(double t) {
	double maxV = 100;
	rep(0, n + 2) {
		double reti = 0;
		if (t <= l[i]) reti = v[i] + l[i] - t;
		else if (r[i] <= t) reti = v[i] + t - r[i];
		else reti = v[i];
		maxV = min(maxV, reti);
	}
	return maxV;
}

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main () {
  int N;
  int T = 0;
  int s[102];
  int e[102];
  int v[102];
  cin >> N;
  for (int i = 1; i <= N; i ++) {
    cin >> s[i];
    int ti = T;
    T += s[i];
    s[i] = ti;
    e[i] = T;
  }
  s[N + 1] = e[N + 1] = T;
  for (int i = 1; i <= N; i ++) cin >> v[i];
  s[0] = e[0] = v[0] = v[N + 1] = 0;
  vector<vector<long float>>vm(2 * T + 1, vector<long float>(N + 2));
  for (int j = 0; j < 2 * T + 1; j ++) {
    long float k = j * 0.5;
    for (int i = 0; i < N + 2; i ++) {
      if (s[i] * 2 > j) vm[j][i] = (long float)v[i] + s[i] - k;
      if (s[i] * 2 <= j && j <= e[i] * 2) vm[j][i] = (long float)v[i];
      if (e[i] * 2 < j) vm[j][i] = (long float)v[i] - e[i] + k;
    }
    long float a = vm[j][0];
    for (int i = 1; i < N + 2; i ++) {
      if (a > vm[j][i]) a = vm[j][i];
    }
    vm[j][0] = a;
  }
  long float ans = 0;
  for (int i = 0; i < 2 * T; i ++) {
    ans += (vm[i][0] + vm[i + 1][0]) * 0.25;
  }
  cout << ans << endl;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'long' specified with 'float'
   21 |   vector<vector<long float>>vm(2 * T + 1, vector<long float>(N + 2));
      |                 ^~~~
a.cc:21:50: error: 'long' specified with 'float'
   21 |   vector<vector<long float>>vm(2 * T + 1, vector<long float>(N + 2));
      |                                                  ^~~~
a.cc:23:5: error: 'long' specified with 'float'
   23 |     long float k = j * 0.5;
      |     ^~~~
a.cc:25:37: error: 'long' specified with 'float'
   25 |       if (s[i] * 2 > j) vm[j][i] = (long float)v[i] + s[i] - k;
      |                                     ^~~~
a.cc:26:55: error: 'long' specified with 'float'
   26 |       if (s[i] * 2 <= j && j <= e[i] * 2) vm[j][i] = (long float)v[i];
      |                                                       ^~~~
a.cc:27:37: error: 'long' specified with 'float'
   27 |       if (e[i] * 2 < j) vm[j][i] = (long float)v[i] - e[i] + k;
      |                                     ^~~~
a.cc:29:5: error: 'long' specified with 'float'
   29 |     long float a = vm[j][0];
      |     ^~~~
a.cc:35:3: error: 'long' specified with 'float'
   35 |   long float ans = 0;
      |   ^~~~
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <utility>
#include <string>
#include <algorithm>
#include <map>
#include <vector>
#include <climits>
#include <numeric>
#include<stdio.h>
#include <queue>
#include <iomanip>
#include <float.h>
#include <set>
#include<functional>
#include <stack>
#include <time.h>
#include <climits>
#include <bitset>
using namespace std;
signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout <<fixed<< setprecision(15);
	int n;
	int speed[103];
	int t[103];
	int v[103];
	int now = 0;
	cin >> n;
	t[0] = 0;
	for (int i = 1; i <= n; i++) {
		cin >> t[i];
		now += t[i];
		t[i] = now;
	}
	for (int i = 0; i < n; i++) {
		cin >> v[i];
	}
	int dp[30003][103];
	for (int j = 0; j < 103; j++) {
		dp[0][j] = INT_MIN / 2;
	}
	dp[0][0] = 0;
	int limit = v[0];
	int x = 1;
	for (int i = 1; i <= now; i++) {
		for (int j = 0; j <= limit; j++) {
			if (j == 0&&j!=limit)dp[i][j] = max(dp[i - 1][j] + 4*j+1, dp[i -1][j + 1] + 2*(2*j+1));
			if(j==limit&&j!=0)dp[i][j] = max(dp[i - 1][j] + 4*j,dp[i - 1][j - 1] + 2*(2*j-1));
			if (j == limit&&limit == 0) {
				dp[i][j] = dp[i - 1][j] + 4 * j
			}
			if (j < limit&&j != 0) {
				dp[i][j] = max(dp[i - 1][j] + 4 * j + 1, max(dp[i - 1][j - 1] + 2*(j + j - 1), dp[i - 1][j + 1] +(2 * j + 1)*2));
			}
		}
		if (i == t[x] && x < n) {
			limit = v[x];
			x += 1;
			for (int j = limit+1; j < 103; j++) {
				dp[i][j] = INT_MIN / 2;
			}
		}
	}
	cout << (double)dp[now][0]/4;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:53:64: error: expected ';' before '}' token
   53 |                                 dp[i][j] = dp[i - 1][j] + 4 * j
      |                                                                ^
      |                                                                ;
   54 |                         }
      |                         ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;

ll INF = (1ll << 32);
double EPS + 1e-4;

int main() {
  ll N;
  cin >> N;
  vi t(N), v(N);
  for (ll i = 0; i < N; i++) {
    cin >> t[i];
  }
  for (ll i = 0; i < N; i++) {
    cin >> v[i];
  }

  vector<vector<double>> dp(N, vector<double>(101, -(double)INF));
  for (ll j = 0; j <= v[0]; j++) {
    if (N >= 2 && j > v[1]) {
      continue;
    }
    double x = (double)(j + t[0]) / 2;
    if (x < -EPS || x - EPS > t[0]) {
      continue;
    }
    if (x > v[0]) {
      dp[0][j] = max(dp[0][j], (double)t[0] * v[0] - (double)v[0] * v[0] / 2 - (double)(v[0] - j) * (v[0] - j) / 2);
    } else {
      dp[0][j] = max(dp[0][j], (double)x * x / 2 + (double)(t[0] - x) * (x + j) / 2);
    }
  }

  for (ll i = 1; i < N; i++) {
    for (ll k = 0; k <= min(v[i - 1], v[i]); k++) {
      for (ll j = 0; j <= v[i]; j++) {
        if (i < N - 1 && j > v[i + 1]) {
          continue;
        }
        double x = (double)(j - k + t[i]) / 2;
        if (x < -EPS || x - EPS > t[i]) {
          continue;
        }
        if ((double)k + x > v[i]) {
          dp[i][j] = max(dp[i][j], dp[i - 1][k] + t[i] * v[i] - (double)(v[i] - k) * (v[i] - k) / 2 - (double)(v[i] - j) * (v[i] - j) / 2);
        } else {
          dp[i][j] = max(dp[i][j], dp[i - 1][k] + (double)(x + k + k) * x / 2 + (double)(x + j + k) * ((double)t[i] - x) / 2);
        }
      }
    }
  }

  cout << fixed;
  cout << dp[N - 1][0] << endl;
}


Compiler output:
a.cc:12:12: error: expected initializer before '+' token
   12 | double EPS + 1e-4;
      |            ^
a.cc: In function 'int main()':
a.cc:31:14: error: 'EPS' was not declared in this scope
   31 |     if (x < -EPS || x - EPS > t[0]) {
      |              ^~~
a.cc:48:18: error: 'EPS' was not declared in this scope
   48 |         if (x < -EPS || x - EPS > t[i]) {
      |                  ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;

void vec_cout(vector<int> &vec){
    for(int i=0; i<vec.size(); i++){
        if (i!=0){
            cout << ' ';
        }
        cout<< vec[i];
    }
    cout << endl;
}

int main(){
    int N;
    int inf=1000000007;
    cin >> N;
    vector<int> t(N);
    vector<int> v(N);
    vector<int> limited(1,0);
    for(int i=0; i<N; i++){
        cin >> t[i];
        t[i]*=2;
    }
    for(int i=0; i<N; i++){
        cin >> v[i];
        v[i]*=2;
        for(int j=0; j<t[i]; j++){
            limited.push_back(v[i]);
        }
    }
    limited[limited.size()-1]=0;
    
    int time = limited.size();
    for(int i=1; i<time; i++){
        limited[i]=min(limited[i-1]+1,limited[i]);
    }
    for(int i=time-2; i>=0; i--){
        limited[i]=min(limited[i+1]+1,limited[i]);
    }
    int sum_=accumulate(limited.begin(),limited.end(),0);
    #vec_cout(limited);
    cout << sum_/4.0 << endl;
}

Compiler output:
a.cc:47:6: error: invalid preprocessing directive #vec_cout
   47 |     #vec_cout(limited);
      |      ^~~~~~~~
Language: C++

#include<bits/stdc++.h>

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{int x,y,t;};
struct Edge{int to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=1010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(int from,int to,int cost){E[from-1].pb({to-1,cost});}
};

struct train{
  double v,t;
};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;cin>>n;
  vector<int>t(n+10);
  vector<int>v(n+10);
  for(int i=0;i<n;i++)cin>>t[i];
  for(int i=0;i<n;i++)cin>>v[i];

  double ans = 0,speed=0;
  for(int i=0;i<n;i++){
    for(double j=0;j<t[i];j+=0.5){
      bool flag=true,flag2=true;
      double time = t[i]-j-0.5;
      for(int k=i+1;k<n;k++){
	time += t[k];
	if(speed+0.5-time > v[k+1])flag=false;
	if(speed-v[k+1] > time) flag2=false;
      }
      if(speed+0.5 <= v[i] && flag &&(speed+0.5-(t[i]-j-0.5))<=v[i+1]){
	ans += speed*0.5;
	ans += 0.125;
	speed += 0.5;
      }else if(speed - v[i+1] <= t[i]-j-0.5 &&flag2){
	ans += speed*0.5
      }else{
	speed -= 0.5;
	ans += speed*0.5;
	ans += 0.125;
      }
    }
  }
  printf("%.10lf\n",ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:25: error: expected ';' before '}' token
   52 |         ans += speed*0.5
      |                         ^
      |                         ;
   53 |       }else{
      |       ~
Language: C++

#include <algorithm>
#include <array>
#include <vector>
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <functional>
#include <queue>

//AtCoderC++.cpp

using namespace std;

template<typename T> void Show(vector<vector<T>> v) {
	for (int i = 0; i < v.size(); i++) {
		for (int j = 0; j < v[i].size(); j++) {
			cout << v[i][j];
			if (j != v[i].size() - 1) {
				cout << " ";
			} else {
				cout << endl;
			}
		}
	}
}


template<typename T> void Show(vector<T> v) {
	for (int i = 0; i < v.size(); i++) {
		cout << v[i];
		if (i != v.size() - 1) {
			cout << " ";
		} else {
			cout << endl;
		}
	}
}

double V_in = 0;
int T_Sum = 0;
int t = 0;



	//進入速度、次の区間の制限速度、現在の区間の制限速度、区間のタイム
double Move(int V_out, int Limit, int Time) {
	//ある時点tで、v=SUM(T)-tを超えていたら、どうやっても間に合わない。
	V_out = min(V_out, T_Sum - (t + Time));
	if (V_out > Limit) {//次の区間の制限速度が今の区間より大きい。
		if (Time > Limit - V_in) {//最高速度到達
			double d = (V_in + Limit)*(Limit - V_in) / (double)2 + Limit * (Time - (Limit - V_in));
			V_in = Limit;
			return d;
		} else {//到達前に時間切れ
			double d = (V_in + V_in+Time)*(Time) / (double)2;
			V_in += Time;
			return d;
		}
	} else if(V_out>V_in){//最高速は下がるが、今の速度よりは大きい。
		if (Time >= V_out - V_in) {//余裕あり。
			if (Time > (Limit - V_in) + (Limit - V_out)) {//何秒か最高速を維持する
				double d = (V_in + Limit)*(Limit - V_in) / (double)2
					+ Limit * (Time - (Limit - V_in) - (Limit - V_out))
					+ (V_out + Limit)*(Limit - V_out) / (double)2;
				V_in = V_out;
				return d;
			} else {//あるところで加速から減速に向かうピークを持つ。
				double v = (Time + V_in + V_out) / (double)2;
				double d = (V_in + v)*(v - V_in) / (double)2 + (V_out + v)*(v - V_out) / (double)2;
				V_in = V_out;
				return d;
			}
		} else {//V_out到達前に時間切れ
			double d = (V_in + V_out + Time)*(Time) / (double)2;
			V_in += Time;
			return d;
		}
	} else {//今の速度が次の制限速度以上。
		if (Time >= V_in - V_out) {//余裕あり。
			if (Time > (Limit - V_in) + (Limit - V_out)) {//何秒か最高速を維持する
				double d = (V_in + Limit)*(Limit - V_in) / (double)2
					+ Limit * (Time - (Limit - V_in) - (Limit - V_out))
					+ (V_out + Limit)*(Limit - V_out) / (double)2;
				V_in = V_out;
				return d;
			} else {//あるところで加速から減速に向かうピークを持つ。
				double v = (Time + V_in + V_out) / (double)2;
				double d = (V_in + v)*(v - V_in) / (double)2 + (V_out + v)*(v - V_out) / (double)2;
				V_in = V_out;
				return d;
			}
		} else {//V_out到達前に時間切れ
			return 0;
		}
	}
}


int main() {
	int N;
	cin >> N;
	vector<int> Time = vector<int>(), Limit = vector<int>();
	Time.resize(N); Limit.resize(N + 1);
	for (int i = 0; i < N; i++) {
		cin >> Time[i];
		T_Sum += Time[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> Limit[i];
	}
	Limit[N] = 0;
	double sum = 0;
	for (int i = 0; i < N; i++) {
		sum += Move(Limit[i + 1], Limit[i], Time[i]);
		t += Time[i];
	}
	cout << sum << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:118:29: error: expected '}' at end of input
  118 |         cout << sum << endl;
      |                             ^
a.cc:100:12: note: to match this '{'
  100 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vb = vector<bool>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define LINF 1E18*5
#define EPS 1E-9
#define MOD 1000000007
#define PI 3.1415926535897932384

template<class S, class T>ostream& operator<<(ostream&os, pair<S, T>p) { os << "[" << p.first << ", " << p.second << "]"; return os; };
template<class S>auto&operator<<(ostream&os, vector<S>t) { bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; } return os; }

//int dx[]={1,1,1,0,-1,-1,-1,0},dy[8]={1,0,-1,-1,-1,0,1,1,1};
//
constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

int main() {
	int n, in;
	vi t, v;
	int ans = 0;
	cin >> n;
	vi vr(1,0),vl(1,0);
	rep(i, n) {
		cin >> in; in *= 2;
		t.push_back(in);
	}
	rep(i, n) {
		cin >> in; in *= 2;
		v.push_back(in);
		vr.back() = min(vr.back(), in);
		rep(j, t[i]) {
			vr.push_back(min(vr.back()+1,in));
		}
	}
	//cout << vr << endl;/*
	//vr.back() = 0;
	//vl.back() = 0;
	range(i,1, vr.size()) {
		vr[i] = min(vr[i], vl[i-1]+1);
	}
	rep(i, vl.size()-1) {
		vl[i] = vl[i+1];
	}
	rep(i, vr.size()) {
		vr[i] = min(vr[i], vl[i]);
		rep(j, vl.size()) {
			if (j>i) vr[i] = min(vr[i], vl[j] + (j - i));
		}
	}*/
	int tmp = 0;
	for (int i = vr.size() - 2;i>=0;i--) {
		tmp = min(vr[i],min(tmp + 1, vr[i]));
		//cout <<tmp  << endl;
		ans += tmp;
	}
	cout << ans/4.0 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:11: error: expected primary-expression before '/' token
   68 |         }*/
      |           ^
a.cc:69:9: error: expected primary-expression before 'int'
   69 |         int tmp = 0;
      |         ^~~
a.cc:71:17: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   71 |                 tmp = min(vr[i],min(tmp + 1, vr[i]));
      |                 ^~~
      |                 tm
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long i = 0; i < n; i++)
#define erep(i, n) for(long i = 1; i <= n; i++)

int main(){long N;
cin >> N;
vector<long> t(N + 1); vector<long> v(N + 1);
erep(i, N) cin >> t.at(i);
erep(i, N) cin >> v.at(i);
vector<long> s(N + 1);
for(long i = 0; i <= N - 1; i++){
    s.at(i + 1) = s.at(i) + t.at(i + 1);
}
vector<long> upinc(N + 1); vector<long>downinc(N + 1);
erep(i, N) upinc.at(i) = min(upinc.at(i - 1), v.at(i - 1) - s.at(i- 1));
downinc.at(N) = s.at(N);
for(long i = N - 1; i >= 1; i--){
    downinc.at(i) = min(downinc.at(i + 1), s.at(i) + v.at(i + 1));
}
double ans = 0;
for(long i = 1; i <= N; i++){
    for(double t = s.at(i - 1) + 0.000001; t <= s.at(i); t += 0.000001){
        ans += min(min(v.at(i), upinc.at(i) + t), downinc.at(i) - t) * 0.000001;
    }
}


cout << ans << endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:23: error: no matching function for call to 'min(__gnu_cxx::__alloc_traits<std::allocator<long int>, long int>::value_type&, double)'
   24 |         ans += min(min(v.at(i), upinc.at(i) + t), downinc.at(i) - t) * 0.000001;
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:24:23: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'double')
   24 |         ans += min(min(v.at(i), upinc.at(i) + t), downinc.at(i) - t) * 0.000001;
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:24:23: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   24 |         ans += min(min(v.at(i), upinc.at(i) + t), downinc.at(i) - t) * 0.000001;
      |                    ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int N, T[2][101], V[101], max_s[200 * 100 + 1];

int main() {
    int t, times = 0;
    cin >> N;
    REP(i, N)  {
        cin >> t;
        if (i > 0) {
            T[0][i] = T[1][i - 1];
            T[1][i] = T[1][i - 1] + t;
        }
        else {
            T[1][0] = t;
        }
        times += t;
    }
    REP(i, N) cin >> V[i];
    T[0][N] = T[1][N] = times; V[N] = 0;

    REP(i, times) {
        int limit = INT_MAX;
        REP(j, N + 1) {
            if (T[0][j] <= i && i <= T[1][j]) {
                limit = V[j];
                break;
            }
        }
        REP(j, N + 1) {
            if (i <= T[0][j]) {
                limit = min(limit, V[j] + T[0][j] - i);
            }
        }
        max_s[i] = limit;
    }

    double ans = 0;
    int speed = 0, before = -1;
    REP(i, times + 1) {
        speed = min(speed, max_s[i]);
        ans += speed;
        if (speed == before && speed < max_s[i - 1])
            ans += 0.25;
        before = speed++;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:21: error: 'INT_MAX' was not declared in this scope
   37 |         int limit = INT_MAX;
      |                     ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <vector>
  +++ |+#include <climits>
    5 | #include <string>
Language: C++

#include <bits/stdc++.h>
using namespace std;

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;
typedef long double LD;

int main(){
  int n;
  cin >> n;
  vector<LL> t(n),v(n);
  for(int i=0;i<n;i++){
    cin >> t[i];
  }
  for(int i=0;i<n;i++){
    cin >> v[i];
  }
  vector<LL> ji(n+1);
  ji[0]=0;
  for(int i=1;i<=n;i++){
    ji[i]=ji[i-1]+t[i-1];
  }
  vector<LL> tv(ji[n]+1,0),hi(ji[n]+1,0),mi(ji[n]+1,0);
  LL now=1;
  for(int i=1;i<ji[n];i++){
    tv[i]=v[now-1];
    if(i==ji[now]){
      now++;
      tv[i]=min(tv[i],v[now-1]);
    }
  }
  tv[0]=tv[ji[n]]=0;
  for(int i=0;i<=ji[n];i++) cout << tv[i] << " ";
  cout <<endl;
  hi[0]=0;
  mi[ji[n]]=0;
  for(int i=1;i<=ji[n];i++){
    hi[i]=min(hi[i-1]+1,tv[i]);
  }
  for(int i=ji[n]-1;i>=0;i--){
    mi[i]=min(mi[i+1]+1,tv[i]);
  }
  vector<LL> ansv(ji[n]+1,0);
  for(int i=0;i<=ji[n];i++){
    ansv[i]+=min(hi[i],mi[i]);
  }
  // for(int i=0;i<=ji[n];i++) cout << ansv[i] << " ";
  // cout <<endl;
  LD ans=0;
  for(int i=1;i<=ji[n];i++){
    if(ansv[i]!=ansv[i-1]) ans+=((LD)ansv[i]+ansv[i-1])/2;
    else if(ansv[i]<tv[i]||ans[i-1]<tv[i-1]) ans+=(LD)ansv[i]+0.25;
    else ans+=ansv[i];
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:31: error: invalid types 'LD {aka long double}[int]' for array subscript
   54 |     else if(ansv[i]<tv[i]||ans[i-1]<tv[i-1]) ans+=(LD)ansv[i]+0.25;
      |                               ^
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl
#define POSSIBLE(condition) if(condition){cout << "POSSIBLE" << endl;}else{cout << "IMPOSSIBLE" << endl;}
#define Possible(condition) if(condition){cout << "Possible" << endl;}else{cout << "Impossible" << endl;}
#define possible(condition) if(condition){cout << "possible" << endl;}else{cout << "impossible" << endl;}
#define Size(n) (n).size()

typedef long long ll;


using namespace std;

const int INF = 1e9,MOD = 1e9 + 7,ohara = 1e6;
const ll LINF = 1e18;


long long int n,cnt=0,a,b,c,d,cmp,cmpp,m,h,w,x,y,sum=0,pos,T,t[ohara],limitv[ohara],nowtime=0;
double v[ohara],ans;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl=true;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

int main(void){
       cin.tie(0);
    ios::sync_with_stdio(false);

      
      cin>>n;

      rep(i,n){
        cin>>t[i];
        T+=t[i];
      }

        rep(i,200*100)v[i]=1000000000.0;

      rep(i,n){
        cin>>limitv[i];
        rrep(j,nowtime,nowtime+t[i]*2+1)v[j]=min(v[j],(double)limitv[i]);
        nowtime+=t[i]*2;
        v[nowtime]=min(v[nowtime],kimitv[i]);
      }
    
      v[0]=0.0;v[2*T]=0.0;

      rrep(i,1,2*T+1){
        v[i]=min(v[i],v[i-1]+0.5);
      }

      v[0]=0.0;v[2*T]=0.0;
      rrrep(i,2*T,0){
        v[i]=min(v[i],v[i+1]+0.5);
      }

      v[0]=0.0;v[2*T]=0.0;

     rep(i,2*T){
       double up,down;
       up=v[i+1];
       down=v[i];
       ans+=(up+down)*0.5/2.0;
     }

     printf("%.15f\n",ans);
   


     

       
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:35: error: 'kimitv' was not declared in this scope; did you mean 'limitv'?
   54 |         v[nowtime]=min(v[nowtime],kimitv[i]);
      |                                   ^~~~~~
      |                                   limitv
Language: C++

#include "iostream"
#include "algorithm"
#include "string"
#include "vector"
#include "cmath"
#include "bitset"
#include "queue"
#include "functional"

#define lp(n) for (int i = 0; i < n; i++)
#define LP(n,i) for (int i = 0; i < n; i++)
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define nya_n "(=^･ω･^=)"
typedef long long ll;
using namespace std;

int n, s, v, mem, t[100], lm[40001];
double ac[40001], ans;

/*
ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	ll g = gcd(x, y);
	return x / g * y;
}*/



int main(){
	cin >> n;
	s = 0;
	lp(n)
		cin >> t[i];
	lp(n) {
		cin >> v;
		for (int j = s * 2; j <= (s + t[i]) * 2; j++)
			lm[j] = v;
		s += t[i];

	}
	ac[0] = 0;
	lp(s * 2 - 1) {
		ac[i + 1] = (ac[i] + 0.5 > lm[i] ? lm[i] : ac[i] + 0.5);
	}
	ac[s * 2] = 0;
	for (int i = s * 2 - 1; i >= 0; i--) {
		ac[i] = min(ac[i], (ac[i + 1] + 0.5 > lm[i] ? lm[i] : ac[i + 1] + 0.5));
	}
	ans = 0;
	lp(s * 2) {
//		cout << double(i)/2 << sp << ac[i] << endl;
		ans += (ac[i] + ac[i + 1]) / 4;
	}
	cout << ans << endl;
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:61:18: error: expected '}' at end of input
   61 |         return 0;
      |                  ^
a.cc:35:11: note: to match this '{'
   35 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/range/adaptors.hpp>

using namespace std;
using boost::adaptors::reversed;
using boost::irange;
using uint = unsigned int;
using ll = long long int;
using ull = unsigned long long int;

vector<double> apply_condition(double v, ll l, ll r, ll T_size){
    constexpr double ACC = 2;
    vector<double> ret(T_size);
    for (ll i = l; i <= r; i++){
        ret.at(i) = v;
    }
    for (ll i = l - 1; i >= 0; i--){
        ret.at(i) = ret.at(i + 1) + ACC;
    }
    for (ll i = r + 1; i < T_size; i++){
        ret.at(i) = ret.at(i - 1) + ACC;
    }
    return ret;
}



int main() {
    ll N;
    cin >> N;
    vector<ll> ts(N);
    for (auto && i: irange(0LL, N)){
        ll t;
        cin >> t;
        t *= 2;
        ts.at(i) = t;
    }
    vector<double> vs(N);
    for (auto && i: irange(0LL, N)){
        double v;
        cin >> v;
        v *= 4;
        vs.at(i) = v;
    }
    vector<ll> Ts(N+1, 0);
    for (auto && i: irange(1LL, N+1)){
        Ts.at(i) = Ts.at(i-1) + ts.at(i-1);
    }
    ll T_size = Ts.back() + 1;
    vector<vector<ll>> v_limit{};
    v_limit.emplace_back(apply_condition(0, 0, 0, T_size));
    v_limit.emplace_back(apply_condition(0, Ts.back(), Ts.back(), T_size));
    for (auto && i: irange(0LL, N)){
        v_limit.emplace_back(apply_condition(vs.at(i), Ts.at(i), Ts.at(i+1), T_size));
    }
    vector<double> v_limits(T_size);
    for (auto && i: irange(0LL, T_size)){
        ll minimum = numeric_limits<double>::max();
        for (auto && j: irange(0LL, N+2)){
            minimum = min(minimum, v_limit.at(j).at(i));
        }
        v_limits.at(i) = minimum;
    }
    double val{0};
    for (auto && i: irange(0LL, T_size - 1)){
        val += ((double)v_limits.at(i) + (double)v_limits.at(i+1)) / 2;
    }
    double val_double = val;
    cout << val_double / 8 << endl;





    return 0;
}

Compiler output:
a.cc:2:10: fatal error: boost/range/irange.hpp: No such file or directory
    2 | #include <boost/range/irange.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main {
    @lombok.ToString
    private class Section {
        int l, r, v;

        public Section(int now, int t, int v) {
            this.l = now;
            this.r = now + t;
            this.v = v;
        }

        public double getMaxV(double t) {
            if (t < l) {
                return v + (l - t);
            } else if (r < t) {
                return v + (t - r);
            } else {
                return v;
            }
        }
    }

    public void main(Scanner sc) {
        int n = sc.nextInt();
        int t[] = new int[n];
        for (int i = 0; i < n; i++) {
            t[i] = sc.nextInt();
        }

        Section secs[] = new Section[n + 2];
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            int v = sc.nextInt();
            secs[i] = new Section(sum, t[i - 1], v);
            sum += t[i - 1];
        }

        secs[0] = new Section(0, 0, 0);
        secs[n + 1] = new Section(sum, 0, 0);

        double ans = 0.0;
        for (double now = 0.0; now <= sum - 0.5; now += 0.5) {
            double v1 = secs[0].getMaxV(now);
            double v2 = secs[0].getMaxV(now + 0.5);
            for (int i = 1; i < n + 2; i++) {
                v1 = Math.min(v1, secs[i].getMaxV(now));
                v2 = Math.min(v2, secs[i].getMaxV(now + 0.5));
            }

            ans += (v1 + v2) * 0.25;
        }

        System.out.println(ans);
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        new Main().main(sc);
        sc.close();
    }
}


Compiler output:
Main.java:4: error: package lombok does not exist
    @lombok.ToString
           ^
1 error
Language: C++

#include <iostream>
#include <iomanip>
using namespace std;

int main() {
	int n;cin>>n;
	int t[n],v[n];
	for(int i=0;i<n;i++)cin>>t[i];
	for(int i=0;i<n;i++)cin>>v[i];
	int first[n],last[n+1];
	last[n]=0;
	int exspeed=0;
	for(int i=0;i<n;i++){
		if(exspeed+t[i]<=v[i]){
			first[i]=exspeed+t[i];
		}else{
			first[i]=v[i];
		}
		exspeed=first[i];
	}
	exspeed=0;
	for(int i=n-1;i>=0;i--){
		if(exspeed+t[i]<=v[i]){
			last[i]=exspeed+t[i];
		}else{
			last[i]=v[i];
		}
		exspeed=last[i];
	}
	int speed[n+1];
	exspeed=0;
	for(int i=0;i<n;i++){
		if(first[i]<=last[i+1]){
			speed[i]=first[i];
		}else{
			speed[i]=last[i+1];
		}
	}
	double ans=0;
	exspeed=0;
	for(int i=0;i<n;i++){
		if(exspeed+t[i]==speed[i]){
			ans+=double(exspeed+speed[i])*t[i]/2;
		}else{
			if(t[i]>=v[i]-exspeed+v[i]-speed[i]){
				ans+=double(t[i]-2*v[i]+exspeed+speed[i])*v[i]+double(exspeed+v[i])*(v[i]-exspeed)/2+double(v[i]+speed[i])*(v[i]-speed[i])/2;
			}else{
				double ve=double(t[i]+speed[i]+exspeed)/2;
				ans+=double(exspeed+ve)*(t[i]+speed[i]-exspeed)/2/2+(ve+speed[i])*(t[i]+exspeed-speed[i])/2/2;
			}
		}
		exspeed=speed[i];
	}
	cout<<setprecision(15)<<ans<<endl;

	return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:56:18: error: expected '}' at end of input
   56 |         return 0;
      |                  ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

#include <iostream>

using namespace std;

double speed_limit(int cond_j, double time, int* t, int* v) {
  if (time < t[cond_j-1]) {
    return v[cond_j] + t[cond_j-1] - time;
  } else if (time < t[cond_j]) {
    return v[cond_j];
  } else {
    return v[cond_j] + time - t[cond_j];
  }
}

int main() {
  int i, j;
  int N;
  int t[210] = {};
  int v[110] = {};
  cin >> N;
  for (i = 1; i < N+1; i++) {
    cin >> t[i];
    t[i] = t[i-1]+t[i];
  }
  for (i = 1; i < N+1; i++) {
    cin >> v[i];
  }
  double velocity[80010] = {};
  for (i = 1; i < 2*t[N]; i++) {
    velocity[i] = min(i*0.5, t[N] - i*0.5);
    for (j = 0; j < N+1; j++) {
      velocity[i] = min(velocity[i], speed_limit(j, i*0.5, t, v));
    }
  }
  //for (i = 0; i < 2*t[N]; i++) {
  //  cout << velocity[i] << endl;
  //}
  double ans = 0;
  for (i = 0; i < 2*t[N]; i++) {
    ans += velocity[i];
  }
  ans = ans/2
  cout << ans << endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:42:14: error: expected ';' before 'cout'
   42 |   ans = ans/2
      |              ^
      |              ;
   43 |   cout << ans << endl;
      |   ~~~~
Language: C++

#include <iostream>

using namespace std;

double speed_limit(int cond_j, double time, int* t, int* v) {
  if (time < t[cond_j-1]) {
    return v[cond_j] + t[cond_j-1] - time;
  } else if (time < t[cond_j]) {
    return v[cond_j];
  } else {
    return v[cond_j] + time - t[cond_j];
  }
}

int main() {
  int i, j;
  int N;
  int t[210] = {};
  int v[110] = {};
  cin >> N;
  for (i = 1; i < N+1; i++) {
    int t;
    cin >> t;
    t[i] = t[i-1]+t;
  }
  for (i = 1; i < N+1; i++) {
    cin >> v[i];
  }
  double velocity[40010] = {};
  for (i = 0; i < 2*t[N]; i++) {
    velocity[i] = min(i*0.5, t[N] - i*0.5);
    for (j = 1; j < N+1; j++) {
      velocity[i] = min(velocity[i], speed_limit(j, i*0.5, t, v));
    }
  }
  //for (i = 0; i < 2*t[N]; i++) {
  //  cout << velocity[i] << endl;
  //}
  double ans = 0;
  for (i = 0; i < 2*t[N]; i++) {
    ans += velocity[i]*0.5;
  }
  cout << ans << endl;
  return 0;
}
  


Compiler output:
a.cc: In function 'int main()':
a.cc:24:6: error: invalid types 'int[int]' for array subscript
   24 |     t[i] = t[i-1]+t;
      |      ^
a.cc:24:13: error: invalid types 'int[int]' for array subscript
   24 |     t[i] = t[i-1]+t;
      |             ^