Language: C++

z#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int inf=1e9;
const int MOD=1e9+7;
ll ans=0;

const int MAX_N=1e7;
bool judge_prime(ll n)
{
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0) return false;
    }
    return n!=1;
}
vector<ll> divisor(ll n)
{
    vector<ll> res;
    for(ll i=1;i*i<=n;i++)
    {
        if(n%i==0)
        {
            res.push_back(i);
            if(i!=n/i) res.push_back(n/i);
        }
    }
    return res;
}
map<ll,ll> prime_factor(ll n)
{
    map<ll,ll> res;
    for(ll i=2;i*i<=n;i++)
    {
        while(n%i==0)
        {
            ++res[i];
            n/=i;
        }
    }
    if(n!=1) res[n]=1;
    return res;
}
ll prime[MAX_N];
bool is_prime[MAX_N+5];
ll sieve(ll n)
{
    ll p=0;
    for(ll i=0;i<=n;i++) is_prime[i]=true;
    is_prime[0]=is_prime[1]=false;
    for(ll i=2;i<=n;i++)
    {
        if(is_prime[i])
        {
            prime[p++]=i;
            for(ll j=2*i;j<=n;j+=i) is_prime[j]=false;
        }
    }
    return p;
}
int main(void)
{
    ll A,B;
    cin >> A >> B;
    ll mx=max(A,B);
    ll mini=min(A,B);
    vector<ll> div;
    for(ll i=2;i<=sqrt(mx);i++)
    {
        if(A%i==0 && B%i==0) 
        {
            div.push_back(i);
        }
        //cout << i << endl;
        if(mx%i==0)
        {
            ll other=mx/i;
            if(i!=other)
            {
                if(A%other==0 && B%other==0) div.push_back(other);
            }
        }
    }
    if(A%mini==0 && B%mini==0) div.push_back(mini);
    sort(div.begin(),div.end());
    /*for(int i=0;i<int(div.size());i++)
    {
        cout << div[i] << endl;
    }*/
    set<ll> NG;
    for(int i=0;i<int(div.size());i++)
    {
        auto it=NG.find(div[i]);
        if(it!=NG.end()) continue;
        ans++;
        for(int j=i+1;j<int(div.size());j++)
        {
            if(div[j]%div[i]==0)
            {
                NG.insert(div[j]);
            }
        }
    }
    cout << ans+1 << endl;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | z#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'z' does not name a type
    1 | z#include<bits/stdc++.h>
      | ^
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int,int> pii;
      |         ^~~~
a.cc:18:1: error: 'vector' does not name a type
   18 | vector<ll> divisor(ll n)
      | ^~~~~~
a.cc:31:1: error: 'map' does not name a type
   31 | map<ll,ll> prime_factor(ll n)
      | ^~~
a.cc: In function 'int main()':
a.cc:65:5: error: 'cin' was not declared in this scope
   65 |     cin >> A >> B;
      |     ^~~
a.cc:66:11: error: 'max' was not declared in this scope; did you mean 'mx'?
   66 |     ll mx=max(A,B);
      |           ^~~
      |           mx
a.cc:67:13: error: 'min' was not declared in this scope; did you mean 'mini'?
   67 |     ll mini=min(A,B);
      |             ^~~
      |             mini
a.cc:68:5: error: 'vector' was not declared in this scope
   68 |     vector<ll> div;
      |     ^~~~~~
a.cc:68:14: error: expected primary-expression before '>' token
   68 |     vector<ll> div;
      |              ^
a.cc:68:16: error: 'div' was not declared in this scope
   68 |     vector<ll> div;
      |                ^~~
a.cc:69:19: error: 'sqrt' was not declared in this scope
   69 |     for(ll i=2;i<=sqrt(mx);i++)
      |                   ^~~~
a.cc:86:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   86 |     sort(div.begin(),div.end());
      |     ^~~~
      |     short
a.cc:91:5: error: 'set' was not declared in this scope
   91 |     set<ll> NG;
      |     ^~~
a.cc:91:11: error: expected primary-expression before '>' token
   91 |     set<ll> NG;
      |           ^
a.cc:91:13: error: 'NG' was not declared in this scope
   91 |     set<ll> NG;
      |             ^~
a.cc:105:5: error: 'cout' was not declared in this scope
  105 |     cout << ans+1 << endl;
      |     ^~~~
a.cc:105:22: error: 'endl' was not declared in this scope
  105 |     cout << ans+1 << endl;
      |                      ^~~~