Language: C++

#include<iostream>
#include<string>
typedef long long ll
using namespace std;
vector<bool> IsPrime;

void sieve(size_t max){
    if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
        IsPrime.resize(max+1,true); // IsPrimeに必要な要素数を確保
    } 
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない

    for(size_t i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる
        if(IsPrime[i]) // iが素数ならば
            for(size_t j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                IsPrime[i*j] = false;      // 素数ではない
}

int main() {
  cin >> N;
  vector<vector<ll>> nums(N, vector<ll>(N))
  sieve(N)
  ll g,time;
  for (ll i=0;i<N; ++i) {
    if(!IsPrime[i+1]) break;
    g = i+1;
    time = 1;
    while(g < N) {
      for(ll j=1;j * g<N;++j) {
        nums.at(j * g-1).at(i) = time;
      }
      g *= i+1;
      ++time;
    }
  }
  ll total = 0;
  for (ll i=0;i<N;++i) {
    g = 1
    if(IsPrime[i+1]) {
      total += (i+1)*2;
      continue;
    }
    for (ll j=0;j<N;++j) {
      if(!IsPrime[j+1]) continue;
      g *= nums.at(i).at(j)+1
    }
    total += g;
  }

  cout << total << endl;
}

Compiler output:
a.cc:4:1: error: expected initializer before 'using'
    4 | using namespace std;
      | ^~~~~
a.cc:5:1: error: 'vector' does not name a type
    5 | vector<bool> IsPrime;
      | ^~~~~~
a.cc: In function 'void sieve(size_t)':
a.cc:8:16: error: 'IsPrime' was not declared in this scope
    8 |     if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
      |                ^~~~~~~
a.cc:11:5: error: 'IsPrime' was not declared in this scope
   11 |     IsPrime[0] = false; // 0は素数ではない
      |     ^~~~~~~
a.cc: In function 'int main()':
a.cc:21:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   21 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:21:10: error: 'N' was not declared in this scope
   21 |   cin >> N;
      |          ^
a.cc:22:3: error: 'vector' was not declared in this scope
   22 |   vector<vector<ll>> nums(N, vector<ll>(N))
      |   ^~~~~~
a.cc:22:17: error: 'll' was not declared in this scope
   22 |   vector<vector<ll>> nums(N, vector<ll>(N))
      |                 ^~
a.cc:22:22: error: 'nums' was not declared in this scope
   22 |   vector<vector<ll>> nums(N, vector<ll>(N))
      |                      ^~~~
a.cc:25:10: error: expected ';' before 'i'
   25 |   for (ll i=0;i<N; ++i) {
      |          ^~
      |          ;
a.cc:25:15: error: 'i' was not declared in this scope
   25 |   for (ll i=0;i<N; ++i) {
      |               ^
a.cc:26:9: error: 'IsPrime' was not declared in this scope
   26 |     if(!IsPrime[i+1]) break;
      |         ^~~~~~~
a.cc:27:5: error: 'g' was not declared in this scope
   27 |     g = i+1;
      |     ^
a.cc:28:10: error: assignment of function 'time_t time(time_t*)'
   28 |     time = 1;
      |     ~~~~~^~~
a.cc:30:13: error: expected ';' before 'j'
   30 |       for(ll j=1;j * g<N;++j) {
      |             ^~
      |             ;
a.cc:30:18: error: 'j' was not declared in this scope
   30 |       for(ll j=1;j * g<N;++j) {
      |                  ^
a.cc:34:9: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   34 |       ++time;
      |         ^~~~
a.cc:34:9: error: lvalue required as increment operand
a.cc:37:5: error: expected ';' before 'total'
   37 |   ll total = 0;
      |     ^~~~~~
      |     ;
a.cc:38:10: error: expected ';' before 'i'
   38 |   for (ll i=0;i<N;++i) {
      |          ^~
      |          ;
a.cc:38:15: error: 'i' was not declared in this scope
   38 |   for (ll i=0;i<N;++i) {
      |               ^
a.cc:39:5: error: 'g' was not declared in this scope
   39 |     g = 1
      |     ^
a.cc:44:12: error: expected ';' before 'j'
   44 |     for (ll j=0;j<N;++j) {
      |            ^~
      |            ;
a.cc:44:17: error: 'j' was not declared in this scope
   44 |     for (ll j=0;j<N;++j) {
      |                 ^
a.cc:45:11: error: 'IsPrime' was not declared in this scope
   45 |       if(!IsPrime[j+1]) continue;
      |           ^~~~~~~
a.cc:48:5: error: 'total' was not declared in this scope
   48 |     total += g;
      |     ^~~~~
a.cc:51:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   51 |   cout << total << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:51:11: error: 'total' was not declared in this scope
   51 |   cout << total << endl;
      |           ^~~~~
a.cc:51:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   51 |   cout << total << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~