답안 #1045132

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1045132 2024-08-05T17:17:26 Z karthi222528 공장들 (JOI14_factories) C++11
컴파일 오류
0 ms 0 KB
g++ -O2 -std=c++11 -o grader grader.cpp factories.cpp
#include <bits/stdc++.h>
#include <factories.h>
using namespace std;
#define int long long int
int bp(int a,int b,int p){
    int ret = 1;
    while(b>0){
        if(b&1){
            ret = (ret*a)%p;
        }
        a = (a*a)%p;
        b /= 2;
    }
    return ret;
}
int inv(int a,int p){
    return bp(a,p-2,p);
}
struct DSU{
    int n;
    vector<int> par,rank;
    DSU(int n){
        this->n = n;
        par.resize(n+1,-1);
        rank.resize(n+1,1);
    }
    int find_set(int i){
        if(par[i]==-1){
            return i;
        }
        par[i] = find_set(par[i]);
        return par[i];
    }
    void union_set(int a,int b){
        int p1 = find_set(a);
        int p2 = find_set(b);
        if(p1!=p2){
            if(rank[p1]>=rank[p2]){
                rank[p1] += rank[p2];
                par[p2] = p1;
            }else{
                rank[p2] += rank[p1];
                par[p1] = p2;
            }
        }
    }
};
struct FenwickTree{
    int n;
    vector<int> bit;
    FenwickTree(int n){
        this->n = n;
        bit.resize(n,0);
    }
    int sum(int r){
        int ret = 0;
        while(r>=0){
            ret += bit[r];
            r = (r&(r+1)) - 1;
        }
        return ret;
    }
    void add(int idx,int del){
        while(idx<n){
            bit[idx] += del;
            idx = (idx|(idx+1));
        }
    }
    void add(int l,int r,int del){
        if(l<=r){
            add(l,del);
            add(r+1,-del);
        }
    }
};
struct Trie{
    int cnt,n;
    vector<vector<int>> trie;
    vector<bool> end;
    Trie(int n){
        this->n = n;
        cnt = 0;
        trie.assign(n+1,vector<int> (26,-1));
        end.assign(n+1,false);
    }
    void insert(string &s){
        int it = 0;
        for(auto c: s){
            if(trie[it][c-'a']==-1){
                trie[it][c-'a'] = ++cnt;
            }
            it = trie[it][c-'a'];
        }
        end[it] = true;
        return;
    }
};
vector<int> sorted_cyclic_shifts(string &s){
    int n = s.size();
    int alpha = 128;
    int alp = max(n,alpha);
    vector<int> p(n),c(n),cnt(alp,0);
    for(int i = 0;i<n;i++){
        cnt[s[i]]++;
    }
    for(int i = 1;i<alpha;i++){
        cnt[i] += cnt[i-1];
    }
    for(int i = 0;i<n;i++){
        p[--cnt[s[i]]] = i;
    }
    c[p[0]] = 0;
    int classes = 1;
    for(int i = 1;i<n;i++){
        if(s[p[i]] != s[p[i-1]]){
            classes++;
        }
        c[p[i]] = classes - 1;
    }
    vector<int> pn(n),cn(n);
    int len = 1;
    for(int it = 0;len<n;it++){
        for(int i = 0;i<n;i++){
            pn[i] = (p[i] - len + n)%n;
        }
        fill(cnt.begin(),cnt.begin() + classes,0);
        for(int i = 0;i<n;i++){
            cnt[c[pn[i]]]++;
        }
        for(int i = 1;i<classes;i++){
            cnt[i] += cnt[i-1];
        }
        for(int i = n-1;i>=0;i--){
            p[--cnt[c[pn[i]]]] = pn[i];
        }
        cn[p[0]] = 0;
        classes = 1;
        for(int i = 1;i<n;i++){
            pair<int,int> cur = {c[p[i]],c[(p[i] + len)%n]};
            pair<int,int> prev = {c[p[i-1]],c[(p[i-1] + len)%n]};
            if(cur!=prev){
                classes++;
            }
            cn[p[i]] = classes - 1;
        }
        swap(c,cn);
        len *= 2;
    }
    return p;
}
vector<int> suffix_array(string s){
    vector<int> sorted_shifts = sorted_cyclic_shifts(s);
    return sorted_shifts;
}
int hash_val(string s){
    int n = s.length();
    int p = 31;
    int mod = 1500450271LL;
    int ret = 0;
    for(int i = 0;i<n;i++){
        ret +=((s[i] - 'a')*bp(p,i,mod))%mod;
        ret %= mod;
    }
    return ret;
}
struct segTree{
    int n;
    int inf = 1e18;
    vector<pair<int,int>> st;
    void init(int n){
        this->n = n;
        st.resize(4*n,{-1,inf});
    }
    pair<int,int> merge_pair(pair<int,int> &p1,pair<int,int> &p2){
        if(p1.second<p2.second){
            return p1;
        }else{
            if(p1.second>p2.second){
                return p2;
            }
            if(p1.first<p2.first){
                return p1;
            }
            return p2;
        }
    }
    void build(int node,int s,int e,vector<pair<int,int>> &v){
        if(s==e){
            st[node] = v[s];
            return;
        }
        int lc = 2*node + 1;
        int rc = lc + 1;
        int mid = s + (e-s)/2;
        build(lc,s,mid,v);
        build(rc,mid+1,e,v);
        st[node] = merge_pair(st[lc],st[rc]);
        return;
    }
    pair<int,int> query_min(int node,int s,int e,int l,int r){
        if(e<l||s>r){
            return {-1,inf};
        }
        if(s>=l&&e<=r){
            return st[node];
        }
        int lc = 2*node + 1;
        int rc = lc + 1;
        int mid = s + (e-s)/2;
        pair<int,int> le = query_min(lc,s,mid,l,r);
        pair<int,int> ri = query_min(rc,mid+1,e,l,r);
        return merge_pair(le,ri);
    }
};
struct lca_tree{
    int n;
    int id = 0;
    vector<vector<int>> adj;
    map<pair<int,int>,int> wei;
    vector<pair<int,int>> dfs_arr;
    vector<int> dep,pos,rdep;
    segTree seg;
    void init(int n,vector<vector<int>> &tree,map<pair<int,int>,int> &weight){
        this->n = n;
        this->adj = tree;
        this->wei = weight;
        dep.resize(n+1,0);
        rdep.resize(n+1,0);
        pos.resize(n+1,1e15);
        dfs(0,-1);
        seg.init(2*n - 1);
        seg.build(0,0,2*n - 2,dfs_arr);
        pos_assign();
    }
    void dfs(int u,int p){
        dfs_arr.push_back({u,dep[u]});
        for(auto c: adj[u]){
            if(c!=p){
                dep[c] = dep[u] + 1;
                rdep[c] = rdep[u] + wei[{u,c}];
                dfs(c,u);
                dfs_arr.push_back({u,dep[u]});
            }
        }
        return;
    }
    void pos_assign(){
        for(int i = 0;i<2*n - 1;i++){
            pos[dfs_arr[i].first] = min(pos[dfs_arr[i].first],i);
        }
    }
    int lca(int u,int v){
        int l = min(pos[u],pos[v]);
        int r = max(pos[u],pos[v]);
        pair<int,int> ret = seg.query_min(0,0,2*n - 2,l,r);
        return ret.first;
    }
    int dist(int u,int v){
        int lca_cur = lca(u,v);
        return dep[u] + dep[v] - 2*dep[lca_cur];
    }
    int len(int u,int v){
        int lca_cur = lca(u,v);
        return rdep[u] + rdep[v] - 2*rdep[lca_cur];
    }
};
struct centroid_decomposition{
    vector<vector<int>> adj;
    vector<bool> removed;
    vector<int> sub,par;
    int n;
    void init(int n,vector<vector<int>> &tree){
        this->n = n;
        this->adj = tree;
        removed.resize(n+1,false);
        sub.resize(n+1,1);
        par.resize(n+1,-1);
        build(0,-1);
    }
    void build(int u,int p){
        int sz = dfs(u,p);
        int cent = centroid(u,p,sz);
        removed[cent] = true;
        //cout<<cent<<" ";
        par[cent] = p;
        for(auto c: adj[cent]){
            if(!removed[c]){
                build(c,cent);
            }
        }
        return;
    }
    int dfs(int u,int p){
        for(auto c: adj[u]){
            if(c!=p&&!removed[c]){
                sub[u] += dfs(c,u);
            }
        }
        return sub[u];
    }
    int centroid(int u,int p,int sz){
        for(auto c: adj[u]){
            if(c!=p&&!removed[c]){
                if(sub[c]>sz/2){
                    return centroid(c,u,sz);
                }
            }
        }
        return u;
    }
};
lca_tree lct;
centroid_decomposition cd;
vector<int> ans;
void Init(int n,int u[],int v[],int l[]){
    vector<vector<int>> adj(n+1);
    map<pair<int,int>,int> wei;
    for(int i = 0;i<n-1;i++){
        wei[{u[i],v[i]}] = l[i];
        wei[{v[i],u[i]}] = l[i];
        adj[u[i]].push_back(v[i]);
        adj[v[i]].push_back(u[i]);
    }
    lct.init(n,adj,wei);
    cd.init(n,adj);
    ans.resize(n,1e15);
}
int Query(int s,int c1[],int t,int c2[]){
    for(int i = 0;i<s;i++){
        int node = c1[i];
        while(node!=-1){
            ans[node] = min(ans[node],lct.len(c1[i],node));
            node = cd.par[node];
        }
    }
    int fans = 1e15;
    for(int i = 0;i<t;i++){
        int node = c2[i];
        while(node!=-1){
            fans = min(fans,lct.len(c2[i],node) + ans[node]);
            node = cd.par[node];
        }
    }
    for(int i = 0;i<s;i++){
        int node = c1[i];
        while(node!=-1){
            ans[node] = 1e15;
            node = cd.par[node];
        }
    }
    return fans;
}

Compilation message

factories.cpp:1:1: error: 'g' does not name a type
    1 | g++ -O2 -std=c++11 -o grader grader.cpp factories.cpp
      | ^
In file included from /usr/include/c++/10/cmath:43,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/include/c++/10/ext/type_traits.h:162:35: error: 'bool __gnu_cxx::__is_null_pointer' redeclared as different kind of entity
  162 |   __is_null_pointer(std::nullptr_t)
      |                                   ^
/usr/include/c++/10/ext/type_traits.h:157:5: note: previous declaration 'template<class _Type> bool __gnu_cxx::__is_null_pointer(_Type)'
  157 |     __is_null_pointer(_Type)
      |     ^~~~~~~~~~~~~~~~~
/usr/include/c++/10/ext/type_traits.h:162:26: error: 'nullptr_t' is not a member of 'std'
  162 |   __is_null_pointer(std::nullptr_t)
      |                          ^~~~~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:126:26: error: declaration of 'operator new' as non-function
  126 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/10/new:126:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  126 | _GLIBCXX_NODISCARD void* operator new(std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                            ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:127:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  127 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/10/new:128:26: error: declaration of 'operator new []' as non-function
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                          ^~~~~~~~
/usr/include/c++/10/new:128:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  128 | _GLIBCXX_NODISCARD void* operator new[](std::size_t) _GLIBCXX_THROW (std::bad_alloc)
      |                                              ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:129:41: error: attributes after parenthesized initializer ignored [-fpermissive]
  129 |   __attribute__((__externally_visible__));
      |                                         ^
/usr/include/c++/10/new:140:26: error: declaration of 'operator new' as non-function
  140 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/10/new:140:44: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  140 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                            ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:140:52: error: expected primary-expression before 'const'
  140 | _GLIBCXX_NODISCARD void* operator new(std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                                    ^~~~~
/usr/include/c++/10/new:142:26: error: declaration of 'operator new []' as non-function
  142 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                          ^~~~~~~~
/usr/include/c++/10/new:142:46: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  142 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                              ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:142:54: error: expected primary-expression before 'const'
  142 | _GLIBCXX_NODISCARD void* operator new[](std::size_t, const std::nothrow_t&) _GLIBCXX_USE_NOEXCEPT
      |                                                      ^~~~~
/usr/include/c++/10/new:174:33: error: declaration of 'operator new' as non-function
  174 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                 ^~~~~~~~
/usr/include/c++/10/new:174:51: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  174 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                                   ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:174:59: error: expected primary-expression before 'void'
  174 | _GLIBCXX_NODISCARD inline void* operator new(std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                                           ^~~~
/usr/include/c++/10/new:176:33: error: declaration of 'operator new []' as non-function
  176 | _GLIBCXX_NODISCARD inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                 ^~~~~~~~
/usr/include/c++/10/new:176:53: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
  176 | _GLIBCXX_NODISCARD inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/exception_ptr.h:40,
                 from /usr/include/c++/10/exception:147,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/new:176:61: error: expected primary-expression before 'void'
  176 | _GLIBCXX_NODISCARD inline void* operator new[](std::size_t, void* __p) _GLIBCXX_USE_NOEXCEPT
      |                                                             ^~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/type_traits:402:31: error: 'std::size_t' has not been declared
  402 |   template<typename _Tp, std::size_t _Size>
      |                               ^~~~~~
/usr/include/c++/10/type_traits:403:25: error: '_Size' was not declared in this scope
  403 |     struct is_array<_Tp[_Size]>
      |                         ^~~~~
/usr/include/c++/10/type_traits:403:31: error: template argument 1 is invalid
  403 |     struct is_array<_Tp[_Size]>
      |                               ^
/usr/include/c++/10/type_traits:508:42: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
  508 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                          ^~~~~~~~~
In file included from /usr/include/c++/10/cstddef:50,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:45,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:433:29: note: 'nullptr_t' declared here
  433 |   typedef decltype(nullptr) nullptr_t;
      |                             ^~~~~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/type_traits:508:42: error: 'nullptr_t' is not a member of 'std'; did you mean 'nullptr_t'?
  508 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                          ^~~~~~~~~
In file included from /usr/include/c++/10/cstddef:50,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:45,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:433:29: note: 'nullptr_t' declared here
  433 |   typedef decltype(nullptr) nullptr_t;
      |                             ^~~~~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/type_traits:508:51: error: template argument 1 is invalid
  508 |     struct __is_null_pointer_helper<std::nullptr_t>
      |                                                   ^
/usr/include/c++/10/type_traits:1351:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1351 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/type_traits:1351:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1351 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/type_traits:1351:57: error: template argument 1 is invalid
 1351 |     : public integral_constant<std::size_t, alignof(_Tp)>
      |                                                         ^
/usr/include/c++/10/type_traits:1351:57: note: invalid template non-type parameter
/usr/include/c++/10/type_traits:1360:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1360 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,
                 from /usr/include/c++/10/cmath:47,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:41,
                 from factories.cpp:2:
/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h:209:23: note: 'size_t' declared here
  209 | typedef __SIZE_TYPE__ size_t;
      |                       ^~~~~~
In file included from /usr/include/c++/10/bits/move.h:57,
                 from /usr/include/c++/10/bits/nested_exception.h:40,
                 from /usr/include/c++/10/exception:148,
                 from /usr/include/c++/10/ios:39,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:2:
/usr/include/c++/10/type_traits:1360:37: error: 'size_t' is not a member of 'std'; did you mean 'size_t'?
 1360 |     : public integral_constant<std::size_t, 0> { };
      |                                     ^~~~~~
In file included from /usr/include/stdlib.h:31,
                 from /usr/include/c++/10/bits/std_abs.h:38,