Language: C++

#include <bits/stdc++.h>

using namespace std;

const int maxn = 1e5 + 3;
const int mod = 998244353;

int n, m[4];
vector <int> adj[4][maxn];
void read()
{
    cin >> n;
    for (int i = 1; i <= 3; i++)
    {
        cin >> m[i];
        for (int j = 1; j <= m[i]; j++)
        {
            int a, b;
            cin >> a >> b;

            adj[i][a].push_back(b);
            adj[i][b].push_back(a);
        }
    }
}

long long add(long long a, long long b)
{
    a += b;
    if (a >= mod)
        a -= mod;

    return a;
}

long long pow[maxn*2];
int gr[4][maxn];
map <int, long long> mp[4];
void solve()
{
    pow[0] = 1;
    for (int i = 1; i <= 2 * n; i++)
        pow[i] = pow[i-1] * 1000000000 % mod;

    for (int i = 1; i <= 3; i++)
    {
        mp[i][0] = add(mp[i][0], pow[n*2]);
        for (int j = n-1; j >= 1; j--)
        {
            set <int> s;
            for (auto k: adj[i][j])
                if (k > j)
                s.insert(gr[i][k]);

            while (s.find(gr[i][j]) != s.end())
                gr[i][j]++;

            mp[i][gr[i][j]] = add(mp[i][gr[i][j]], pow[j*2]);
        }
    }

    int p = sqrt(max({m[1], m[2], m[3]})) + 10;
    long long ans = 0;
    for (int i = 0; i <= p; i++)
        if (mp[1].count(i))
        for (int j = 0; j <= p; j++)
        if (mp[2].count(j))
            ans = add(ans, mp[1][i] * mp[2][j] % mod * mp[3][i^j] % mod);

    cout << ans << endl;
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    read();
    solve();
}


Compiler output:
a.cc:36:21: error: 'long long int pow [200006]' redeclared as different kind of entity
   36 | long long pow[maxn*2];
      |                     ^
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33,
                 from a.cc:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:173:1: note: previous declaration 'double pow(double, double)'
  173 | __MATHCALL_VEC (pow,, (_Mdouble_ __x, _Mdouble_ __y));
      | ^~~~~~~~~~~~~~
a.cc: In function 'void solve()':
a.cc:41:8: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   41 |     pow[0] = 1;
      |        ^
a.cc:43:12: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   43 |         pow[i] = pow[i-1] * 1000000000 % mod;
      |            ^
a.cc:43:21: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   43 |         pow[i] = pow[i-1] * 1000000000 % mod;
      |                     ^
a.cc:47:37: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   47 |         mp[i][0] = add(mp[i][0], pow[n*2]);
      |                                     ^
a.cc:58:55: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   58 |             mp[i][gr[i][j]] = add(mp[i][gr[i][j]], pow[j*2]);
      |                                                       ^