Language: C++

s[0]: LR[0, 23), TB[0, 4), base:1, prec:0
s[0]: LR[0, 23), TB[0, 4), base:1, prec:1
s[0]: LR[0, 23), TB[0, 4), base:1, prec:2
s[2]: LR[0, 23), TB[0, 4), base:1, prec:0
s[2]: LR[0, 23), TB[0, 4), base:1, prec:1
s[2]: LR[0, 23), TB[0, 4), base:1, prec:2
Returns 1
s[6]: LR[0, 23), TB[0, 4), base:1, prec:1
s[6]: LR[0, 23), TB[0, 4), base:1, prec:2
s[8]: LR[6, 10), TB[0, 1), base:0, prec:0
s[8]: LR[6, 10), TB[0, 1), base:0, prec:1
s[8]: LR[6, 10), TB[0, 1), base:0, prec:2
Returns 4
s[7]: LR[6, 10), TB[2, 4), base:3, prec:0
s[7]: LR[6, 10), TB[2, 4), base:3, prec:1
s[7]: LR[6, 10), TB[2, 4), base:3, prec:2
s[2][8]: 2
3^2: L83
3^2
Returns 9
9^2009
Returns 1788
s[1][11] L57
s[0][12]: 2
224^2: L83
224^2
Returns 1912
s[16]: LR[0, 23), TB[0, 4), base:1, prec:2
s[18]: LR[0, 23), TB[0, 4), base:1, prec:2
Returns 5
Returns -5
-1516
s[0]: LR[0, 5), TB[0, 3), base:1, prec:0
s[0]: LR[0, 5), TB[0, 3), base:1, prec:1
s[0]: LR[0, 5), TB[0, 3), base:1, prec:2
s[2]: LR[0, 5), TB[0, 3), base:1, prec:2
s[3]: LR[2, 5), TB[0, 1), base:0, prec:0
s[3]: LR[2, 5), TB[0, 1), base:0, prec:1
s[3]: LR[2, 5), TB[0, 1), base:0, prec:2
Returns 3
s[3]: LR[2, 5), TB[2, 3), base:2, prec:0
s[3]: LR[2, 5), TB[2, 3), base:2, prec:1
s[3]: LR[2, 5), TB[2, 3), base:2, prec:2
Returns 4
4^2009
Returns 1509
Returns -1509
-1509
s[0]: LR[0, 13), TB[0, 4), base:1, prec:0
s[0]: LR[0, 13), TB[0, 4), base:1, prec:1
s[0]: LR[0, 13), TB[0, 4), base:1, prec:2
s[1]: LR[0, 13), TB[0, 1), base:0, prec:0
s[1]: LR[0, 13), TB[0, 1), base:0, prec:1
s[1]: LR[0, 13), TB[0, 1), base:0, prec:2
Returns 3
s[5]: LR[0, 13), TB[0, 1), base:0, prec:1
s[5]: LR[0, 13), TB[0, 1), base:0, prec:2
Returns 4
s[9]: LR[0, 13), TB[0, 1), base:0, prec:2
s[11]: LR[0, 13), TB[0, 1), base:0, prec:2
Returns 2
Returns -2
s[3]: LR[0, 13), TB[2, 4), base:3, prec:0
s[3]: LR[0, 13), TB[2, 4), base:3, prec:1
s[3]: LR[0, 13), TB[2, 4), base:3, prec:2
s[5]: LR[0, 13), TB[2, 4), base:3, prec:2
Returns 1
Returns -1
-1^2009
Returns 5
5
s[0]: LR[0, 7), TB[0, 2), base:1, prec:0
s[0]: LR[0, 7), TB[0, 2), base:1, prec:1
s[0]: LR[0, 7), TB[0, 2), base:1, prec:2
s[2]: LR[0, 7), TB[0, 2), base:1, prec:0
s[2]: LR[0, 7), TB[0, 2), base:1, prec:1
s[2]: LR[0, 7), TB[0, 2), base:1, prec:2
s[0][3]: 2
4^2: L83
4^2
Returns 16
s[1][5] L57
s[0][6]: 3
16^3: L83
16^3
Returns 74
74
s[0]: LR[0, 17), TB[0, 1), base:0, prec:0
s[0]: LR[0, 17), TB[0, 1), base:0, prec:1
s[0]: LR[0, 17), TB[0, 1), base:0, prec:2
Returns 2
s[4]: LR[0, 17), TB[0, 1), base:0, prec:1
s[4]: LR[0, 17), TB[0, 1), base:0, prec:2
Returns 3
s[8]: LR[0, 17), TB[0, 1), base:0, prec:2
Returns 5
s[12]: LR[0, 17), TB[0, 1), base:0, prec:1
s[12]: LR[0, 17), TB[0, 1), base:0, prec:2
Returns 7
s[16]: LR[0, 17), TB[0, 1), base:0, prec:1
s[16]: LR[0, 17), TB[0, 1), base:0, prec:2
Returns 9
19
s[0]: LR[0, 25), TB[0, 1), base:0, prec:0
s[0]: LR[0, 25), TB[0, 1), base:0, prec:1
s[0]: LR[0, 25), TB[0, 1), base:0, prec:2
s[2]: LR[0, 25), TB[0, 1), base:0, prec:0
s[2]: LR[0, 25), TB[0, 1), base:0, prec:1
s[2]: LR[0, 25), TB[0, 1), base:0, prec:2
Returns 2
s[6]: LR[0, 25), TB[0, 1), base:0, prec:1
s[6]: LR[0, 25), TB[0, 1), base:0, prec:2
Returns 3
s[0][8] L57
Returns 5
s[12]: LR[0, 25), TB[0, 1), base:0, prec:2
s[14]: LR[0, 25), TB[0, 1), base:0, prec:0
s[14]: LR[0, 25), TB[0, 1), base:0, prec:1
s[14]: LR[0, 25), TB[0, 1), base:0, prec:2
Returns 5
s[18]: LR[0, 25), TB[0, 1), base:0, prec:1
s[18]: LR[0, 25), TB[0, 1), base:0, prec:2
Returns 7
s[0][20] L57
Returns 2009
s[24]: LR[0, 25), TB[0, 1), base:0, prec:1
s[24]: LR[0, 25), TB[0, 1), base:0, prec:2
Returns 9
2010
s[0]: LR[0, 8), TB[0, 3), base:1, prec:0
s[0]: LR[0, 8), TB[0, 3), base:1, prec:1
s[0]: LR[0, 8), TB[0, 3), base:1, prec:2
s[0][1]: 2
4^2: L83
4^2
Returns 16
s[5]: LR[0, 8), TB[0, 3), base:1, prec:1
s[5]: LR[0, 8), TB[0, 3), base:1, prec:2
s[1]: LR[5, 8), TB[0, 1), base:0, prec:0
s[1]: LR[5, 8), TB[0, 1), base:0, prec:1
s[1]: LR[5, 8), TB[0, 1), base:0, prec:2
Returns 2
s[6]: LR[5, 8), TB[2, 3), base:2, prec:0
s[6]: LR[5, 8), TB[2, 3), base:2, prec:1
s[6]: LR[5, 8), TB[2, 3), base:2, prec:2
Returns 5
5^2009
Returns 1207
1223
s[0]: LR[0, 14), TB[0, 3), base:1, prec:0
s[0]: LR[0, 14), TB[0, 3), base:1, prec:1
s[0]: LR[0, 14), TB[0, 3), base:1, prec:2
s[0][1]: 2
4^2: L83
4^2
Returns 16
s[5]: LR[0, 14), TB[0, 3), base:1, prec:1
s[5]: LR[0, 14), TB[0, 3), base:1, prec:2
s[7]: LR[0, 14), TB[0, 3), base:1, prec:2
s[1]: LR[7, 14), TB[0, 1), base:0, prec:0
s[1]: LR[7, 14), TB[0, 1), base:0, prec:1
s[1]: LR[7, 14), TB[0, 1), base:0, prec:2
Returns 2
s[10]: LR[7, 14), TB[2, 3), base:2, prec:0
s[10]: LR[7, 14), TB[2, 3), base:2, prec:1
s[10]: LR[7, 14), TB[2, 3), base:2, prec:2
Returns 5
5^2009
Returns 1207
Returns -1207
1223
s[0]: LR[0, 25), TB[0, 9), base:1, prec:0
s[0]: LR[0, 25), TB[0, 9), base:1, prec:1
s[0]: LR[0, 25), TB[0, 9), base:1, prec:2
s[12]: LR[0, 25), TB[0, 1), base:0, prec:0
s[12]: LR[0, 25), TB[0, 1), base:0, prec:1
s[12]: LR[0, 25), TB[0, 1), base:0, prec:2
Returns 1
s[1]: LR[0, 25), TB[2, 9), base:3, prec:0
s[1]: LR[0, 25), TB[2, 9), base:3, prec:1
s[1]: LR[0, 25), TB[2, 9), base:3, prec:2
Returns 1
s[5]: LR[0, 25), TB[2, 9), base:3, prec:1
s[5]: LR[0, 25), TB[2, 9), base:3, prec:2
s[14]: LR[5, 24), TB[2, 3), base:2, prec:0
s[14]: LR[5, 24), TB[2, 3), base:2, prec:1
s[14]: LR[5, 24), TB[2, 3), base:2, prec:2
Returns 1
s[6]: LR[5, 24), TB[4, 9), base:5, prec:0
s[6]: LR[5, 24), TB[4, 9), base:5, prec:1
s[6]: LR[5, 24), TB[4, 9), base:5, prec:2
Returns 1
s[10]: LR[5, 24), TB[4, 9), base:5, prec:1
s[10]: LR[5, 24), TB[4, 9), base:5, prec:2
s[16]: LR[10, 23), TB[4, 5), base:4, prec:0
s[16]: LR[10, 23), TB[4, 5), base:4, prec:1
s[16]: LR[10, 23), TB[4, 5), base:4, prec:2
Returns 1
s[11]: LR[10, 23), TB[6, 9), base:7, prec:0
s[11]: LR[10, 23), TB[6, 9), base:7, prec:1
s[11]: LR[10, 23), TB[6, 9), base:7, prec:2
Returns 1
s[15]: LR[10, 23), TB[6, 9), base:7, prec:1
s[15]: LR[10, 23), TB[6, 9), base:7, prec:2
s[18]: LR[15, 22), TB[6, 7), base:6, prec:0
s[18]: LR[15, 22), TB[6, 7), base:6, prec:1
s[18]: LR[15, 22), TB[6, 7), base:6, prec:2
Returns 1
s[16]: LR[15, 22), TB[8, 9), base:8, prec:0
s[16]: LR[15, 22), TB[8, 9), base:8, prec:1
s[16]: LR[15, 22), TB[8, 9), base:8, prec:2
Returns 1
s[20]: LR[15, 22), TB[8, 9), base:8, prec:1
s[20]: LR[15, 22), TB[8, 9), base:8, prec:2
Returns 2
3^2009
Returns 1341
1342^2009
Returns 1509
1510^2009
Returns 1437
1438^2009
Returns 1646
1646
s[0]: LR[0, 24), TB[0, 15), base:7, prec:0
s[0]: LR[0, 24), TB[0, 15), base:7, prec:1
s[0]: LR[0, 24), TB[0, 15), base:7, prec:2
s[1]: LR[0, 24), TB[0, 7), base:3, prec:0
s[1]: LR[0, 24), TB[0, 7), base:3, prec:1
s[1]: LR[0, 24), TB[0, 7), base:3, prec:2
s[3]: LR[0, 24), TB[0, 7), base:3, prec:0
s[3]: LR[0, 24), TB[0, 7), base:3, prec:1
s[3]: LR[0, 24), TB[0, 7), base:3, prec:2
s[7]: LR[3, 12), TB[0, 3), base:2, prec:0
s[7]: LR[3, 12), TB[0, 3), base:2, prec:1
s[7]: LR[3, 12), TB[0, 3), base:2, prec:2
Returns 2
s[4]: LR[3, 12), TB[4, 7), base:5, prec:0
s[4]: LR[3, 12), TB[4, 7), base:5, prec:1
s[4]: LR[3, 12), TB[4, 7), base:5, prec:2
s[5]: LR[4, 7), TB[4, 5), base:4, prec:0
s[5]: LR[4, 7), TB[4, 5), base:4, prec:1
s[5]: LR[4, 7), TB[4, 5), base:4, prec:2
Returns 7
s[5]: LR[4, 7), TB[6, 7), base:6, prec:0
s[5]: LR[4, 7), TB[6, 7), base:6, prec:1
s[5]: LR[4, 7), TB[6, 7), base:6, prec:2
Returns 4
4^2009
Returns 1510
s[10]: LR[3, 12), TB[4, 7), base:5, prec:1
s[10]: LR[3, 12), TB[4, 7), base:5, prec:2
Returns 1
1511^2009
Returns 732
s[15]: LR[0, 24), TB[0, 7), base:3, prec:1
s[15]: LR[0, 24), TB[0, 7), base:3, prec:2
s[7]: LR[15, 20), TB[0, 3), base:2, prec:0
s[7]: LR[15, 20), TB[0, 3), base:2, prec:1
s[7]: LR[15, 20), TB[0, 3), base:2, prec:2
Returns 2
s[4]: LR[15, 20), TB[4, 7), base:5, prec:0
s[4]: LR[15, 20), TB[4, 7), base:5, prec:1
s[4]: LR[15, 20), TB[4, 7), base:5, prec:2
s[17]: LR[4, 7), TB[4, 5), base:4, prec:0
s[17]: LR[4, 7), TB[4, 5), base:4, prec:1
s[17]: LR[4, 7), TB[4, 5), base:4, prec:2
Returns 3
s[24]: LR[4, 7), TB[6, 7), base:6, prec:0
s[24]: LR[4, 7), TB[6, 7), base:6, prec:1
s[24]: LR[4, 7), TB[6, 7), base:6, prec:2
a.out: D.cpp:78: intmax_t parse(const std::__debug::vector<std::__cxx11::basic_string<char> >&, size_t&, size_t, size_t, size_t, size_t, size_t, size_t, const std::__debug::vector<std::__cxx11::basic_string<char> >&): Assertion `false' failed.
Aborted (core dumped)

#include <cstdio>
#include <cstdint>
#include <cassert>
#include <cctype>
#include <algorithm>
#include <vector>
#include <string>

constexpr intmax_t MOD=2011;

intmax_t apply(intmax_t lhs, char op, intmax_t rhs) {
  switch (op) {
  case '+': return (lhs + rhs) % MOD;
  case '-': return ((lhs - rhs) % MOD + MOD) % MOD;
  case '*': return (lhs * rhs) % MOD;
  }
  assert(false);
}

intmax_t modpow(intmax_t base, intmax_t iexp) {
  fprintf(stderr, "%jd^%jd\n", base, iexp);
  intmax_t res=1;
  for (intmax_t dbl=base; iexp; iexp>>=1) {
    if (iexp & 1) (res *= dbl) %= MOD;
    (dbl *= dbl) %= MOD;
  }
  return res;
}

intmax_t moddiv(intmax_t num, intmax_t den) {
  intmax_t div=modpow(den, MOD-2);
  return num*div % MOD;
}

intmax_t parse(const std::vector<std::string> &s, size_t &i,
               size_t top, size_t bottom, size_t left, size_t right,
               size_t preced=0, size_t base=-1,
               const std::vector<std::string> &ops={"+-", "*"}) {

  while (base+1 == 0) {
    for (size_t r=top; r<bottom; ++r) {
      if (s[r][i] != '.') {
        base = r;
        break;
      }
    }
    if (base+1 == 0) ++i;
  }
  assert(base+1 != 0);
  fprintf(stderr, "s[%zu]: LR[%zu, %zu), TB[%zu, %zu), base:%zu, prec:%zu\n",
          i, left, right, top, bottom, base, preced);

  if (preced == ops.size()) {
    intmax_t res=114514;
    if (s[base][i] == '(') {
      res = parse(s, i+=2, top, bottom, left, right, 0, base);
      fprintf(stderr, "s[%zu][%zu] L%d\n", base, i, __LINE__);
      assert(s[base][i] == ')');
      ++i;
    } else if (s[base][i] == '-') {
      if (s[base][i+1] == '-') {
        size_t vl=i, vr=i+1;
        while (s[base][++vr] == '-') {}

        size_t j=left+1;
        intmax_t numer=parse(s, j, top, base, vl, vr, 0);
        j = left+1;
        intmax_t denom=parse(s, j, base+1, bottom, vl, vr, 0);
        res = moddiv(numer, denom);
        i = vr;
      } else {
        res = -parse(s, i+=2, top, bottom, left, right, preced, base);
      }
    } else if (isdigit(s[base][i])) {
      res = s[base][i]-'0';
      ++i;
    } else {
      assert(false);
    }

    if (i < right && top+1 <= base && isdigit(s[base-1][i])) {
      fprintf(stderr, "s[%zu][%zu]: %c\n", base-1, i, s[base-1][i]);
      fprintf(stderr, "%jd^%jd: L%d\n", res, intmax_t(s[base-1][i]-'0'), __LINE__);
      res = modpow(res, s[base-1][i]-'0');
      ++i;
    }
    ++i;
    fprintf(stderr, "Returns %jd\n", res);
    return res;
  }

  intmax_t lhs=parse(s, i, top, bottom, left, right, preced+1, base);
  while (i < right) {
    char op=s[base][i];
    if (!std::count(ops[preced].begin(), ops[preced].end(), op)) break;
    intmax_t rhs=parse(s, i+=2, top, bottom, left, right, preced+1, base);
    lhs = apply(lhs, op, rhs);
  }
  return lhs;
}

int testcase_ends() {
  size_t n;
  scanf("%zu", &n);
  if (n == 0) return 1;

  std::vector<std::string> s;
  for (size_t i=0; i<n; ++i) {
    char buf[128];
    scanf("%s", buf);
    s.emplace_back(buf);
  }

  size_t i=0;
  intmax_t res=parse(s, i, 0, s.size(), 0, s[0].length());
  printf("%jd\n", res);
  return 0;
}

int main() {
  while (!testcase_ends()) {}
}



Compiler output:
a.cc:272:229: error: stray '`' in program
  272 | a.out: D.cpp:78: intmax_t parse(const std::__debug::vector<std::__cxx11::basic_string<char> >&, size_t&, size_t, size_t, size_t, size_t, size_t, size_t, const std::__debug::vector<std::__cxx11::basic_string<char> >&): Assertion `false' failed.
      |                                                                                                                                                                                                                                     ^
a.cc:272:235: warning: missing terminating ' character
  272 | a.out: D.cpp:78: intmax_t parse(const std::__debug::vector<std::__cxx11::basic_string<char> >&, size_t&, size_t, size_t, size_t, size_t, size_t, size_t, const std::__debug::vector<std::__cxx11::basic_string<char> >&): Assertion `false' failed.
      |                                                                                                                                                                                                                                           ^
a.cc:272:235: error: missing terminating ' character
  272 | a.out: D.cpp:78: intmax_t parse(const std::__debug::vector<std::__cxx11::basic_string<char> >&, size_t&, size_t, size_t, size_t, size_t, size_t, size_t, const std::__debug::vector<std::__cxx11::basic_string<char> >&): Assertion `false' failed.
      |                                                                                                                                                                                                                                           ^~~~~~~~~
a.cc:1:1: error: 's' does not name a type
    1 | s[0]: LR[0, 23), TB[0, 4), base:1, prec:0
      | ^
In file included from /usr/include/c++/14/bits/stl_algobase.h:62,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:279:
/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'
  164 |   __is_null_pointer(std::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'
  666 |     struct is_null_pointer<std::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)>
      |                                     ^~~~~~
In file included from /usr/include/stdio.h:34,
                 from /usr/include/c++/14/cstdio:42,
                 from a.cc:275:
/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_algobase.h:65:
/usr/include/c++/14/bits/stl_iterator_base_types.h:125:67: error: 'ptrdiff_t' does not name a type
  125 |   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
      |                                                                   ^~~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_types.h:1:1: note: 'ptrdiff_t' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | // Types used in iterator implementation -*- C++ -*-
/usr/include/c++/14/bits/stl_iterator_base_types.h:214:15: error: 'ptrdiff_t' does not name a type
  2