Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

int isprime[1000000000000];

u64 gcd(u64 x, u64 y)
{
    if (x < y) swap(x, y);
    if (y == 0) return x;
    else return gcd(y, x % y);
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    u64 A, B;
    cin >> A >> B;
    u64 N = gcd(A, B);

    u64 ans = 1;
    isprime[0] = isprime[1] = 1;
    for (u64 i = 2; i <= N; ++i)
    {
        if (isprime[i]  == 0)
        {
            u64 j = i + i;
            ++ans;
            while (N % i == 0)
            {
                N /= i;
            }
            while (j <= N)
            {
                isprime[j] = 1;
                j += i;
            }
        }
    }

    cout << ans << "\n";
    return 0;
}



Compiler output:
a.cc:18:9: error: 'uint64_t' does not name a type
   18 | typedef uint64_t u64;
      |         ^~~~~~~~
a.cc:15:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   14 | #include <cstring>
  +++ |+#include <cstdint>
   15 | 
a.cc:20:9: error: 'uint32_t' does not name a type
   20 | typedef uint32_t u32;
      |         ^~~~~~~~
a.cc:20:9: note: 'uint32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
a.cc:35:1: error: 'u64' does not name a type; did you mean 's64'?
   35 | u64 gcd(u64 x, u64 y)
      | ^~~
      | s64
a.cc: In function 'int main()':
a.cc:47:5: error: 'u64' was not declared in this scope; did you mean 's64'?
   47 |     u64 A, B;
      |     ^~~
      |     s64
a.cc:48:12: error: 'A' was not declared in this scope
   48 |     cin >> A >> B;
      |            ^
a.cc:48:17: error: 'B' was not declared in this scope
   48 |     cin >> A >> B;
      |                 ^
a.cc:49:8: error: expected ';' before 'N'
   49 |     u64 N = gcd(A, B);
      |        ^~
      |        ;
a.cc:51:8: error: expected ';' before 'ans'
   51 |     u64 ans = 1;
      |        ^~~~
      |        ;
a.cc:53:13: error: expected ';' before 'i'
   53 |     for (u64 i = 2; i <= N; ++i)
      |             ^~
      |             ;
a.cc:53:21: error: 'i' was not declared in this scope
   53 |     for (u64 i = 2; i <= N; ++i)
      |                     ^
a.cc:53:26: error: 'N' was not declared in this scope
   53 |     for (u64 i = 2; i <= N; ++i)
      |                          ^
a.cc:57:16: error: expected ';' before 'j'
   57 |             u64 j = i + i;
      |                ^~
      |                ;
a.cc:58:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   58 |             ++ans;
      |               ^~~
      |               abs
a.cc:63:20: error: 'j' was not declared in this scope; did you mean 'jn'?
   63 |             while (j <= N)
      |                    ^
      |                    jn
a.cc:71:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   71 |     cout << ans << "\n";
      |             ^~~
      |             abs