criyle/codenet-compile-errors huggingface dataset:
Language: C++

    import java.math.BigInteger;
    import java.util.Scanner;
     
    public class Main {
        public static void main(String[] args) {
            Scanner in = new Scanner(System.in);
     
            int n = in.nextInt();
            int []nums = new int[n];
            for (int i = 0 ; i < n ; i++){
                nums[i] = in.nextInt();
            }
            BigInteger sum = BigInteger.ZERO;
            for (int i = 0 ; i < n - 1; i++){
                for (int j = i + 1; j < n; j++){
                    sum = sum.add(BigInteger.valueOf(lcm(nums[i], nums[j]))).mod(BigInteger.valueOf(998244353));
                }
            }
            System.out.println(sum.toString());
        }
     
     
        public static int gcd(int a, int b)
        {
            if (a == 0)
                return b;
            return gcd(b % a, a);
        }
     
        public static int lcm(int a, int b)
        {
            return (a*b)/gcd(a, b);
        }
    }

Compiler output:
a.cc:1:5: error: 'import' does not name a type
    1 |     import java.math.BigInteger;
      |     ^~~~~~
a.cc:1:5: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:5: error: 'import' does not name a type
    2 |     import java.util.Scanner;
      |     ^~~~~~
a.cc:2:5: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:5: error: expected unqualified-id before 'public'
    4 |     public class Main {
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
#include "../lib/math/comb.hpp"

using namespace std;

#define SZ(x) (int)(x.size())

using ll = long long;
using ld = long double;
using P = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
const ld eps = 1e-9;
const ll MOD = 998244353;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int n; cin >> n;
  int ma = 1000010;
  vll a(n);
  vll cnt(ma);
  for(int i=0;i<n;++i) {
    cin >> a[i];
    cnt[a[i]]++;
  }

  
  Combination<MOD> comb(ma+1);
  vll c(ma);
  for(int i=1;i<=ma;++i) {
    c[i] = comb.getinv(i);
  }
  for(int i=1;i<=ma;++i) {
    for(int j=2*i;j<=ma;j+=i) {
      c[j] += (MOD - c[i]);
      c[j] %= MOD;
    }
  }

  ll ans = 0;
  for(int i=1;i<=ma;++i) {
    ll su1 = 0, su2 = 0;
    for(ll j=i;j<=ma;j+=i) {
      su1 += j * cnt[j];
      su2 += j * j % MOD * cnt[j] % MOD;
      su1 %= MOD;
      su2 %= MOD;
    }
    ll tmp = (su1 * su1 % MOD + MOD - su2) % MOD * comb.getinv(2) % MOD;
    ans += c[i] * tmp % MOD;
    ans %= MOD;
  }
  cout << ans << endl;
}


Compiler output:
a.cc:2:10: fatal error: ../lib/math/comb.hpp: No such file or directory
    2 | #include "../lib/math/comb.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

const int MAXN = 200100;
const int MAXV = 1000100;
const int mod = 998244353;

inline void Add(int&x, int y) { x += y, x -= x >= mod ? mod : 0; }
inline int Mod(int x) { return x >= mod ? x - mod : x; }

template<typename T>
inline void chkmax(T&a, T b) { a = a > b ? a : b; }

int a_1[MAXV + 1];
int a_2[MAXV + 1];
int f_d[MAXV + 1];

int tot;
int pri[MAXV + 1];
int miu[MAXV + 1];
int inv[MAXV + 1];
int chk[MAXV + 1];
int F[MAXV + 1];

inline int init(int mx) {
    inv[1] = 1, miu[1] = 1;
    for(int i = 2; i <= mx; i++) {
        inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
        if(!chk[i]) pri[++tot] = i, miu[i] = mod - 1;
        for(int j = 1; j <= tot; j++) {
            if(i * pri[j] > mx) break;
            chk[i * pri[j]] = 1;
            if(i % pri[j] == 0) break;
            miu[i * pri[j]] = mod - miu[i];
        }
    }
    for(int i = 1; i <= mx; i++) {
        for(int j = i << 1; j <= mx; j += i)
            Add(a_1[i], a_1[j]), Add(a_2[i], a_2[j]);
        f_d[i] = 1LL * (1LL * a_1[i] * a_1[i] - a_2[i] + mod) % mod * inv[2] % mod;
    }
}

int main() {
    int n = Re, N = 0;
    for(int i = 1; i <= n; i++) {
        int v = Re;
        chkmax(N, v); Add(a_1[v], v);
        Add(a_2[v], 1LL * v * v % mod);
    } init(N); int res = 0;
    for(int d = 1; d <= N; d++) {
        for(int T = d, t = 1; T <= N; T += d, ++t) {
            Add(res, 1LL * inv[d] * miu[t] % mod * f_d[T] % mod);
        }
    } printf("%d\n", res);
    return 0;
}

Compiler output:
a.cc: In function 'int init(int)':
a.cc:39:1: warning: no return statement in function returning non-void [-Wreturn-type]
   39 | }
      | ^
a.cc: In function 'int main()':
a.cc:42:13: error: 'Re' was not declared in this scope
   42 |     int n = Re, N = 0;
      |             ^~
a.cc:45:16: error: 'N' was not declared in this scope
   45 |         chkmax(N, v); Add(a_1[v], v);
      |                ^
a.cc:47:12: error: 'N' was not declared in this scope
   47 |     } init(N); int res = 0;
      |            ^
a.cc:52:7: error: 'printf' was not declared in this scope
   52 |     } printf("%d\n", res);
      |       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | const int MAXN = 200100;
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const int MAXV = 1000100;
const int mod = 998244353;

inline void Add(int&x, int y) { x += y, x -= x >= mod ? mod : 0; }
inline int Mod(int x) { return x >= mod ? x - mod : x; }

template<typename T>
inline void chkmax(T&a, T b) { a = a > b ? a : b; }

int a_1[MAXV + 1];
int a_2[MAXV + 1];
int f_d[MAXV + 1];

int tot;
int pri[MAXV + 1];
int miu[MAXV + 1];
int inv[MAXV + 1];
int chk[MAXV + 1];
int F[MAXV + 1];

inline int init(int mx) {
    inv[1] = 1, miu[1] = 1;
    for(int i = 2; i <= mx; i++) {
        inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
        if(!chk[i]) pri[++tot] = i, miu[i] = mod - 1;
        for(int j = 1; j <= tot; j++) {
            if(i * pri[j] > mx) break;
            chk[i * pri[j]] = 1;
            if(i % pri[j] == 0) break;
            miu[i * pri[j]] = mod - miu[i];
        }
    }
    for(int i = 1; i <= mx; i++) {
        for(int j = i << 1; j <= mx; j += i)
            Add(a_1[i], a_1[j]), Add(a_2[i], a_2[j]);
        f_d[i] = 1LL * (1LL * a_1[i] * a_1[i] - a_2[i] + mod) % mod * inv[2] % mod;
    }
}

int main() {
    int n = Re, N = 0;
    for(int i = 1; i <= n; i++) {
        int v = Re;
        chkmax(N, v); Add(a_1[v], v);
        Add(a_2[v], 1LL * v * v % mod);
    } init(N); int res = 0;
    for(int d = 1; d <= N; d++) {
        for(int T = d, t = 1; T <= N; T += d, ++t) {
            Add(res, 1LL * inv[d] * miu[t] % mod * f_d[T] % mod);
        }
    } printf("%d\n", res);
    return 0;
}

Compiler output:
a.cc: In function 'int init(int)':
a.cc:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'Re' was not declared in this scope
   44 |     int n = Re, N = 0;
      |             ^~
a.cc:47:16: error: 'N' was not declared in this scope
   47 |         chkmax(N, v); Add(a_1[v], v);
      |                ^
a.cc:49:12: error: 'N' was not declared in this scope
   49 |     } init(N); int res = 0;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const int MAXV = 1000100;
const int mod = 998244353;

inline void Add(int&x, int y) { x += y, x -= x >= mod ? mod : 0; }
inline int Mod(int x) { return x >= mod ? x - mod : x; }

template<typename T>
inline void chkmax(T&a, T b) { a = a > b ? a : b; }

int a_1[MAXV + 1];
int a_2[MAXV + 1];
int f_d[MAXV + 1];

int tot;
int pri[MAXV + 1];
int miu[MAXV + 1];
int inv[MAXV + 1];
int chk[MAXV + 1];
int F[MAXV + 1];

inline int init(int mx) {
    inv[1] = 1, miu[1] = 1;
    for(int i = 2; i <= mx; i++) {
        inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
        if(!chk[i]) pri[++tot] = i, miu[i] = mod - 1;
        for(int j = 1; j <= tot; j++) {
            if(i * pri[j] > mx) break;
            chk[i * pri[j]] = 1;
            if(i % pri[j] == 0) break;
            miu[i * pri[j]] = mod - miu[i];
        }
    }
    for(int i = 1; i <= mx; i++) {
        for(int j = i << 1; j <= mx; j += i)
            Add(a_1[i], a_1[j]), Add(a_2[i], a_2[j]);
        f_d[i] = 1LL * (1LL * a_1[i] * a_1[i] - a_2[i] + mod) % mod * inv[2] % mod;
    }
}

int main() {
    int n = Re, N = 0;
    for(int i = 1; i <= n; i++) {
        int v = Re;
        chkmax(N, v); Add(a_1[v], v);
        Add(a_2[v], 1LL * v * v % mod);
    } init(N); int res = 0;
    for(int d = 1; d <= N; d++) {
        for(int T = d, t = 1; T <= N; T += d, ++t) {
            Add(res, 1LL * inv[d] * miu[t] % mod * f_d[T] % mod);
        }
    } printf("%d\n", res);
    return 0;
};

Compiler output:
a.cc: In function 'int init(int)':
a.cc:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'Re' was not declared in this scope
   44 |     int n = Re, N = 0;
      |             ^~
a.cc:47:16: error: 'N' was not declared in this scope
   47 |         chkmax(N, v); Add(a_1[v], v);
      |                ^
a.cc:49:12: error: 'N' was not declared in this scope
   49 |     } init(N); int res = 0;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int MAXN = 200100;
const int MAXV = 1000100;
const int mod = 998244353;

inline void Add(int&x, int y) { x += y, x -= x >= mod ? mod : 0; }
inline int Mod(int x) { return x >= mod ? x - mod : x; }

template<typename T>
inline void chkmax(T&a, T b) { a = a > b ? a : b; }

int a_1[MAXV + 1];
int a_2[MAXV + 1];
int f_d[MAXV + 1];

int tot;
int pri[MAXV + 1];
int miu[MAXV + 1];
int inv[MAXV + 1];
int chk[MAXV + 1];
int F[MAXV + 1];

inline int init(int mx) {
    inv[1] = 1, miu[1] = 1;
    for(int i = 2; i <= mx; i++) {
        inv[i] = 1LL * (mod - mod / i) * inv[mod % i] % mod;
        if(!chk[i]) pri[++tot] = i, miu[i] = mod - 1;
        for(int j = 1; j <= tot; j++) {
            if(i * pri[j] > mx) break;
            chk[i * pri[j]] = 1;
            if(i % pri[j] == 0) break;
            miu[i * pri[j]] = mod - miu[i];
        }
    }
    for(int i = 1; i <= mx; i++) {
        for(int j = i << 1; j <= mx; j += i)
            Add(a_1[i], a_1[j]), Add(a_2[i], a_2[j]);
        f_d[i] = 1LL * (1LL * a_1[i] * a_1[i] - a_2[i] + mod) % mod * inv[2] % mod;
    }
}

int main() {
    int n = Re, N = 0;
    for(int i = 1; i <= n; i++) {
        int v = Re;
        chkmax(N, v); Add(a_1[v], v);
        Add(a_2[v], 1LL * v * v % mod);
    } init(N); int res = 0;
    for(int d = 1; d <= N; d++) {
        for(int T = d, t = 1; T <= N; T += d, ++t) {
            Add(res, 1LL * inv[d] * miu[t] % mod * f_d[T] % mod);
        }
    } printf("%d\n", res);
    return 0;
};;;

Compiler output:
a.cc: In function 'int init(int)':
a.cc:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^
a.cc: In function 'int main()':
a.cc:44:13: error: 'Re' was not declared in this scope
   44 |     int n = Re, N = 0;
      |             ^~
a.cc:47:16: error: 'N' was not declared in this scope
   47 |         chkmax(N, v); Add(a_1[v], v);
      |                ^
a.cc:49:12: error: 'N' was not declared in this scope
   49 |     } init(N); int res = 0;
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=1e6+5;
const int p=998244353;
int n,a[N],f[N]={0};
short int mu[N];
ll inv[N],w[N];
int main(){
    mu[1]=1;inv[1]=1;
    for(int i=2;i<N;i++)inv[i]=(p-p/i)*inv[p%i]%p;
    for(int i=1;i<N;i++)
    for(int j=i+i;j<N;j+=i)mu[j]-=mu[i];
    for(int i=1;i<N;i++)
    for(int j=i;j<N;j+=i)w[j]+=mu[j/i]*inv[i],w[j]=(w[j]%p+p)%p;
    cin>>n;
    for(int i=1;i<=n;i++)sc("%d",&a[i]),f[a[i]]++;
    ll ans=0;
    for(int d=1;d<N;d++){
        ll res=0,ret=0;
        for(int i=d;i<N;i+=d){
            if(f[i]){
                ret+=1LL*i*((res*f[i]%p+1LL*f[i]*(f[i]-1)/2%p*i%p)%p)%p;
                res+=i*f[i]%p;
                ret%=p,res%=p;
            }
        }
        ans+=w[d]*ret%p;
        ans%=p;
    }o(ans);
}

Compiler output:
a.cc:7:1: error: 'll' does not name a type
    7 | ll inv[N],w[N];
      | ^~
a.cc: In function 'int main()':
a.cc:9:13: error: 'inv' was not declared in this scope; did you mean 'int'?
    9 |     mu[1]=1;inv[1]=1;
      |             ^~~
      |             int
a.cc:14:26: error: 'w' was not declared in this scope
   14 |     for(int j=i;j<N;j+=i)w[j]+=mu[j/i]*inv[i],w[j]=(w[j]%p+p)%p;
      |                          ^
a.cc:16:26: error: 'sc' was not declared in this scope
   16 |     for(int i=1;i<=n;i++)sc("%d",&a[i]),f[a[i]]++;
      |                          ^~
a.cc:17:5: error: 'll' was not declared in this scope
   17 |     ll ans=0;
      |     ^~
a.cc:19:11: error: expected ';' before 'res'
   19 |         ll res=0,ret=0;
      |           ^~~~
      |           ;
a.cc:22:17: error: 'ret' was not declared in this scope
   22 |                 ret+=1LL*i*((res*f[i]%p+1LL*f[i]*(f[i]-1)/2%p*i%p)%p)%p;
      |                 ^~~
a.cc:22:30: error: 'res' was not declared in this scope
   22 |                 ret+=1LL*i*((res*f[i]%p+1LL*f[i]*(f[i]-1)/2%p*i%p)%p)%p;
      |                              ^~~
a.cc:27:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   27 |         ans+=w[d]*ret%p;
      |         ^~~
      |         abs
a.cc:27:14: error: 'w' was not declared in this scope
   27 |         ans+=w[d]*ret%p;
      |              ^
a.cc:27:19: error: 'ret' was not declared in this scope
   27 |         ans+=w[d]*ret%p;
      |                   ^~~
a.cc:29:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   29 |     }o(ans);
      |        ^~~
      |        abs
a.cc:29:6: error: 'o' was not declared in this scope
   29 |     }o(ans);
      |      ^
Language: C++

constexpr int MOD = 998244353;

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool is_not_prime[N + 1];
    constexpr Eratosthenes() : w(), is_not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (int prime = 2; prime <= N; prime++)
        {
            if (is_not_prime[prime])
            {
                continue;
            }
            for (int k = N / prime; k > 1; --k)
            {
                is_not_prime[k * prime] = true;
                w[k * prime] -= w[k];
                if (w[k * prime] < 0)
                {
                    w[k * prime] += MOD;
                }
            }
            w[prime] -= w[1];
        }
    }
};

int main()
{
    constexpr int M = 1000000;
    constexpr auto e = Eratosthenes<M>();
    long long ans = 0;
    int count[1000001] = {};
    int N;
    scanf("%d", &N);
    for (int i = 0; i < N; i++)
    {
        int j;
        scanf("%d", &j);

        count[j] += j;
        if (count[j] >= MOD)
        {
            count[j] -= MOD;
        }
        ans -= j;
        if (ans < 0)
        {
            ans += MOD;
        }
    }

    for (int prime = 2; prime <= M; prime++)
    {
        if (e.is_not_prime[prime])
        {
            continue;
        }
        for (int k = M / prime; k > 0; --k)
        {
            count[k] += count[k * prime];
            if (count[k] >= MOD)
            {
                count[k] -= MOD;
            }
        }
    }

    for (int i = 1; i <= M; i++)
    {
        ans += 1LL * count[i] * count[i] % MOD * e.w[i] % MOD;
    }
    ans %= MOD;
    if ((ans & 1) == 1)
    {
        ans = (ans + MOD) >> 1;
    }
    else
    {
        ans = ans >> 1;
    }
    printf("%ld\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:40:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:12:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   12 |         for (int i = 2; i <= N; i++)
      |         ^~~
a.cc:43:5: error: 'scanf' was not declared in this scope
   43 |     scanf("%d", &N);
      |     ^~~~~
a.cc:90:5: error: 'printf' was not declared in this scope
   90 |     printf("%ld\n", ans);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | constexpr int MOD = 998244353;
Language: C++

constexpr int MOD = 998244353;

int read_int()
{
    int n = 0;
    while (1)
    {
        int c = getchar_unlocked();
        if ('0' <= c && c <= '9')
            n = n * 10 + c - '0';
        else
            break;
    }
    return n;
}

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool is_not_prime[N + 1];
    constexpr Eratosthenes() : w(), is_not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (int prime = 2; prime <= N; prime++)
        {
            if (is_not_prime[prime])
            {
                continue;
            }
            for (int k = N / prime; k > 1; --k)
            {
                is_not_prime[k * prime] = true;
                w[k * prime] -= w[k];
                if (w[k * prime] < 0)
                {
                    w[k * prime] += MOD;
                }
            }
            w[prime] -= w[1];
        }
    }
};

int main()
{
    constexpr int M = 1000000;
    constexpr auto e = Eratosthenes<M>();
    long long ans = 0;
    int count[1000001] = {};
    int N = read_int();
    for (int i = 0; i < N; i++)
    {
        int j = read_int();
        count[j] += j;
        if (count[j] >= MOD)
        {
            count[j] -= MOD;
        }
        ans -= j;
        if (ans < 0)
        {
            ans += MOD;
        }
    }

    for (int prime = 2; prime <= M; prime++)
    {
        if (e.is_not_prime[prime])
        {
            continue;
        }
        for (int k = M / prime; k > 0; --k)
        {
            count[k] += count[k * prime];
            if (count[k] >= MOD)
            {
                count[k] -= MOD;
            }
        }
    }

    for (int i = 1; i <= M; i++)
    {
        ans += 1LL * count[i] * count[i] % MOD * e.w[i] % MOD;
    }
    ans %= MOD;
    if ((ans & 1) == 1)
    {
        ans = (ans + MOD) >> 1;
    }
    else
    {
        ans = ans >> 1;
    }
    printf("%ld\n", ans);
}


Compiler output:
a.cc: In function 'int read_int()':
a.cc:8:17: error: 'getchar_unlocked' was not declared in this scope
    8 |         int c = getchar_unlocked();
      |                 ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:53:40:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:26:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   26 |         for (int i = 2; i <= N; i++)
      |         ^~~
a.cc:101:5: error: 'printf' was not declared in this scope
  101 |     printf("%ld\n", ans);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | constexpr int MOD = 998244353;
Language: C++

constexpr int MOD = 998244353;

int read_int()
{
    int n = 0;
    while (1)
    {
        int c = getchar_unlocked();
        if ('0' <= c && c <= '9')
            n = n * 10 + c - '0';
        else
            break;
    }
    return n;
}

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool is_not_prime[N + 1];
    constexpr Eratosthenes() : w(), is_not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (int prime = 2; prime <= N; prime++)
        {
            if (is_not_prime[prime])
            {
                continue;
            }
            for (int k = N / prime; k > 1; --k)
            {
                is_not_prime[k * prime] = true;
                w[k * prime] -= w[k];
                if (w[k * prime] < 0)
                {
                    w[k * prime] += MOD;
                }
            }
            w[prime] -= w[1];
        }
    }
};

int main()
{
    constexpr int M = 1000000;
    constexpr auto e = Eratosthenes<M>();
    long long ans = 0;
    int count[1000001] = {};
    int N = read_int();
    for (int i = 0; i < N; i++)
    {
        int j = read_int();
        count[j] += j;
        if (count[j] >= MOD)
        {
            count[j] -= MOD;
        }
        ans -= j;
        if (ans < 0)
        {
            ans += MOD;
        }
    }

    for (int prime = 2; prime <= M; prime++)
    {
        if (e.is_not_prime[prime])
        {
            continue;
        }
        for (int k = M / prime; k > 0; --k)
        {
            count[k] += count[k * prime];
            if (count[k] >= MOD)
            {
                count[k] -= MOD;
            }
        }
    }

    for (int i = 1; i <= M; i++)
    {
        ans += 1LL * count[i] * count[i] % MOD * e.w[i] % MOD;
    }
    ans %= MOD;
    if ((ans & 1) == 1)
    {
        ans = (ans + MOD) >> 1;
    }
    else
    {
        ans = ans >> 1;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int read_int()':
a.cc:8:17: error: 'getchar_unlocked' was not declared in this scope
    8 |         int c = getchar_unlocked();
      |                 ^~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:53:40:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:26:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   26 |         for (int i = 2; i <= N; i++)
      |         ^~~
a.cc:101:5: error: 'cout' was not declared in this scope; did you mean 'count'?
  101 |     cout << ans << endl;
      |     ^~~~
      |     count
a.cc:101:20: error: 'endl' was not declared in this scope
  101 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include <iostream>
using namespace std;
constexpr int MOD = 998244353;

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool is_not_prime[N + 1];
    constexpr Eratosthenes() : w(), is_not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (int prime = 2; prime <= N; prime++)
        {
            if (is_not_prime[prime])
            {
                continue;
            }
            for (int k = N / prime; k > 1; --k)
            {
                is_not_prime[k * prime] = true;
                w[k * prime] -= w[k];
                if (w[k * prime] < 0)
                {
                    w[k * prime] += MOD;
                }
            }
            w[prime] -= w[1];
        }
    }
};

int main()
{
    constexpr int M = 1000000;
    constexpr auto prime = Eratosthenes<M>();
    long long N, ans = 0;
    int a[1000001] = {};
    cin >> N;
    for (int i = 0, j; i < N; i++)
    {
        cin >> j;
        a[j] += j;
        if (a[j] >= MOD)
        {
            a[j] -= MOD;
        }
        ans -= j;
        if (ans < 0)
        {
            ans += MOD;
        }
    }
    for (int prime = 2; prime <= M; prime++)
    {
        if (prime.is_not_prime[prime])
        {
            continue;
        }
        for (int k = M / prime; k > 0; --k)
        {
            a[k] += a[k * prime];
            if (a[k] >= MOD)
            {
                a[k] -= MOD;
            }
        }
    }
    for (int i = 1; i <= M; i++)
    {
        ans += 1LL * a[i] * a[i] % MOD * prime.w[i] % MOD;
    }
    ans %= MOD;
    if ((ans & 1) == 1)
    {
        ans = (ans + MOD) >> 1;
    }
    else
    {
        ans = ans >> 1;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:44:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:14:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   14 |         for (int i = 2; i <= N; i++)
      |         ^~~
a.cc:61:19: error: request for member 'is_not_prime' in 'prime', which is of non-class type 'int'
   61 |         if (prime.is_not_prime[prime])
      |                   ^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
constexpr int MOD = 998244353;

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool is_not_prime[N + 1];
    constexpr Eratosthenes() : w(), is_not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (int prime = 2; prime <= N; prime++)
        {
            if (is_not_prime[prime])
            {
                continue;
            }
            for (int k = N / prime; k > 1; --k)
            {
                is_not_prime[k * prime] = true;
                w[k * prime] -= w[k];
                if (w[k * prime] < 0)
                {
                    w[k * prime] += MOD;
                }
            }
            w[prime] -= w[1];
        }
    }
};

int main()
{
    constexpr int M = 1000000;
    constexpr auto prime = Eratosthenes<M>();
    long long N, ans = 0;
    int a[1000001] = {};
    cin >> N;
    for (int i = 0, j; i < N; i++)
    {
        cin >> j;
        a[j] += j;
        if (a[j] >= MOD)
        {
            a[j] -= MOD;
        }
        ans -= j;
        if (ans < 0)
        {
            ans += MOD;
        }
    }
    for (int prime = 2; prime <= M; prime++)
    {
        if (prime.is_not_prime[prime])
        {
            continue;
        }
        for (int k = M / prime; k > 0; --k)
        {
            a[k] += a[k * prime];
            if (a[k] >= MOD)
            {
                a[k] -= MOD;
            }
        }
    }
    for (int i = 1; i <= M; i++)
    {
        ans += 1LL * a[i] * a[i] % MOD * prime.w[i] % MOD;
    }
    ans %= MOD;
    if (ans & 1)
        ans = (ans + MOD) >> 1;
    else
        ans = ans >> 1;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:44:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:14:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   14 |         for (int i = 2; i <= N; i++)
      |         ^~~
a.cc:61:19: error: request for member 'is_not_prime' in 'prime', which is of non-class type 'int'
   61 |         if (prime.is_not_prime[prime])
      |                   ^~~~~~~~~~~~
Language: C++

#include <iostream>
using namespace std;

constexpr int64_t MOD = 998244353;
constexpr int M = 1000000;

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool not_prime[N + 1];
    constexpr Eratosthenes() : w(), not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (size_t x = 1; x <= N; x++)
        {
            size_t d = x * 2;
            while (d <= N)
            {
                w[d] -= w[x];
                if (w[d] < 0)
                {
                    w[d] += MOD;
                }
                d += x;
            }
        }
    }
};

int main()
{
    int64_t inv2 = MOD - 1LL * 1 * (MOD / 2) % MOD;
    constexpr auto prime = Eratosthenes<M>();
    int count[1000001] = {};
    size_t N;
    cin >> N;
    for (size_t i = 0; i < N; i++)
    {
        int j;
        cin >> j;
        count[j] += 1;
    }

    int64_t ans = 0;
    for (size_t d = 1; d <= M; d++)
    {
        int64_t x = d;
        int64_t sum = 0;
        int64_t sum2 = 0;
        while (x <= M)
        {
            int64_t tmp = (1LL * x * count[x]) % MOD;
            sum += tmp;
            sum2 += (tmp * x) % MOD;
            sum %= MOD;
            sum2 %= MOD;
            x += d;
        }
        int64_t tmp = (sum * sum + MOD - sum2) % MOD * inv2 % MOD * prime.w[d];
        ans += tmp % MOD;
        if (ans >= MOD)
        {
            ans -= MOD;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:44:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:16:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   16 |         for (int i = 2; i <= N; i++)
      |         ^~~
Language: C++

#include <iostream>
using namespace std;
constexpr int MOD = 998244353;

template <int N>
struct Eratosthenes
{
    int w[N + 1];
    bool not_prime[N + 1];
    constexpr Eratosthenes() : w(), not_prime()
    {
        w[0] = 0;
        w[1] = 1;
        for (int i = 2; i <= N; i++)
        {
            w[i] = MOD - 1LL * w[MOD % i] * (MOD / i) % MOD;
        }
        for (int p = 2; p <= N; p++)
        {
            if (!not_prime[p])
            {
                for (int d = p * 2; d <= N; d += p)
                {
                    not_prime[d] = true;
                    w[d] -= w[p];
                    if (w[d] < 0)
                    {
                        w[d] += MOD;
                    }
                }
            }
        }
    }
};

int main()
{
    constexpr int M = 1000000;
    constexpr auto prime = Eratosthenes<M>();
    long long N, ans = 0;
    int count[1000001] = {};
    cin >> N;
    for (size_t i = 0; i < N; i++)
    {
        int j;
        cin >> j;
        count[j] += 1;
    }

    int ans = 0;
    for (size_t d = 1; d <= M; d++)
    {
        int x = d;
        int sum = 0;
        int sum2 = 0;
        while (x <= M)
        {
            sum += 1LL * x * count[x] % MOD;
            sum2 += 1LL * x * x % MOD * count[x] % MOD;
            if (sum >= MOD)
            {
                sum -= MOD;
            }
            if (sum2 >= MOD)
            {
                sum2 -= MOD;
            }
            x += d;
        }
        ans += (1LL * sum * sum - sum2) / 2 * prime.w[d];
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:44:   in 'constexpr' expansion of 'Eratosthenes<1000000>()'
a.cc:14:9: error: 'constexpr' loop iteration count exceeds limit of 262144 (use '-fconstexpr-loop-limit=' to increase the limit)
   14 |         for (int i = 2; i <= N; i++)
      |         ^~~
a.cc:50:9: error: conflicting declaration 'int ans'
   50 |     int ans = 0;
      |         ^~~
a.cc:40:18: note: previous declaration as 'long long int ans'
   40 |     long long N, ans = 0;
      |                  ^~~
Language: C++

#! /usr/bin/env python3

### @file lcm.py
### @brief
### @author Yusuke Matsunaga (松永 裕介)
###
### Copyright (C) 2019 Yusuke Matsunaga
### All rights reserved.


magic_number = 998244353

max_num = 1000001

n = int(input())

tmp_list = input().split()
A = [ int(tmp) for tmp in tmp_list ]

# 出現回数と最大値を求める．
h = [ 0 for i in range(max_num) ]
max_val = 0
for val in A :
    h[val] += 1
    if max_val < val :
        max_val = val

W = [ 1 for i in range(max_val + 1) ]
for i in range(1, max_val + 1) :
    for j in range(i * 2, max_val + 1, i) :
        W[j] -= W[i] * (j // i)

ans = 0
for x in range(1, max_val + 1) :
    sum = 0
    diff = 0
    for val1 in range(x, max_val + 1, x) :
        h1 = h[val1]
        v1 = h1 * val1
        sum += v1
        diff += v1 * val1
    val = (sum * sum - diff) // 2
    if val == 0 :
        continue

    ans += W[x] * val // x

ans = ans % magic_number

print(ans)


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #! /usr/bin/env python3
      |  ^
a.cc:3:1: error: stray '##' in program
    3 | ### @file lcm.py
      | ^~
a.cc:3:3: error: stray '#' in program
    3 | ### @file lcm.py
      |   ^
a.cc:3:5: error: stray '@' in program
    3 | ### @file lcm.py
      |     ^
a.cc:4:1: error: stray '##' in program
    4 | ### @brief
      | ^~
a.cc:4:3: error: stray '#' in program
    4 | ### @brief
      |   ^
a.cc:4:5: error: stray '@' in program
    4 | ### @brief
      |     ^
a.cc:5:1: error: stray '##' in program
    5 | ### @author Yusuke Matsunaga (松永 裕介)
      | ^~
a.cc:5:3: error: stray '#' in program
    5 | ### @author Yusuke Matsunaga (松永 裕介)
      |   ^
a.cc:5:5: error: stray '@' in program
    5 | ### @author Yusuke Matsunaga (松永 裕介)
      |     ^
a.cc:6:1: error: stray '##' in program
    6 | ###
      | ^~
a.cc:6:3: error: stray '#' in program
    6 | ###
      |   ^
a.cc:7:1: error: stray '##' in program
    7 | ### Copyright (C) 2019 Yusuke Matsunaga
      | ^~
a.cc:7:3: error: stray '#' in program
    7 | ### Copyright (C) 2019 Yusuke Matsunaga
      |   ^
a.cc:8:1: error: stray '##' in program
    8 | ### All rights reserved.
      | ^~
a.cc:8:3: error: stray '#' in program
    8 | ### All rights reserved.
      |   ^
a.cc:20:3: error: invalid preprocessing directive #\U000051fa\U000073fe\U000056de\U00006570\U00003068\U00006700\U00005927\U00005024\U00003092\U00006c42\U00003081\U0000308b\U0000ff0e
   20 | # 出現回数と最大値を求める．
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:3:6: error: 'file' does not name a type
    3 | ### @file lcm.py
      |      ^~~~
Language: C++

#include<bits/stdc++.h>
#define ll                  long long
#define dl                 double
#define pb                push_back
#define F                  first
#define S                  second
#define endl              "\n"
#define rep(i,a,b)       for(i=a;i<b;i++)
#define all(v)             v.begin(),v.end()
#define allr(v)            v.rbegin(),v.rend()
#define mod              998244353LL
#define CIN(V,s,n)      for(int i=s;i<n;i++){cin >> V[i];}
#define COUT(V,s,n)   {for(int i=s;i<n;i++){cout <<  V[i] << " "  ;} cout << endl;}
#define fast               ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define CLEAR(V);      for(ll i=0;i<V.size();i++) V[i] = 0;
#define N                  1000050LL
#define tmod            998244353
using namespace std;

ll fac[N+2],Ifac[N+2],inv[N+2],w[N+2],fr[N+2];

int main()
{
fast;
ll q=1,t;
//cin >> q;
while(q--)
{
    ll n,m,k,i,j,l,r,c=0,b,a,g,counter=0,u,v,d,e,p,x,y,flag=1;
    //n=m=i=j=l=r=a=t=b=c=u=v=w=p=x=y=0;
    fac[0] = fac[1] = Ifac[0] = Ifac[1] = inv[1]  = 1;
    for(i=2;i<=N;i++) fac[i] = (fac[i-1]*i)%mod;
    Ifac[N] = MI(fac[N],mod);
    for(i=N-1;i>=1;i--) Ifac[i] = (Ifac[i+1]*(i+1))%mod;
    for(i=2;i<=N;i++) inv[i] = (Ifac[i]*fac[i-1])%mod;

    memset(w,0,sizeof(w));
    for(i=1;i<=N;i++)
    {
        w[i] = (w[i] + inv[i])%mod;
        for(j=2LL*i;j<=N;j+=i)
            w[j] = (w[j] - w[i] + mod)%mod;
    }

    memset(fr,0,sizeof(fr));

    cin >> n;
    for(i=0;i<n;i++) {cin >> x; fr[x]++;}
    ll ans = 0;
    for(i=1;i<=N;i++)
    {
        ll temp = 0,stemp=0;
        for(j=i;j<=N;j+=i)
        {
            temp = (temp + (fr[j]*j)%mod)%mod;
            stemp = (stemp + (fr[j]*((j*j)%mod))%mod)%mod;
        }
        ans = ( ans + (((((((temp*temp)%mod) - stemp  + mod )%mod)*inv[2])%mod)*w[i])%mod )%mod;
    }

    cout << ans << endl;

}
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:15: error: 'MI' was not declared in this scope
   33 |     Ifac[N] = MI(fac[N],mod);
      |               ^~
Language: C++

#include <stdio.h>

long long mdc(long long x, long long y) {
    int mod = 998244353;
    if (y==0) 
        return x%mod;
    else
        return mdc(y,x % y)%mod;
}

long long mmc(long long x, long long y) {
    int mod = 998244353;
    long long divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi%mod; 
}   

long long int acumula(long long n, long long v[], long long operacao()) {
    int mod = 998244353;
    long long acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += operacao((v[i]%mod), (v[j]%mod));
            acumulado = acumulado%mod;
        }
    }
    return acumulado%mod;
}

int main() {

    long long n;
    scanf("%lld", &n);
    long long v[n];
    for (int i=0; i<n; ++i)
        scanf("%lld", &v[i]);
        
    printf("%lld\n", acumula(n, v, mmc));
    return 0;
}

Compiler output:
a.cc: In function 'long long int acumula(long long int, long long int*, long long int (*)())':
a.cc:29:34: error: too many arguments to function
   29 |             acumulado += operacao((v[i]%mod), (v[j]%mod));
      |                          ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:44:36: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'long long int (*)()' [-fpermissive]
   44 |     printf("%lld\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    long long int (*)(long long int, long long int)
a.cc:21:61: note:   initializing argument 3 of 'long long int acumula(long long int, long long int*, long long int (*)())'
   21 | long long int acumula(long long n, long long v[], long long operacao()) {
      |                                                   ~~~~~~~~~~^~~~~~~~~~
Language: C++

#include <stdio.h>

long long mdc(long long x, long long y) {
    int mod = 998244353;
    if (y==0) 
        return x%mod;
    else
        return mdc(y,x % y)%mod;
}

long long mmc(long long x, long long y) {
    int mod = 998244353;
    long long divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi%mod; 
}   

long long int acumula(int n, int v[], int operacao()) {
    int mod = 998244353;
    long long acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += operacao(v[i]%mod, v[j]%mod);
            acumulado = acumulado%mod;
        }
    }
    return acumulado%mod;
}

int main() {

    int n;
    scanf("%d", &n);
    int v[n];
    for (int i=0; i<n; ++i)
        scanf("%d", &v[i]);
        
    printf("%lld\n", acumula(n, v, mmc));
    return 0;
}

Compiler output:
a.cc: In function 'long long int acumula(int, int*, int (*)())':
a.cc:29:34: error: too many arguments to function
   29 |             acumulado += operacao(v[i]%mod, v[j]%mod);
      |                          ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:44:36: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'int (*)()' [-fpermissive]
   44 |     printf("%lld\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    long long int (*)(long long int, long long int)
a.cc:21:43: note:   initializing argument 3 of 'long long int acumula(int, int*, int (*)())'
   21 | long long int acumula(int n, int v[], int operacao()) {
      |                                       ~~~~^~~~~~~~~~
Language: C++

#include <stdio.h>

long long mdc(long long x, long long y) {
    int mod = 998244353;
    if (y==0) 
        return x%mod;
    else
        return mdc(y,x % y)%mod;
}

long long mmc(long long x, long long y) {
    int mod = 998244353;
    long long divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi%mod; 
}   

long long int acumula(int n, int v[], int operacao()) {
    int mod = 998244353;
    long long acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += (operacao(v[i]%mod, v[j]%mod))%mod;
        }
    }
    return acumulado%mod;
}

int main() {

    int n;
    scanf("%d", &n);
    int v[n];
    for (int i=0; i<n; ++i)
        scanf("%d", &v[i]);
        
    printf("%lld\n", acumula(n, v, mmc));
    return 0;
}

Compiler output:
a.cc: In function 'long long int acumula(int, int*, int (*)())':
a.cc:29:35: error: too many arguments to function
   29 |             acumulado += (operacao(v[i]%mod, v[j]%mod))%mod;
      |                           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:43:36: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'int (*)()' [-fpermissive]
   43 |     printf("%lld\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    long long int (*)(long long int, long long int)
a.cc:21:43: note:   initializing argument 3 of 'long long int acumula(int, int*, int (*)())'
   21 | long long int acumula(int n, int v[], int operacao()) {
      |                                       ~~~~^~~~~~~~~~
Language: C++

#include <stdio.h>

long long mdc(long long x, long long y) {
    long long mod = 998244353;
    if (y==0) 
        return x%mod;
    else
        return mdc(y,x % y)%mod;
}

long long mmc(long long x, long long y) {
    long long mod = 998244353;
    long long divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi%mod; 
}   

long long acumula(int n, int v[], int operacao()) {
    long long mod = 998244353;
    long long acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += operacao(v[i]%mod, v[j]%mod)%mod;
        }
    }
    return acumulado%mod;
}

int main() {

    int n;
    scanf("%d", &n);
    int v[n];
    for (int i=0; i<n; ++i)
        scanf("%d", &v[i]);
        
    printf("%lld\n", acumula(n, v, mmc));
    return 0;
}

Compiler output:
a.cc: In function 'long long int acumula(int, int*, int (*)())':
a.cc:29:34: error: too many arguments to function
   29 |             acumulado += operacao(v[i]%mod, v[j]%mod)%mod;
      |                          ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:43:36: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'int (*)()' [-fpermissive]
   43 |     printf("%lld\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    long long int (*)(long long int, long long int)
a.cc:21:39: note:   initializing argument 3 of 'long long int acumula(int, int*, int (*)())'
   21 | long long acumula(int n, int v[], int operacao()) {
      |                                   ~~~~^~~~~~~~~~
Language: C++

#include <stdio.h>

long long mdc(long long x, long long y) {
    long long mod = 998244353;
    if (y==0) 
        return x%mod;
    else
        return mdc(y,x % y)%mod;
}

long long mmc(long long x, long long y) {
    long long mod = 998244353;
    long long divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi%mod; 
}   

long long acumula(int n, int v[], int operacao()) {
    long long mod = 998244353;
    long long acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += operacao(v[i]%mod, v[j]%mod)%mod;
        }
    }
    return acumulado%mod;
}

int main() {

    int n;
    scanf("%d", &n);
    int v[n];
    for (int i=0; i<n; ++i)
        scanf("%d", &v[i]);
        
    printf("%llu\n", acumula(n, v, mmc));
    return 0;
}

Compiler output:
a.cc: In function 'long long int acumula(int, int*, int (*)())':
a.cc:29:34: error: too many arguments to function
   29 |             acumulado += operacao(v[i]%mod, v[j]%mod)%mod;
      |                          ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:43:36: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'int (*)()' [-fpermissive]
   43 |     printf("%llu\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    long long int (*)(long long int, long long int)
a.cc:21:39: note:   initializing argument 3 of 'long long int acumula(int, int*, int (*)())'
   21 | long long acumula(int n, int v[], int operacao()) {
      |                                   ~~~~^~~~~~~~~~
Language: C++

#include <stdio.h>

long long mdc(long long x, long long y) {
    long long mod = 998244353;
    if (y==0) 
        return x%mod;
    else
        return mdc(y,x % y)%mod;
}

long long mmc(long long x, long long y) {
    long long mod = 998244353;
    long long divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi%mod; 
}   

long long acumula(int n, int v[], int operacao()) {
    long long mod = 998244353;
    long long acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += operacao(v[i]%mod, v[j]%mod)%mod;
        }
    }
    return acumulado%mod;
}

int main() {

    int n;
    scanf("%d", &n);
    int v[n];
    for (int i=0; i<n; ++i)
        scanf("%llu", &v[i]);
        
    printf("%llu\n", acumula(n, v, mmc));
    return 0;
}

Compiler output:
a.cc: In function 'long long int acumula(int, int*, int (*)())':
a.cc:29:34: error: too many arguments to function
   29 |             acumulado += operacao(v[i]%mod, v[j]%mod)%mod;
      |                          ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:43:36: error: invalid conversion from 'long long int (*)(long long int, long long int)' to 'int (*)()' [-fpermissive]
   43 |     printf("%llu\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    long long int (*)(long long int, long long int)
a.cc:21:39: note:   initializing argument 3 of 'long long int acumula(int, int*, int (*)())'
   21 | long long acumula(int n, int v[], int operacao()) {
      |                                   ~~~~^~~~~~~~~~
Language: C++

#include <stdio.h>

mod = 998244353;

int mdc(int x, int y) {
  if (y==0) 
    return x;
  else
    return mdc(y,x % y);
}

int mmc(int x, int y) {
    int divi;
    if(y == 0) 
        return x;
    else
        divi = (x*y)/(mdc(x,y));
    return divi; 
}   

int acumula(int n, int v[], int operacao()) {
    int acumulado = 0;
    for (int i=0; i<n; ++i) {
        if (i == n-1) {
            break;
        }
        for (int j=i+1; j<n; ++j) {
            acumulado += operacao(v[i], v[j]);
        }
    }
    return acumulado%mod;
}

int main() {

    int n;
    scanf("%d", &n);
    int v[n];
    for (int i=0; i<n; ++i)
        scanf("%lld", &v[i]);
        
    printf("%lld\n", acumula(n, v, mmc));
    return 0;
}


Compiler output:
a.cc:3:1: error: 'mod' does not name a type
    3 | mod = 998244353;
      | ^~~
a.cc: In function 'int acumula(int, int*, int (*)())':
a.cc:28:34: error: too many arguments to function
   28 |             acumulado += operacao(v[i], v[j]);
      |                          ~~~~~~~~^~~~~~~~~~~~
a.cc:31:22: error: 'mod' was not declared in this scope
   31 |     return acumulado%mod;
      |                      ^~~
a.cc: In function 'int main()':
a.cc:42:36: error: invalid conversion from 'int (*)(int, int)' to 'int (*)()' [-fpermissive]
   42 |     printf("%lld\n", acumula(n, v, mmc));
      |                                    ^~~
      |                                    |
      |                                    int (*)(int, int)
a.cc:21:33: note:   initializing argument 3 of 'int acumula(int, int*, int (*)())'
   21 | int acumula(int n, int v[], int operacao()) {
      |                             ~~~~^~~~~~~~~~