Language: C++

Solution for 6th Asprova Programming Contest

#define  _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#pragma comment (linker, "/STACK:526000000")

#include "bits/stdc++.h"

using namespace std;
typedef string::const_iterator State;
#define eps 1e-8L
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef float ld;
#define REP(a,b) for(long long (a) = 0;(a) < (b);++(a))
#define ALL(x) (x).begin(),(x).end()

unsigned long xor128() {
    static unsigned long x = 123456789, y = 362436069, z = 521288629, w = 88675123;
    unsigned long t = (x ^ (x << 11));
    x = y; y = z; z = w;
    return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}

void init() {
    iostream::sync_with_stdio(false);
    cout << fixed << setprecision(10);
}



#define int ll
int M, I, R, BL, CL;
typedef struct MachineData {
    int PatchSize;
    int Holiday[10002] = {};
} MachineData;

typedef struct BOMData {
    int GeneratorTime;
    int GeneratorCost;
} BOMData;

typedef struct COMBIData {
    int ChangeTime;
    int ChangeCost;
} COMBIData;

typedef struct OrderData {
    int OrderNumber;
    int PanItr;
    int StartTime;
    int LimitTime;
    int NumberOfPan;
    int DeComposition;
    int Profit;
    int LateAcceptance;
} OrderData;

typedef struct AnswerData {
    int Type;
    int StartTime;
    int EndTime;
    int MachineItr;
    int OrderNumber;
    int NumberOfPun;
} AnswerData;

vector<MachineData> Machine;
BOMData BOM[101][30];
COMBIData Combi[30][101][101];
vector<OrderData> Order;
vector<int> BOMHints[101];
vector<int> MachineToPan[31];
void read_input() {
    {
        string a;
        cin >> a;
        assert(a == "HEADER");
        cin >> M >> I >> R >> BL >> CL;
    }
    Machine = vector<MachineData>(M);
    REP(i, M) {
        string s;
        cin >> s;
        assert(s == "MACHINE");
        int a, b, c;
        cin >> a >> b >> c;
        vector<int> d;
        REP(i, c) {
            int e;
            cin >> e;
            d.push_back(e);
        }
        sort(ALL(d));
        Machine[a].PatchSize = b;
        REP(q, 10002) {
            Machine[a].Holiday[q] = 0;
        }
        REP(q, d.size()) {
            Machine[a].Holiday[d[q] + 1]++;
        }
        REP(q, 10001) {
            Machine[a].Holiday[q + 1] += Machine[a].Holiday[q];
        }
    }
    REP(i, 100) {
        REP(q, 30) {
            BOM[i][q].GeneratorCost = -1;
            BOM[i][q].GeneratorTime = -1;
        }
    }
    REP(i, BL) {
        string a;
        cin >> a;
        assert(a == "BOM");
        int b, c, d, e;
        cin >> b >> c >> d >> e;
        BOM[b][c] = BOMData{ d,e };
        BOMHints[b].push_back(c);
        MachineToPan[c].push_back(b);
    }
    REP(i, CL) {
        string a;
        cin >> a;
        assert(a == "COMBI");
        int b, c, d, e, f;
        cin >> b >> c >> d >> e >> f;
        Combi[b][c][d] = COMBIData{ e,f };
        Combi[b][I][c] = COMBIData{ 0,0 };
        Combi[b][I][d] = COMBIData{ 0,0 };
    }
    REP(i, R) {
        string a;
        cin >> a;
        assert(a == "ORDER");
        int b, c, d, e, f, g, h, ii;
        cin >> b >> c >> d >> e >> f >> g >> h >> ii;
        Order.push_back(OrderData{ b,c,d,e,f,g,h,ii });
    }
    return;
}
void output_answer(vector<AnswerData>& now) {
    sort(ALL(now), [](auto& l, auto& r) {
        return l.StartTime < r.StartTime;
        });
    REP(i, now.size()) {
        if (now[i].Type == 0) {
            cout << "ORDER " << now[i].OrderNumber << " " << now[i].MachineItr << " " << now[i].NumberOfPun
                << " " << now[i].StartTime << " " << now[i].EndTime << "\n";
        }
        else {
            if (now[i].StartTime == now[i].EndTime) continue;
            cout << "COMBI " << now[i].MachineItr << " " << now[i].StartTime << " " << now[i].EndTime << "\n";
        }
    }
}

int CanFillOrder(int remaining, OrderData Info) {
    int split_min = Info.DeComposition;
    if (split_min * 2 > Info.NumberOfPan) {
        split_min = Info.NumberOfPan;
    }
    if (split_min > remaining) return 0;
    int kazu = min(remaining, Info.NumberOfPan);
    if (kazu < Info.NumberOfPan and kazu >= Info.NumberOfPan - Info.DeComposition) {
        kazu = Info.NumberOfPan - Info.DeComposition;
    }
    if (kazu < Info.NumberOfPan - Info.DeComposition) {
        int capacity = 0;
        REP(i, BOMHints[Info.PanItr].size()) {
            capacity = max(capacity, Machine[BOMHints[Info.PanItr][i]].PatchSize);
        }
        for (int target = kazu; target >= split_min; --target) {
            int baseline = (Info.NumberOfPan) - target;
            int cnt = baseline / Info.DeComposition;
            baseline /= cnt;
            if (((Info.NumberOfPan) - target) % cnt) baseline++;
            if (capacity >= baseline) return target;
        }
        return 0;
    }
    else {
        return kazu;
    }
}

bool CheckDate(int left, int right, MachineData& timing) {
    right--;
    left /= 86400;
    right /= 86400;
    right++;
    if (timing.Holiday[right] != timing.Holiday[left]) return false;
    return true;
}

AnswerData AddOrder(int StartTime, int EndTime, int MachineItr, int OrderNumber, int NumberOfPun) {
    AnswerData NowInserting = {};
    NowInserting.Type = 0;
    NowInserting.StartTime = StartTime;
    NowInserting.EndTime = EndTime;
    NowInserting.MachineItr = MachineItr;
    NowInserting.OrderNumber = OrderNumber;
    NowInserting.NumberOfPun = NumberOfPun;
    return NowInserting;
}

AnswerData AddCombi(int StartTime, int EndTime, int MachineItr) {
    AnswerData NowInserting = {};
    NowInserting.Type = 1;
    NowInserting.StartTime = StartTime;
    NowInserting.EndTime = EndTime;
    NowInserting.MachineItr = MachineItr;
    return NowInserting;
}

ll CalculateScore(vector<AnswerData> ans, ld cnt) {
    cnt += 10000000000L;
    REP(i, ans.size()) {
        if (ans[i].Type == 0) {
            int NowOrder = ans[i].OrderNumber;
            ld delay = max(0LL, ans[i].EndTime - Order[NowOrder].LimitTime);
            cnt -= ceil((delay * (ld)Order[NowOrder].Profit * (ld)ans[i].NumberOfPun) / (ld)((ld)Order[NowOrder].LateAcceptance * (ld)Order[NowOrder].NumberOfPan));
        }
    }
    REP(i, Order.size()) {
        cnt += Order[i].Profit;
    }
    return round(1e10L * log10(max(cnt, (ld)1.0)));
}

void solve() {
    //Simple Greedy Method
    ld now_calc = -1;
    vector<AnswerData> GreatAns;
    int trial = 0;
    vector<int> Machine_Ban;
    REP(i, M) {
        Machine_Ban.push_back(i);
    }
    for (trial = 0; clock() <= 1.6L * CLOCKS_PER_SEC; ++trial) {
        vector<OrderData> WaitingOrder = Order;
        sort(ALL(WaitingOrder), [](auto& left, auto& right) {return left.StartTime > right.StartTime; });
        vector<AnswerData> ans;
        vector<int> next_move(Machine.size(), 0);
        vector<int> back_pan(Machine.size(), I);
        vector<OrderData> NowOrder;
        vector<pair<int, int>> CanBurn;
        ld now_ans_penalty = 0;
        ld penaltyBorder = (ld)(xor128() % 50000) / 100.0L;
        
        if (trial <= 20) {
            penaltyBorder = 0.2L * (ld)(trial-1);
        }
        else if (trial > 200) {
            penaltyBorder = (ld)(xor128() % 2000000) / 100.0L;
        }
        
        int PIVOT = 864 / (1 + (ll)xor128 % 1);
        REP(t, 100) {
            int a = xor128() % M;
            int b = xor128() % M;
            swap(Machine_Ban[a], Machine_Ban[b]);
        }
        if (trial <= 1) {
            PIVOT = 864 / 2;
        }
        for (int i = 0; i < 86400000; i += PIVOT) {
            while (WaitingOrder.empty() == false and WaitingOrder.back().StartTime <= i) {
                NowOrder.push_back(WaitingOrder.back());
                WaitingOrder.pop_back();
            }
            if (i % 8640 == 0) {
                sort(ALL(NowOrder), [i](auto& l, auto& r) {
                    ld L = (ld)l.Profit / ((ld)l.LateAcceptance * (ld)Order[l.OrderNumber].NumberOfPan);
                    ld R = (ld)r.Profit / ((ld)r.LateAcceptance * (ld)Order[r.OrderNumber].NumberOfPan);
                    if (l.LimitTime <= i) L *= 4.0L;
                    if (r.LimitTime <= i) R *= 4.0L;
                    return L > R;
                    });
            }
            if (NowOrder.size() == 0) {
                if (WaitingOrder.empty() == true) break;
                i = ((WaitingOrder.back().StartTime - 1) / PIVOT) * PIVOT;
                continue;
            }
            REP(border, 2) {
                REP(tea, next_move.size()) {
                    int q = Machine_Ban[tea];
                    if (next_move[q] > i) continue;
                    if (CheckDate(i, i + 1, Machine[q]) == false) continue;
                    int remaining = Machine[q].PatchSize;
                    int req_time = i + BOM[back_pan[q]][q].GeneratorTime;
                    if (CheckDate(i, req_time, Machine[q]) == true) {
                        ld Penalty = -1e18;
                        if (remaining == Machine[q].PatchSize) {
                            Penalty = penaltyBorder;
                        }
                        int Dryrun = remaining;
                        REP(j, NowOrder.size()) {
                            ld dx = (ld)NowOrder[j].Profit / (ld)NowOrder[j].LateAcceptance;
                            if (dx < Penalty) break;
                            if (NowOrder[j].PanItr != back_pan[q]) continue;
                            if (CanFillOrder(remaining, NowOrder[j]) == 0) continue;
                            int kazu = CanFillOrder(remaining, NowOrder[j]);
                            Dryrun -= kazu;
                            Penalty = -1;
                        }

                        if (Dryrun * 6 <= remaining * 5) {
                            REP(j, NowOrder.size()) {
                                if (NowOrder[j].PanItr != back_pan[q]) continue;
                                if (CanFillOrder(remaining, NowOrder[j]) == 0) continue;
                                int kazu = CanFillOrder(remaining, NowOrder[j]);
                                NowOrder[j].NumberOfPan -= kazu;
                                remaining -= kazu;
                                ans.push_back(AddOrder(i, req_time, q, NowOrder[j].OrderNumber, kazu));
                                if (NowOrder[j].NumberOfPan == 0) {
                                    NowOrder.erase(NowOrder.begin() + j);
                                    j--;
                                }
                                Penalty = -1;
                            }
                        }
                    }
                    if (remaining == Machine[q].PatchSize) {
                        if (border == 0) continue;
                        //need to make pan changes
                        ld Penalty = -1;
                        int itr = -1;
                        int used = back_pan[q];
                        CanBurn.clear();
                        REP(t, MachineToPan[q].size()) {
                            int j = MachineToPan[q][t];
                            if (BOM[j][q].GeneratorCost == -1) continue;
                            int StartTiming = next_move[q];
                            while (CheckDate(StartTiming, StartTiming + Combi[q][used][j].ChangeTime, Machine[q]) == false) {
                                StartTiming = ((86400 + StartTiming) / 86400) * 86400;
                            }
                            if (StartTiming > i) continue;
                            StartTiming += Combi[q][used][j].ChangeTime;
                            if (CheckDate(max(i, StartTiming), max(i, StartTiming) + BOM[j][q].GeneratorTime, Machine[q]) == true) {
                                CanBurn.push_back(mp(j, StartTiming));
                            }
                        }
                        if (CanBurn.size() == 0) continue;
                        ld cnts[101] = {};
                        REP(j, NowOrder.size()) {
                            if (CanFillOrder(remaining, NowOrder[j]) == 0) continue;
                            int check = -1;
                            REP(t, CanBurn.size()) {
                                if (CanBurn[t].first == NowOrder[j].PanItr) {
                                    check = t;
                                    break;
                                }
                            }
                            if (check == -1) continue;
                            ld bias = 1.0L;
                            if (NowOrder[j].LimitTime <= i + 86400) bias = 15.0L;
                            cnts[NowOrder[j].PanItr] += bias * (ld)NowOrder[j].NumberOfPan * (ld)NowOrder[j].Profit / ((ld)NowOrder[j].LateAcceptance * (ld)Order[NowOrder[j].OrderNumber].NumberOfPan);
                        }
                        itr = 0;
                        REP(j, CanBurn.size()) {
                            if (cnts[CanBurn[j].first] == 0) continue;
                            if (cnts[CanBurn[itr].first] == 0) itr = j;
                            if (trial == 0) {
                                if (cnts[CanBurn[j].first] > cnts[CanBurn[itr].first]) {
                                    itr = j;
                                }
                            }
                            else {
                                if (cnts[CanBurn[j].first] / (BOM[CanBurn[j].first][q].GeneratorTime + Combi[q][used][CanBurn[j].first].ChangeTime) > cnts[CanBurn[itr].first] / (BOM[CanBurn[itr].first][q].GeneratorTime + Combi[q][used][CanBurn[itr].first].ChangeTime)) {
                                    itr = j;
                                }
                            }
                        }
                        itr = CanBurn[itr].first;
                        if (cnts[itr] == 0) continue;
                        back_pan[q] = itr;
                        now_ans_penalty -= Combi[q][used][back_pan[q]].ChangeCost;
                        int next_time = 0;
                        REP(t, CanBurn.size()) {
                            if (CanBurn[t].first == itr) {
                                ans.push_back(AddCombi(CanBurn[t].second - Combi[q][used][back_pan[q]].ChangeTime, CanBurn[t].second, q));
                                next_time = max(i, CanBurn[t].second);
                                break;
                            }
                        }
                        int req_time = next_time + BOM[back_pan[q]][q].GeneratorTime;
                        next_move[q] = req_time;
                        REP(j, NowOrder.size()) {
                            if (NowOrder[j].PanItr != back_pan[q]) continue;
                            if (CanFillOrder(remaining, NowOrder[j]) == 0) continue;
                            int kazu = CanFillOrder(remaining, NowOrder[j]);
                            NowOrder[j].NumberOfPan -= kazu;
                            remaining -= kazu;
                            ans.push_back(AddOrder(next_time, req_time, q, NowOrder[j].OrderNumber, kazu));
                            if (NowOrder[j].NumberOfPan == 0) {
                                NowOrder.erase(NowOrder.begin() + j);
                                j--;
                            }
                        }


                        int NowTarget = NowOrder.size();
                        while (WaitingOrder.empty() == false and WaitingOrder.back().StartTime <= next_time) {
                            NowOrder.push_back(WaitingOrder.back());
                            WaitingOrder.pop_back();
                        }

                        while (true) {
                            int itr = -1;
                            ld Penalty = -1;
                            for (int j = NowTarget; j < NowOrder.size(); ++j) {
                                if (NowOrder[j].PanItr != back_pan[q]) continue;
                                if (CanFillOrder(remaining, NowOrder[j]) == 0) continue;
                                ld dx = (ld)NowOrder[j].Profit / (ld)NowOrder[j].LateAcceptance;
                                if (NowOrder[j].LimitTime > i) dx *= 2.0L;
                                if (dx > Penalty) {
                                    Penalty = dx;
                                    itr = j;
                                }
                            }
                            if (itr == -1) break;
                            int kazu = CanFillOrder(remaining, NowOrder[itr]);
                            NowOrder[itr].NumberOfPan -= kazu;
                            remaining -= kazu;
                            ans.push_back(AddOrder(next_time, req_time, q, NowOrder[itr].OrderNumber, kazu));
                            if (NowOrder[itr].NumberOfPan == 0) {
                                NowOrder.erase(NowOrder.begin() + itr);
                            }
                        }

                        while (NowOrder.empty() == false and NowOrder.back().StartTime > i) {
                            WaitingOrder.push_back(NowOrder.back());
                            NowOrder.pop_back();
                        }

                    }
                    else {
                        next_move[q] = req_time;
                    }
                    now_ans_penalty -= BOM[back_pan[q]][q].GeneratorCost;
                    if (NowOrder.size() == 0) break;
                }
            }
        }
        if (NowOrder.size() != 0) continue;
        if (CalculateScore(ans, now_ans_penalty) > now_calc) {
            now_calc = CalculateScore(ans, now_ans_penalty);
            GreatAns = ans;
        }
        if (trial == 1 and I == 100 and M == 30 and R == 10000) break;
    }
    cerr << trial << endl;
    output_answer(GreatAns);
    return;
}
#undef int
int main() {
    init();
    read_input();
    solve();
}


Compiler output:
a.cc:1:1: error: 'Solution' does not name a type
    1 | Solution for 6th Asprova Programming Contest
      | ^~~~~~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:8:
/usr/include/c++/14/ext/type_traits.h:164:35: error: 'constexpr const bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
  164 |   __is_null_pointer(std::nullptr_t)
      |                                   ^
/usr/include/c++/14/ext/type_traits.h:159:5: note: previous declaration 'template<class _Type> constexpr bool __gnu_cxx::__is_null_pointer(_Type)'
  159 |     __is_null_pointer(_Type)
      |     ^~~~~~~~~~~~~~~~~
/usr/include/c++/14/ext/type_traits.h:164:26: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
  164 |   __is_null_pointer(std::nullptr_t)
      |                          ^~~~~~~~~
In file included from /usr/include/c++/14/cstddef:50,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41:
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
  443 |   typedef decltype(nullptr) nullptr_t;
      |                             ^~~~~~~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:60,
                 from /usr/include/c++/14/bits/stl_algobase.h:64:
/usr/include/c++/14/type_traits:666:33: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
  666 |     struct is_null_pointer<std::nullptr_t>
      |                                 ^~~~~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:443:29: note: 'nullptr_t' declared here
  443 |   typedef decltype(nullptr) nullptr_t;
      |                             ^~~~~~~~~
/usr/include/c++/14/type_traits:666:42: error: template argument 1 is invalid
  666 |     struct is_null_pointer<std::nullptr_t>
      |                                          ^
/usr/include/c++/14/type_traits:670:48: error: template argument 1 is invalid
  670 |     struct is_null_pointer<const std::nullptr_t>
      |                                                ^
/usr/include/c++/14/type_traits:674:51: error: template argument 1 is invalid
  674 |     struct is_null_pointer<volatile std::nullptr_t>
      |                                                   ^
/usr/include/c++/14/type_traits:678:57: error: template argument 1 is invalid
  678 |     struct is_null_pointer<const volatile std::nullptr_t>
      |                                                         ^
/usr/include/c++/14/type_traits:1429:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1429 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1429:57: error: template argument 1 is invalid
 1429 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                                         ^
/usr/include/c++/14/type_traits:1429:57: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1438:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1438 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1438:46: error: template argument 1 is invalid
 1438 |     : public integral_constant<std::size_t, 0> { };
      |                                              ^
/usr/include/c++/14/type_traits:1438:46: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1440:26: error: 'std::size_t' has not been declared
 1440 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/14/type_traits:1441:21: error: '_Size' was not declared in this scope
 1441 |     struct rank<_Tp[_Size]>
      |                     ^~~~~
/usr/include/c++/14/type_traits:1441:27: error: template argument 1 is invalid
 1441 |     struct rank<_Tp[_Size]>
      |                           ^
/usr/include/c++/14/type_traits:1442:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1442 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1442:65: error: template argument 1 is invalid
 1442 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/14/type_traits:1442:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:1446:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1446 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/type_traits:1446:65: error: template argument 1 is invalid
 1446 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/14/type_traits:1446:65: note: invalid template non-type parameter
/usr/include/c++/14/type_traits:2086:26: error: 'std::size_t' has not been declared
 2086 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/14/type_traits:2087:30: error: '_Size' was not declared in this scope
 2087 |     struct remove_extent<_Tp[_Size]>
      |                              ^~~~~
/usr/include/c++/14/type_traits:2087:36: error: template argument 1 is invalid
 2087 |     struct remove_extent<_Tp[_Size]>
      |                                    ^
/usr/include/c++/14/type_traits:2099:26: error: 'std::size_t' has not been declared
 2099 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/14/type_traits:2100:35: error: '_Size' was not declared in this scope
 2100 |     struct remove_all_extents<_Tp[_Size]>
      |                                   ^~~~~
/usr/include/c++/14/type_traits:2100:41: error: template argument 1 is invalid
 2100 |     struct remove_all_extents<_Tp[_Size]>
      |                                         ^
/usr/include/c++/14/type_traits:2171:12: error: 'std::size_t' has not been declared
 2171 |   template<std::size_t _Len>
      |            ^~~
/usr/include/c++/14/type_traits:2176:30: error: '_Len' was not declared in this scope
 2176 |         unsigned char __data[_Len];
      |                              ^~~~
/usr/include/c++/14/type_traits:2194:12: error: 'std::size_t' has not been declared
 2194 |   template<std::size_t _Len, std::size_t _Align =
      |            ^~~
/usr/include/c++/14/type_traits:2194:30: error: 'std::size_t' has not been declared
 2194 |   template<std::size_t _Len, std::size_t _Align =
      |                              ^~~
/usr/include/c++/14/type_traits:2195:55: error: '_Len' was not declared in this scope
 2195 |            __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                       ^~~~
/usr/include/c++/14/type_traits:2195:59: error: template argument 1 is invalid
 2195 |            __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                           ^
/usr/include/c++/14/type_traits:2202:30: error: '_Len' was not declared in this scope
 2202 |         unsigned char __data[_Len];
      |                              ^~~~
/usr/include/c++/14/type_traits:2203:44: error: '_Align' was not declared in this scope
 2203 |         struct __attribute__((__aligned__((_Align)))) { } __align;
      |                                            ^~~~~~
In file included from /usr/include/c++/14/bits/stl_tempbuf.h:59,
                 from /usr/include/c++/14/bits/stl_algo.h:69,
                 from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/new:131:26: error: declaration of 'operator new' as non-function
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:131:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  131 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                            ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:132:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  132 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/14/new:133:26: error: declaration of 'operator new []' as non-function
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/14/new:133:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  133 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                              ^~~~~~
/usr/lib/gcc/x86_64-linux-gnu/14/include/stddef.h:214:23: note: 'size_t' declared here
  214 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
/usr/include/c++/14/new:134:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  134 |   __attribute__((__externally_visible__));
      |