Submission #1259192

#TimeUsernameProblemLanguageResultExecution timeMemory
1259192SortingTriple Peaks (IOI25_triples)C++20
Compilation error
0 ms0 KiB
a#include <iostream> #include <algorithm> #include <vector> #include <map> #include <set> #include <array> #include <iomanip> #include <queue> #include <stack> #include <numeric> #include <cassert> #include <cmath> #include <random> #include <ctime> #include <chrono> #include <x86intrin.h> #pragma GCC optimize("O3") #pragma GCC target("avx2") using namespace std; typedef long long ll; typedef vector<int> vi; typedef vector<ll> vll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; #define all(x) (x).begin(), (x).end() #define sz(x) ((int)x.size()) #define rep(i, a, b) for(int i = a; i < b; ++i) template<typename C> struct rge{C l, r;}; template<typename C> rge<C> range(C i, C j) { return rge<C>{i, j}; } template<typename C> ostream& operator<<(ostream &os, rge<C> r) { os << '{'; for(auto it = r.l; it != r.r; it++) os << "," + (it == r.l) << *it; os << '}'; return os; } template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '{' << p.first << "," << p.second << '}'; } template<typename T_container, typename T = typename enable_if<!is_same<T_container, string>::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { os << '{'; string sep; for (const T &x : v) os << sep << x, sep = ","; return os << '}'; } void dbg_out() { cerr << ']' << endl; } template<typename A> void dbg_out(A H) { cerr << H; dbg_out(); } template<typename A, typename B, typename... C> void dbg_out(A H, B G, C... T) { cerr << H << ","; dbg_out(G, T...); } #ifdef DEBUG #define debug(...) cerr << "[" << #__VA_ARGS__ << "] = [", dbg_out(__VA_ARGS__) #else #define debug(...) #endif template <typename T> void remove_duplicates(vector<T> &v){ sort(all(v)); v.resize(unique(all(v)) - v.begin()); } template <typename T> void chmin(T &a, T b){ a = (b < a) ? b : a; } template <typename T> void chmax(T &a, T b){ a = (b > a) ? b : a; } const int N = 2e5 + 3; ll n; alignas(64) int h[N]; ll count_easy() { set<array<int, 3>> triples; auto test3 = [&](int a, int b, int c) { if (c < 0 || c >= n) { return; } int arr[3]{a, b, c}; sort(arr, arr + 3); a = arr[0]; b = arr[1]; c = arr[2]; int diffs[3]{b - a, c - b, c - a}; int vals[3]{h[a], h[b], h[c]}; sort(diffs, diffs + 3); sort(vals, vals + 3); for (int i = 0; i < 3; ++i) { if (diffs[i] != vals[i]) { return; } } triples.insert({a, b, c}); }; auto test2 = [&](int a, int b) { if (b < 0 || b >= n) { return; } test3(a, b, a + h[b]); test3(a, b, a - h[b]); test3(a, b, b + h[b]); test3(a, b, b - h[b]); }; for (int i = 0; i < n; ++i) { test2(i, i - h[i]); test2(i, i + h[i]); } return triples.size(); } static inline __m256i seq8_from(int i) { const __m256i base = _mm256_set1_epi32(i); // [i,i,i,i,i,i,i,i] const __m256i inc = _mm256_setr_epi32(0,1,2,3,4,5,6,7); // [0..7] in ascending lane order return _mm256_add_epi32(base, inc); // [i..i+7] } int hsum(__m256i x) { __m128i l = _mm256_extracti128_si256(x, 0); __m128i h = _mm256_extracti128_si256(x, 1); l = _mm_add_epi32(l, h); l = _mm_hadd_epi32(l, l); return _mm_extract_epi32(l, 0) + _mm_extract_epi32(l, 1); } ll count_triples(vector<int> H) { n = H.size(); for (int i = 0; i < n; ++i) { h[i] = H[i]; } ll ans = count_easy(); for (int i = 0; i < n; ++i) { int j = i + h[i]; int k = j + h[i]; if (k >= n) { continue; } ans -= h[k] == h[i] && h[j] == 2 * h[i]; } for (int i = 0; i < n; ++i) { int j = i + 1; int k = j + h[i]; __m256i kdiff = seq8_from(k - i); __m256i jdiff = seq8_from(j - i); __m256i vans = _mm256_set1_epi32(0); const __m256i ones = _mm256_set1_epi32(1); const __m256i eights = _mm256_set1_epi32(8); const __m256i idx = seq8_from(0); for (; k + 8 < n; k += 8, j += 8) { __m256i hj = _mm256_loadu_si256((const __m256i*)&h[j]); __m256i hk = _mm256_loadu_si256((const __m256i*)&h[k]); const int baseK = k - i; const int baseJ = j - i; const __m256i kdiff = _mm256_add_epi32(_mm256_set1_epi32(baseK), idx); const __m256i jdiff = _mm256_add_epi32(_mm256_set1_epi32(baseJ), idx); // vector compares -> 0xFFFFFFFF per lane on match, else 0x0 __m256i mj = _mm256_cmpeq_epi32(hj, kdiff); __m256i mk = _mm256_cmpeq_epi32(hk, jdiff); // lanes where both match __m256i m = _mm256_and_si256(mj, mk); vans = _mm256_add_epi32(vans, m); } ans -= hsum(vans); for (; k < n; ++j, ++k) { ans += (h[j] == (k - i)) && (h[k] == (j - i)); } } return ans; } std::vector<int> construct_range(int M, int K) { return {};} #ifdef LOCAL_TEST int main() { vector<int> H = {4,1,4,3,2,6,1}; cout << count_triples(H) << "\n"; // 3 } #endif

Compilation message (stderr)

triples.cpp:1:2: error: stray '#' in program
    1 | a#include <iostream>
      |  ^
triples.cpp:1:1: error: 'a' does not name a type
    1 | a#include <iostream>
      | ^
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/type_traits:227:27: error: 'size_t' has not been declared
  227 |   template <typename _Tp, size_t = sizeof(_Tp)>
      |                           ^~~~~~
/usr/include/c++/11/type_traits:431:26: error: 'std::size_t' has not been declared
  431 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/11/type_traits:432:25: error: '_Size' was not declared in this scope
  432 |     struct is_array<_Tp[_Size]>
      |                         ^~~~~
/usr/include/c++/11/type_traits:432:31: error: template argument 1 is invalid
  432 |     struct is_array<_Tp[_Size]>
      |                               ^
/usr/include/c++/11/type_traits:537:42: error: 'nullptr_t' is not a member of 'std'
  537 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                          ^~~~~~~~~
/usr/include/c++/11/type_traits:537:51: error: template argument 1 is invalid
  537 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                                   ^
/usr/include/c++/11/type_traits:1361:37: error: 'size_t' is not a member of 'std'
 1361 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1361:57: error: template argument 1 is invalid
 1361 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                                         ^
/usr/include/c++/11/type_traits:1370:37: error: 'size_t' is not a member of 'std'
 1370 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1370:46: error: template argument 1 is invalid
 1370 |     : public integral_constant<std::size_t, 0> { };
      |                                              ^
/usr/include/c++/11/type_traits:1372:26: error: 'std::size_t' has not been declared
 1372 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/11/type_traits:1373:21: error: '_Size' was not declared in this scope
 1373 |     struct rank<_Tp[_Size]>
      |                     ^~~~~
/usr/include/c++/11/type_traits:1373:27: error: template argument 1 is invalid
 1373 |     struct rank<_Tp[_Size]>
      |                           ^
/usr/include/c++/11/type_traits:1374:37: error: 'size_t' is not a member of 'std'
 1374 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1374:65: error: template argument 1 is invalid
 1374 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/11/type_traits:1378:37: error: 'size_t' is not a member of 'std'
 1378 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1378:65: error: template argument 1 is invalid
 1378 |     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
      |                                                                 ^
/usr/include/c++/11/type_traits:1383:37: error: 'size_t' is not a member of 'std'
 1383 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1383:46: error: template argument 1 is invalid
 1383 |     : public integral_constant<std::size_t, 0> { };
      |                                              ^
/usr/include/c++/11/type_traits:1385:42: error: 'std::size_t' has not been declared
 1385 |   template<typename _Tp, unsigned _Uint, std::size_t _Size>
      |                                          ^~~
/usr/include/c++/11/type_traits:1386:23: error: '_Size' was not declared in this scope
 1386 |     struct extent<_Tp[_Size], _Uint>
      |                       ^~~~~
/usr/include/c++/11/type_traits:1386:36: error: template argument 1 is invalid
 1386 |     struct extent<_Tp[_Size], _Uint>
      |                                    ^
/usr/include/c++/11/type_traits:1387:37: error: 'size_t' is not a member of 'std'
 1387 |     : public integral_constant<std::size_t,
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1388:45: error: '_Size' was not declared in this scope
 1388 |                                _Uint == 0 ? _Size : extent<_Tp,
      |                                             ^~~~~
/usr/include/c++/11/type_traits:1389:77: error: template argument 1 is invalid
 1389 |                                                            _Uint - 1>::value>
      |                                                                             ^
/usr/include/c++/11/type_traits:1394:37: error: 'size_t' is not a member of 'std'
 1394 |     : public integral_constant<std::size_t,
      |                                     ^~~~~~
/usr/include/c++/11/type_traits:1396:73: error: template argument 1 is invalid
 1396 |                                                        _Uint - 1>::value>
      |                                                                         ^
/usr/include/c++/11/type_traits:1759:26: error: 'size_t' does not name a type
 1759 |       { static constexpr size_t __size = sizeof(_Tp); };
      |                          ^~~~~~
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/type_traits:1:1: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
  +++ |+#include <cstddef>
    1 | // C++11 <type_traits> -*- C++ -*-
In file included from /usr/include/c++/11/bits/move.h:57,
                 from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/type_traits:1761:14: error: 'size_t' has not been declared
 1761 |     template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
      |              ^~~~~~
/usr/include/c++/11/type_traits:1761:48: error: '_Sz' was not declared in this scope
 1761 |     template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
      |                                                ^~~
/usr/include/c++/11/type_traits:1762:14: error: no default argument for '_Tp'
 1762 |       struct __select;
      |              ^~~~~~~~
/usr/include/c++/11/type_traits:1764:14: error: 'size_t' has not been declared
 1764 |     template<size_t _Sz, typename _Uint, typename... _UInts>
      |              ^~~~~~
/usr/include/c++/11/type_traits:1765:23: error: '_Sz' was not declared in this scope
 1765 |       struct __select<_Sz, _List<_Uint, _UInts...>, true>
      |                       ^~~
/usr/include/c++/11/type_traits:1765:57: error: template argument 1 is invalid
 1765 |       struct __select<_Sz, _List<_Uint, _UInts...>, true>
      |                                                         ^
/usr/include/c++/11/type_traits:1768:14: error: 'size_t' has not been declared
 1768 |     template<size_t _Sz, typename _Uint, typename... _UInts>
      |              ^~~~~~
/usr/include/c++/11/type_traits:1769:23: error: '_Sz' was not declared in this scope
 1769 |       struct __select<_Sz, _List<_Uint, _UInts...>, false>
      |                       ^~~
/usr/include/c++/11/type_traits:1769:58: error: template argument 1 is invalid
 1769 |       struct __select<_Sz, _List<_Uint, _UInts...>, false>
      |                                                          ^
/usr/include/c++/11/type_traits:1770:18: error: '_Sz' was not declared in this scope
 1770 |       : __select<_Sz, _List<_UInts...>>
      |                  ^~~
/usr/include/c++/11/type_traits:1770:38: error: template argument 1 is invalid
 1770 |       : __select<_Sz, _List<_UInts...>>
      |                                      ^~
/usr/include/c++/11/type_traits:1761:60: error: '__size' is not a member of 'std::__make_unsigned_selector_base::_List<unsigned char, short unsigned int, unsigned int, long unsigned int, long long unsigned int>'
 1761 |     template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)>
      |                                                            ^~~~~~
/usr/include/c++/11/type_traits:1783:68: error: template argument 3 is invalid
 1783 |       using __unsigned_type = typename __select<sizeof(_Tp), _UInts>::__type;
      |                                                                    ^
/usr/include/c++/11/type_traits:1787:47: error: '__unsigned_type' was not declared in this scope
 1787 |         = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
      |                                               ^~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1787:62: error: template argument 2 is invalid
 1787 |         = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
      |                                                              ^
/usr/include/c++/11/type_traits:1799:68: error: '__type' in 'class std::__make_unsigned_selector<wchar_t, false, true>' does not name a type
 1799 |         = typename __make_unsigned_selector<wchar_t, false, true>::__type;
      |                                                                    ^~~~~~
/usr/include/c++/11/type_traits:1808:68: error: '__type' in 'class std::__make_unsigned_selector<char8_t, false, true>' does not name a type
 1808 |         = typename __make_unsigned_selector<char8_t, false, true>::__type;
      |                                                                    ^~~~~~
/usr/include/c++/11/type_traits:1816:69: error: '__type' in 'class std::__make_unsigned_selector<char16_t, false, true>' does not name a type
 1816 |         = typename __make_unsigned_selector<char16_t, false, true>::__type;
      |                                                                     ^~~~~~
/usr/include/c++/11/type_traits:1823:69: error: '__type' in 'class std::__make_unsigned_selector<char32_t, false, true>' does not name a type
 1823 |         = typename __make_unsigned_selector<char32_t, false, true>::__type;
      |                                                                     ^~~~~~
/usr/include/c++/11/type_traits: In instantiation of 'class std::__make_unsigned_selector<wchar_t, true, false>':
/usr/include/c++/11/type_traits:1912:62:   required from 'class std::__make_signed_selector<wchar_t, false, true>'
/usr/include/c++/11/type_traits:1927:57:   required from here
/usr/include/c++/11/type_traits:1744:13: error: no type named '__type' in 'struct std::__make_unsigned<wchar_t>'
 1744 |       using __unsigned_type
      |             ^~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1748:13: error: no type named '__type' in 'struct std::__make_unsigned<wchar_t>'
 1748 |       using __type
      |             ^~~~~~
/usr/include/c++/11/type_traits:1927:66: error: invalid combination of multiple type-specifiers
 1927 |         = typename __make_signed_selector<wchar_t, false, true>::__type;
      |                                                                  ^~~~~~
/usr/include/c++/11/type_traits: In instantiation of 'class std::__make_unsigned_selector<char8_t, true, false>':
/usr/include/c++/11/type_traits:1912:62:   required from 'class std::__make_signed_selector<char8_t, false, true>'
/usr/include/c++/11/type_traits:1936:57:   required from here
/usr/include/c++/11/type_traits:1744:13: error: no type named '__type' in 'struct std::__make_unsigned<char8_t>'
 1744 |       using __unsigned_type
      |             ^~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1748:13: error: no type named '__type' in 'struct std::__make_unsigned<char8_t>'
 1748 |       using __type
      |             ^~~~~~
/usr/include/c++/11/type_traits:1936:66: error: invalid combination of multiple type-specifiers
 1936 |         = typename __make_signed_selector<char8_t, false, true>::__type;
      |                                                                  ^~~~~~
/usr/include/c++/11/type_traits: In instantiation of 'class std::__make_unsigned_selector<char16_t, true, false>':
/usr/include/c++/11/type_traits:1912:62:   required from 'class std::__make_signed_selector<char16_t, false, true>'
/usr/include/c++/11/type_traits:1944:58:   required from here
/usr/include/c++/11/type_traits:1744:13: error: no type named '__type' in 'struct std::__make_unsigned<char16_t>'
 1744 |       using __unsigned_type
      |             ^~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1748:13: error: no type named '__type' in 'struct std::__make_unsigned<char16_t>'
 1748 |       using __type
      |             ^~~~~~
/usr/include/c++/11/type_traits:1944:67: error: invalid combination of multiple type-specifiers
 1944 |         = typename __make_signed_selector<char16_t, false, true>::__type;
      |                                                                   ^~~~~~
/usr/include/c++/11/type_traits: In instantiation of 'class std::__make_unsigned_selector<char32_t, true, false>':
/usr/include/c++/11/type_traits:1912:62:   required from 'class std::__make_signed_selector<char32_t, false, true>'
/usr/include/c++/11/type_traits:1951:58:   required from here
/usr/include/c++/11/type_traits:1744:13: error: no type named '__type' in 'struct std::__make_unsigned<char32_t>'
 1744 |       using __unsigned_type
      |             ^~~~~~~~~~~~~~~
/usr/include/c++/11/type_traits:1748:13: error: no type named '__type' in 'struct std::__make_unsigned<char32_t>'
 1748 |       using __type
      |             ^~~~~~
/usr/include/c++/11/type_traits:1951:67: error: invalid combination of multiple type-specifiers
 1951 |         = typename __make_signed_selector<char32_t, false, true>::__type;
      |                                                                   ^~~~~~
/usr/include/c++/11/type_traits:1984:26: error: 'std::size_t' has not been declared
 1984 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/11/type_traits:1985:30: error: '_Size' was not declared in this scope
 1985 |     struct remove_extent<_Tp[_Size]>
      |                              ^~~~~
/usr/include/c++/11/type_traits:1985:36: error: template argument 1 is invalid
 1985 |     struct remove_extent<_Tp[_Size]>
      |                                    ^
/usr/include/c++/11/type_traits:1997:26: error: 'std::size_t' has not been declared
 1997 |   template<typename _Tp, std::size_t _Size>
      |                          ^~~
/usr/include/c++/11/type_traits:1998:35: error: '_Size' was not declared in this scope
 1998 |     struct remove_all_extents<_Tp[_Size]>
      |                                   ^~~~~
/usr/include/c++/11/type_traits:1998:41: error: template argument 1 is invalid
 1998 |     struct remove_all_extents<_Tp[_Size]>
      |                                         ^
/usr/include/c++/11/type_traits:2056:12: error: 'std::size_t' has not been declared
 2056 |   template<std::size_t _Len>
      |            ^~~
/usr/include/c++/11/type_traits:2061:30: error: '_Len' was not declared in this scope
 2061 |         unsigned char __data[_Len];
      |                              ^~~~
/usr/include/c++/11/type_traits:2076:12: error: 'std::size_t' has not been declared
 2076 |   template<std::size_t _Len, std::size_t _Align =
      |            ^~~
/usr/include/c++/11/type_traits:2076:30: error: 'std::size_t' has not been declared
 2076 |   template<std::size_t _Len, std::size_t _Align =
      |                              ^~~
/usr/include/c++/11/type_traits:2077:55: error: '_Len' was not declared in this scope
 2077 |            __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                       ^~~~
/usr/include/c++/11/type_traits:2077:59: error: template argument 1 is invalid
 2077 |            __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                           ^
/usr/include/c++/11/type_traits:2082:30: error: '_Len' was not declared in this scope
 2082 |         unsigned char __data[_Len];
      |                              ^~~~
/usr/include/c++/11/type_traits:2083:44: error: '_Align' was not declared in this scope
 2083 |         struct __attribute__((__aligned__((_Align)))) { } __align;
      |                                            ^~~~~~
/usr/include/c++/11/type_traits:2090:20: error: 'size_t' does not name a type
 2090 |       static const size_t _S_alignment = 0;
      |                    ^~~~~~
/usr/include/c++/11/type_traits:2090:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2091:20: error: 'size_t' does not name a type
 2091 |       static const size_t _S_size = 0;
      |                    ^~~~~~
/usr/include/c++/11/type_traits:2091:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2097:20: error: 'size_t' does not name a type
 2097 |       static const size_t _S_alignment =
      |                    ^~~~~~
/usr/include/c++/11/type_traits:2097:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2100:20: error: 'size_t' does not name a type
 2100 |       static const size_t _S_size =
      |                    ^~~~~~
/usr/include/c++/11/type_traits:2100:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2115:13: error: 'size_t' has not been declared
 2115 |   template <size_t _Len, typename... _Types>
      |             ^~~~~~
/usr/include/c++/11/type_traits:2122:20: error: 'size_t' does not name a type
 2122 |       static const size_t _S_len = _Len > __strictest::_S_size
      |                    ^~~~~~
/usr/include/c++/11/type_traits:2122:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2126:20: error: 'size_t' does not name a type
 2126 |       static const size_t alignment_value = __strictest::_S_alignment;
      |                    ^~~~~~
/usr/include/c++/11/type_traits:2126:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2128:40: error: '_S_len' was not declared in this scope
 2128 |       typedef typename aligned_storage<_S_len, alignment_value>::type type;
      |                                        ^~~~~~
/usr/include/c++/11/type_traits:2128:48: error: 'alignment_value' was not declared in this scope; did you mean 'alignment_of'?
 2128 |       typedef typename aligned_storage<_S_len, alignment_value>::type type;
      |                                                ^~~~~~~~~~~~~~~
      |                                                alignment_of
/usr/include/c++/11/type_traits:2128:63: error: template argument 1 is invalid
 2128 |       typedef typename aligned_storage<_S_len, alignment_value>::type type;
      |                                                               ^
/usr/include/c++/11/type_traits:2128:63: error: template argument 2 is invalid
/usr/include/c++/11/type_traits:2131:13: error: 'size_t' has not been declared
 2131 |   template <size_t _Len, typename... _Types>
      |             ^~~~~~
/usr/include/c++/11/type_traits:2132:11: error: 'size_t' does not name a type
 2132 |     const size_t aligned_union<_Len, _Types...>::alignment_value;
      |           ^~~~~~
/usr/include/c++/11/type_traits:2132:11: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:2566:12: error: 'size_t' has not been declared
 2566 |   template<size_t _Len, size_t _Align =
      |            ^~~~~~
/usr/include/c++/11/type_traits:2566:25: error: 'size_t' has not been declared
 2566 |   template<size_t _Len, size_t _Align =
      |                         ^~~~~~
/usr/include/c++/11/type_traits:2567:56: error: '_Len' was not declared in this scope
 2567 |             __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                        ^~~~
/usr/include/c++/11/type_traits:2567:60: error: template argument 1 is invalid
 2567 |             __alignof__(typename __aligned_storage_msa<_Len>::__type)>
      |                                                            ^
/usr/include/c++/11/type_traits:2568:56: error: '_Len' was not declared in this scope
 2568 |     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
      |                                                        ^~~~
/usr/include/c++/11/type_traits:2568:62: error: '_Align' was not declared in this scope
 2568 |     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
      |                                                              ^~~~~~
/usr/include/c++/11/type_traits:2568:68: error: template argument 1 is invalid
 2568 |     using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
      |                                                                    ^
/usr/include/c++/11/type_traits:2568:68: error: template argument 2 is invalid
/usr/include/c++/11/type_traits:2570:13: error: 'size_t' has not been declared
 2570 |   template <size_t _Len, typename... _Types>
      |             ^~~~~~
/usr/include/c++/11/type_traits:2571:52: error: '_Len' was not declared in this scope
 2571 |     using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
      |                                                    ^~~~
/usr/include/c++/11/type_traits:2571:67: error: template argument 1 is invalid
 2571 |     using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
      |                                                                   ^
/usr/include/c++/11/type_traits:2680:26: error: 'size_t' has not been declared
 2680 |   template<typename _Tp, size_t _Nm>
      |                          ^~~~~~
/usr/include/c++/11/type_traits:2684:21: error: '_Nm' was not declared in this scope
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                     ^~~
/usr/include/c++/11/type_traits:2684:24: error: 'template<class _Tp, <declaration error> > constexpr std::__enable_if_t<std::__is_swappable<_Tp>::value> std::swap' conflicts with a previous declaration
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                        ^
/usr/include/c++/11/type_traits:2676:5: note: previous declaration 'constexpr std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)'
 2676 |     swap(_Tp&, _Tp&)
      |     ^~~~
/usr/include/c++/11/type_traits:2684:16: error: '__a' was not declared in this scope
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                ^~~
/usr/include/c++/11/type_traits:2684:21: error: '_Nm' was not declared in this scope
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                     ^~~
/usr/include/c++/11/type_traits:2684:33: error: '__b' was not declared in this scope
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                                 ^~~
/usr/include/c++/11/type_traits:2684:38: error: '_Nm' was not declared in this scope
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                                      ^~~
/usr/include/c++/11/type_traits:2684:43: error: expected ';' before 'noexcept'
 2684 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                                           ^
      |                                           ;
 2685 |     noexcept(__is_nothrow_swappable<_Tp>::value);
      |     ~~~~~~~~                               
/usr/include/c++/11/type_traits:3244:20: error: 'size_t' does not name a type
 3244 |   inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
      |                    ^~~~~~
/usr/include/c++/11/type_traits:3244:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:3246:20: error: 'size_t' does not name a type
 3246 |   inline constexpr size_t rank_v = rank<_Tp>::value;
      |                    ^~~~~~
/usr/include/c++/11/type_traits:3246:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
/usr/include/c++/11/type_traits:3248:20: error: 'size_t' does not name a type
 3248 |   inline constexpr size_t extent_v = extent<_Tp, _Idx>::value;
      |                    ^~~~~~
/usr/include/c++/11/type_traits:3248:20: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
In file included from /usr/include/c++/11/bits/stl_pair.h:59,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/bits/move.h:212:26: error: 'size_t' has not been declared
  212 |   template<typename _Tp, size_t _Nm>
      |                          ^~~~~~
/usr/include/c++/11/bits/move.h:220:21: error: '_Nm' was not declared in this scope
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                     ^~~
/usr/include/c++/11/bits/move.h:220:24: error: 'template<class _Tp, <declaration error> > constexpr const typename std::enable_if<std::__is_swappable<_Tp>::value, void>::type std::swap' conflicts with a previous declaration
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                        ^
/usr/include/c++/11/bits/move.h:196:5: note: previous declaration 'constexpr std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&)'
  196 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/11/bits/move.h:220:16: error: '__a' was not declared in this scope
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                ^~~
/usr/include/c++/11/bits/move.h:220:21: error: '_Nm' was not declared in this scope
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                     ^~~
/usr/include/c++/11/bits/move.h:220:33: error: '__b' was not declared in this scope
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                                 ^~~
/usr/include/c++/11/bits/move.h:220:38: error: '_Nm' was not declared in this scope
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                                      ^~~
/usr/include/c++/11/bits/move.h:220:43: error: expected ';' before 'noexcept'
  220 |     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
      |                                           ^
      |                                           ;
In file included from /usr/include/c++/11/compare:39,
                 from /usr/include/c++/11/bits/stl_pair.h:65,
                 from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/concepts:211:46: error: 'size_t' has not been declared
  211 |         template<typename _Tp, typename _Up, size_t _Num>
      |                                              ^~~~~~
/usr/include/c++/11/concepts:216:34: error: '_Num' was not declared in this scope
  216 |           operator()(_Tp (&__e1)[_Num], _Up (&__e2)[_Num]) const
      |                                  ^~~~
/usr/include/c++/11/concepts:216:39: error: expected ')' before ',' token
  216 |           operator()(_Tp (&__e1)[_Num], _Up (&__e2)[_Num]) const
      |                     ~                 ^
      |                                       )
/usr/include/c++/11/concepts:216:39: error: expected ';' before ',' token
  216 |           operator()(_Tp (&__e1)[_Num], _Up (&__e2)[_Num]) const
      |                                       ^
      |                                       ;
In file included from /usr/include/c++/11/utility:70,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/bits/stl_pair.h:92:12: error: 'size_t' has not been declared
   92 |   template<size_t...>
      |            ^~~~~~
/usr/include/c++/11/bits/stl_pair.h:449:36: error: 'size_t' has not been declared
  449 |       template<typename... _Args1, size_t... _Indexes1,
      |                                    ^~~~~~
/usr/include/c++/11/bits/stl_pair.h:450:36: error: 'size_t' has not been declared
  450 |                typename... _Args2, size_t... _Indexes2>
      |                                    ^~~~~~
/usr/include/c++/11/bits/stl_pair.h:453:27: error: '_Indexes1' was not declared in this scope
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                           ^~~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:453:36: error: expected parameter pack before '...'
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                    ^~~
/usr/include/c++/11/bits/stl_pair.h:453:39: error: template argument 1 is invalid
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                       ^
/usr/include/c++/11/bits/stl_pair.h:453:55: error: '_Indexes2' was not declared in this scope
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                                       ^~~~~~~~~
/usr/include/c++/11/bits/stl_pair.h:453:64: error: expected parameter pack before '...'
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                                                ^~~
/usr/include/c++/11/bits/stl_pair.h:453:67: error: template argument 1 is invalid
  453 |              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
      |                                                                   ^
In file included from /usr/include/c++/11/utility:76,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/initializer_list:53:15: error: 'size_t' does not name a type
   53 |       typedef size_t            size_type;
      |               ^~~~~~
In file included from /usr/include/c++/11/utility:76,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/initializer_list:1:1: note: 'size_t' is defined in header '<cstddef>'; did you forget to '#include <cstddef>'?
  +++ |+#include <cstddef>
    1 | // std::initializer_list support -*- C++ -*-
In file included from /usr/include/c++/11/utility:76,
                 from /usr/include/c++/11/algorithm:60,
                 from triples.cpp:2:
/usr/include/c++/11/initializer_list:59:7: error: 'size_type' does not name a type; did you mean 'true_type'?
   59 |       size_type                 _M_len;
      |       ^~~~~~~~~
      |       true_type
/usr/include/c++/11/initializer_list:62:54: error: 'size_type' has not been declared
   62 |       constexpr initializer_list(const_iterator __a, size_type __l)
      |                                                      ^~~~~~~~~
/usr/include/c++/11/initializer_list:70:17: error: 'size_type' does not name a type; did you mean 'true_type'?
   70 |       constexpr size_type
      |                 ^~~~~~~~~
      |                 true_type
/usr/include/c++/11/initializer_list:47:11: fatal error: definition of 'class std::initializer_list<_E>' does not match '#include <initializer_list>'
   47 |     class initializer_list
      |           ^~~~~~~~~~~~~~~~
compilation terminated.