Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
using namespace std;

int n;
double l;
vector<Event> ev;

bool simulate(double pump) {
    double tank = l,vol = pump;
    int t = 0;

    //first day
    for(int i=0; i<ev.size(); ++i) {
        tank = min(tank + vol * (ev[i].time - t), l);
        if(tank <= 0) return false;
        vol += ev[i].diff;
        t = ev[i].time;
    }
    tank = min(tank + vol * (86400 - t), l);

    //second day
    double sf = tank;
    vol = pump; t = 0;

    for(int i=0; i<ev.size(); ++i) {
        tank = min(tank + vol * (ev[i].time - t), l);
        if(tank <= 0) return false;
        vol += ev[i].diff;
        t = ev[i].time;
    }
    tank = min(tank + vol * (86400 - t), l);

    return (tank >= sf);
}

const double eps = 1e-7;

int main() {
    int s,t,u;
    while(cin>>n>>l) {
        if(n == 0 && l == 0.0) break;
        ev.clear();
        double lo = 0.0,hi = l;
        for(int i=0; i<n; ++i) {
            cin>>s>>t>>u;
            ev.push_back(Event(s,-u));
            ev.push_back(Event(t,u));
            hi = max((double)u, hi);
        }

        while(lo + eps < hi) {
            double mid = (lo + hi)/2;
            if(simulate(mid)) hi = mid;
            else lo = mid;
        }
        printf("%.6f\n", lo);
    }
}

Compiler output:
a.cc:9:8: error: 'Event' was not declared in this scope
    9 | vector<Event> ev;
      |        ^~~~~
a.cc:9:13: error: template argument 1 is invalid
    9 | vector<Event> ev;
      |             ^
a.cc:9:13: error: template argument 2 is invalid
a.cc: In function 'bool simulate(double)':
a.cc:16:23: error: request for member 'size' in 'ev', which is of non-class type 'int'
   16 |     for(int i=0; i<ev.size(); ++i) {
      |                       ^~~~
a.cc:17:36: error: invalid types 'int[int]' for array subscript
   17 |         tank = min(tank + vol * (ev[i].time - t), l);
      |                                    ^
a.cc:19:18: error: invalid types 'int[int]' for array subscript
   19 |         vol += ev[i].diff;
      |                  ^
a.cc:20:15: error: invalid types 'int[int]' for array subscript
   20 |         t = ev[i].time;
      |               ^
a.cc:28:23: error: request for member 'size' in 'ev', which is of non-class type 'int'
   28 |     for(int i=0; i<ev.size(); ++i) {
      |                       ^~~~
a.cc:29:36: error: invalid types 'int[int]' for array subscript
   29 |         tank = min(tank + vol * (ev[i].time - t), l);
      |                                    ^
a.cc:31:18: error: invalid types 'int[int]' for array subscript
   31 |         vol += ev[i].diff;
      |                  ^
a.cc:32:15: error: invalid types 'int[int]' for array subscript
   32 |         t = ev[i].time;
      |               ^
a.cc: In function 'int main()':
a.cc:45:12: error: request for member 'clear' in 'ev', which is of non-class type 'int'
   45 |         ev.clear();
      |            ^~~~~
a.cc:49:16: error: request for member 'push_back' in 'ev', which is of non-class type 'int'
   49 |             ev.push_back(Event(s,-u));
      |                ^~~~~~~~~
a.cc:49:26: error: 'Event' was not declared in this scope
   49 |             ev.push_back(Event(s,-u));
      |                          ^~~~~
a.cc:50:16: error: request for member 'push_back' in 'ev', which is of non-class type 'int'
   50 |             ev.push_back(Event(t,u));
      |                ^~~~~~~~~