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

#include<bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
// gcd lcm
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
void Eratosthenes(ll n,vll &arr,ll &cu){
	for(int i = 0; i < N; i++){
		arr[i] = 1;
	}
	for(int i = 2; i < sqrt(N); i++){
		if(arr[i]){
			for(int j = 0; i * (j + 2) < N; j++){
				arr[i *(j + 2)] = 0;
			}
		}
	}

	for(int i = 2; i < N; i++){
		if(arr[i]){
			cu++;
		}
	}
}
int main(){
  ll a,b;
  cin>>a>>b;
  ll n=gcd(a,b)+1;
  vll arr(n);
  ll cu=0;
  Eratosthenes(n,arr,cu);
  cu++;
  ll ans=cu*(cu-1)/2;
  COUT(ans);
}

Compiler output:
a.cc: In function 'void Eratosthenes(long long int, vll&, long long int&)':
a.cc:40:28: error: 'N' was not declared in this scope
   40 |         for(int i = 0; i < N; i++){
      |                            ^
a.cc:43:33: error: 'N' was not declared in this scope
   43 |         for(int i = 2; i < sqrt(N); i++){
      |                                 ^
a.cc:51:28: error: 'N' was not declared in this scope
   51 |         for(int i = 2; i < N; i++){
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(ii, ss, ee) for(ll ii = (ss); ii <= (ll)(ee); ++ii)
#define DEC(ii, ss, ee) for(ll ii = (ss); ii >=d (ll)(ee); --ii)
#define VALS(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define pf push_front
#define INF 1234567890ll
#define PI (acos((ld)-1.0))
#define ll long long int 
#define ld long double
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
typedef pair <int, int> pi;
typedef pair <ll, ll> pl;
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9 + 7;
 
bool isprime(ll x) {
    if (x < 2) return true; 
    else if (x == 2) return true; 
    else if (x % 2 == 0) return false; 
    for (int i = 3; i <= x/i; i+=2) { 
        if (x % i == 0) return false; 
    }
    return true; 
}
 
ll gcd(ll a, ll b) {
	if (b == 0) return a;
    return gcd(b, a%b);
}
 
int main()
{
	IAMSPEED
	ll a, b; cin >> a >> b;
	ll x = gcd(a, b);
	ll ans = 0;
	FOR(i, 1, sqrt(x)+1) {
		if ((x % i == 0) && (gcd(i,x/i) != 1) {
			++ans;
		}
	}
	cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:54: error: expected ')' before '{' token
   51 |                 if ((x % i == 0) && (gcd(i,x/i) != 1) {
      |                    ~                                 ^~
      |                                                      )
a.cc:54:9: error: expected primary-expression before '}' token
   54 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod = 1e9+7;
const int mx = 710000;

int temp[(ll)1e12+1];

ll gcd(ll x, ll y){
	if(x%y == 0)return y;
	else return gcd(y, x%y);
}
bool isPrime(int x){
	if(temp[x] != 0)return temp[x];
	for(int i = 2; i * i < x + 1; i++){
		if(x % i == 0){
			temp[x] = 1;
			return false;
		}
	}
	temp[x] = 2;
	return true;
}

ll a,b;
int main(){
	cin >> a >> b;
	ll max_divisor = gcd(a,b);
	vector<ll> ans;
	for(int i = 1; i <  max_divisor + 1; i++){
		if(max_divisor % i == 0){
			if(isPrime(i) or i == 1)ans.push_back(i);
		}
	}
	// cout << isPrime(4) << endl;
	// for(int i = 0; i < ans.size(); i++)cout << ans[i] << endl;
	cout << ans.size() << endl;
}

Compiler output:
/tmp/ccKA24yT.o: in function `main':
a.cc:(.text+0xf9): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccKA24yT.o
a.cc:(.text+0x115): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccKA24yT.o
a.cc:(.text+0x127): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccKA24yT.o
a.cc:(.text+0x12e): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccKA24yT.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

#define rep(i, a, n)  for(ll i=a; i<n; i++)
#define per(i, a, n)  for(ll i=n-1; i>=a; i--)
#define fill0(n)  setfill('0') << right << setw(n)
#define all(x)  (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define LONGMAX 1e18
#define INTMAX 1000000000
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod = 1e9+7;
const int mx = 710000;

int prime[(ll)1e12+1];

ll gcd(ll x, ll y){
	if(x%y == 0)return y;
	else return gcd(y, x%y);
}
bool isPrime(int x){
	if(prime[x] != 0)return prime[x];
	for(int i = 2; i * i < x + 1; i++){
		if(x % i == 0){
			prime[x] = 1;
			return false;
		}
	}
	prime[x] = 2;
	return true;
}

ll a,b;
int main(){
	cin >> a >> b;
	ll max_divisor = gcd(a,b);
	vector<ll> ans;
	for(int i = 1; i <  max_divisor + 1; i++){
		if(max_divisor % i == 0){
			if(isPrime(i) or i == 1)ans.push_back(i);
		}
	}
	// cout << isPrime(4) << endl;
	// for(int i = 0; i < ans.size(); i++)cout << ans[i] << endl;
	cout << ans.size() << endl;
}

Compiler output:
/tmp/ccqgPKyf.o: in function `main':
a.cc:(.text+0xf9): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccqgPKyf.o
a.cc:(.text+0x115): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccqgPKyf.o
a.cc:(.text+0x127): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccqgPKyf.o
a.cc:(.text+0x12e): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccqgPKyf.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
using namespace std;
using ll = long long;

ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    ll r = a % b;
    while (r != 0) {
        a = b; b = r; r = a % b;
    }
    return b;
}

ll cnt(ll n)
{
    ll rtn = 0;
    for (ll i = 2; i <= sqrt(n); i += (i > 2) + 1)
    {
        if (n % i == 0)
        {
            while (n % i == 0)n /= i;
            rtn++;
        }
    }
    if (n > 1)rtn++;
    return rtn;
}

int main() {
    ll a, b;
    cin >> a >> b;
    if (a < b)swap(a, b);
    ll g = gcd(a, b);
    cout << cnt(g) + 1 << endl;
}

Compiler output:
a.cc: In function 'll cnt(ll)':
a.cc:17:25: error: 'sqrt' was not declared in this scope
   17 |     for (ll i = 2; i <= sqrt(n); i += (i > 2) + 1)
      |                         ^~~~
Language: C++

#include <iostream>#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

int64_t gcd(int64_t a, int64_t b){
    if (b == 0) return a;
    return gcd(b, a % b);
}

int64_t num_prime_factor(int64_t x){
    map<int64_t, int> prime_factor;
    prime_factor[1]++;
    bool flag = true;
    
    while(flag){
        int64_t up_bnd = int64_t(sqrt(x));
        bool flag2 = false;
        for (int a = 2; a <= up_bnd; a++) {
            if (x % a == 0) {
                flag2 = true;
                while (x % a == 0) {
                    x /= a;
                    prime_factor[a]++;
                }
                break;
            }
        }
        if (!flag2) {
            prime_factor[x]++;
            flag = false;
        }
    }
    return prime_factor.size();
}

int main(int argc, const char * argv[]) {

    ios::sync_with_stdio(false);
    cin.tie(0);

    int64_t a, b; cin >> a >> b;
    cout << num_prime_factor(gcd(a, b)) << endl;

    return 0;
}

#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

int64_t gcd(int64_t a, int64_t b){
    if (b == 0) return a;
    return gcd(b, a % b);
}

int64_t num_prime_factor(int64_t x){
    if (x == 1) return 1;
    int64_t cnt = 1;
    bool flag = true;
    while(flag){
        int64_t up_bnd = int64_t(sqrt(x));
        bool flag2 = false;
        for (int a = 2; a <= up_bnd; a++) {
            if (x % a == 0) {
                flag2 = true;
                cnt++;
                while (x % a == 0) x /= a;
                break;
            }
        }
        if (!flag2) {
            cnt++;
            flag = false;
        }
    }
    
    return cnt;
}

int main(int argc, const char * argv[]) {

    ios::sync_with_stdio(false);
    cin.tie(0);

    int64_t a, b; cin >> a >> b;
    cout << num_prime_factor(gcd(a, b)) << endl;

    return 0;
}


Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <iostream>#include <iostream>
      |                    ^
a.cc:68:9: error: redefinition of 'int64_t gcd(int64_t, int64_t)'
   68 | int64_t gcd(int64_t a, int64_t b){
      |         ^~~
a.cc:14:9: note: 'int64_t gcd(int64_t, int64_t)' previously defined here
   14 | int64_t gcd(int64_t a, int64_t b){
      |         ^~~
a.cc:73:9: error: redefinition of 'int64_t num_prime_factor(int64_t)'
   73 | int64_t num_prime_factor(int64_t x){
      |         ^~~~~~~~~~~~~~~~
a.cc:19:9: note: 'int64_t num_prime_factor(int64_t)' previously defined here
   19 | int64_t num_prime_factor(int64_t x){
      |         ^~~~~~~~~~~~~~~~
a.cc:97:5: error: redefinition of 'int main(int, const char**)'
   97 | int main(int argc, const char * argv[]) {
      |     ^~~~
a.cc:45:5: note: 'int main(int, const char**)' previously defined here
   45 | int main(int argc, const char * argv[]) {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	long long a, b;
	cin>>a>>b;
	long long g = __gcd(a, b);
	long long res = 1;
	long long m = n;
	for (long long i = 2; i * i <= m; i++)
		if (n % i == 0) {
			res++;
			while (n % i == 0)
				n /= i; 
		}
	res += (n > 1);
	cout<<res;	
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'n' was not declared in this scope
   11 |         long long m = n;
      |                       ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include <cmath>
#include <limits>
#include<set>

using namespace std;
#define int long  long int
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

signed main()
{
	int A, B;
	cin >> A >> B;
	int g = gcd(A, B);
	set<int>s;
	for (int i = 2; i <= g; i++) 
	{
		while (g % i == 0) 
		{ 
			s.insert(i);
			g /= i;
		}
	}
	cout << s.size() + 1;


Compiler output:
a.cc: In function 'int main()':
a.cc:31:30: error: expected '}' at end of input
   31 |         cout << s.size() + 1;
      |                              ^
a.cc:18:1: note: to match this '{'
   18 | {
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>

typedef long long ll;
using namespace std;
const int mod = 1000000007;

int divisor(int n, int k, int c);
vector<int> erastones(int n);
int gcd(int a, int b);

vector<int> isprime(1000001, 1);

int main() {

    int A, B; cin >> A >> B;

    int c = gcd(A, B);

//    cout << c << '\n';
    erastones();

    int ans = divisor(A, B, c);

    cout << ans << '\n';

}

int gcd(int a, int b) {

    while (b) {
        int tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}


int divisor(int n, int k,int c) {
    
    int ans = 1;
    for (int i = 2; i <= c; i++) {
        if (isprime[i]) {
            if ((n % i == 0) && (k % i == 0))
                ans++;
        }
    }

    return ans;

}

vector<int> erastones() {
    // 0 と 1 を消す
    int n = 1000000;
    isprime[0] = isprime[1] = 0;
    // i を残して i の倍数を消していく
    for (int i = 2; i*i < n+1; i++) {
        if (isprime[i]) {
            int j = i + i;
            while (j <= n) {
                isprime[j] = 0;
                j += i;
            }
        }
    }
}



Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: too few arguments to function 'std::vector<int> erastones(int)'
   29 |     erastones();
      |     ~~~~~~~~~^~
a.cc:17:13: note: declared here
   17 | vector<int> erastones(int n);
      |             ^~~~~~~~~
a.cc: In function 'std::vector<int> erastones()':
a.cc:76:1: warning: no return statement in function returning non-void [-Wreturn-type]
   76 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>

typedef long long ll;
using namespace std;
const int mod = 1000000007;

int divisor(int n, int k, int c);
vector<int> erastones(int n);
int gcd(int a, int b);

vector<int> isprime(1000001, 1);

int main() {

    int A, B; cin >> A >> B;

    int c = gcd(A, B);

//    cout << c << '\n';
    erastones();

    int ans = divisor(A, B, c);

    cout << ans << '\n';

}

int gcd(int a, int b) {

    while (b) {
        int tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}


int divisor(int n, int k,int c) {
    
    int ans = 1;
    for (int i = 2; i <= c; i++) {
        if (isprime[i]) {
            if ((n % i == 0) && (k % i == 0))
                ans++;
        }
    }

    return ans;

}

vector<int> erastones() {
    // 0 と 1 を消す
n = 1000000;
    isprime[0] = isprime[1] = 0;
    // i を残して i の倍数を消していく
    for (int i = 2; i*i < n+1; i++) {
        if (isprime[i]) {
            int j = i + i;
            while (j <= n) {
                isprime[j] = 0;
                j += i;
            }
        }
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: too few arguments to function 'std::vector<int> erastones(int)'
   29 |     erastones();
      |     ~~~~~~~~~^~
a.cc:17:13: note: declared here
   17 | vector<int> erastones(int n);
      |             ^~~~~~~~~
a.cc: In function 'std::vector<int> erastones()':
a.cc:64:1: error: 'n' was not declared in this scope; did you mean 'yn'?
   64 | n = 1000000;
      | ^
      | yn
a.cc:76:1: warning: no return statement in function returning non-void [-Wreturn-type]
   76 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>

typedef long long ll;
using namespace std;
const int mod = 1000000007;

int divisor(int n, int k, int c);
void erastones();
int gcd(int a, int b);

vector<int> isprime(1000001, 1);

int main() {

    int A, B; cin >> A >> B;

    int c = gcd(A, B);

//    cout << c << '\n';
    erastones();

    int ans = divisor(A, B, c);

    cout << ans << '\n';

}

int gcd(int a, int b) {

    while (b) {
        int tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}


int divisor(int n, int k,int c) {
    
    int ans = 1;
    for (int i = 2; i <= c; i++) {
        if (isprime[i]) {
            if ((n % i == 0) && (k % i == 0))
                ans++;
        }
    }

    return ans;

}

void erastones() {
    // 0 と 1 を消す
    n = 1000000;
    isprime[0] = isprime[1] = 0;
    // i を残して i の倍数を消していく
    for (int i = 2; i*i < n+1; i++) {
        if (isprime[i]) {
            int j = i + i;
            while (j <= n) {
                isprime[j] = 0;
                j += i;
            }
        }
    }
    return isprime;
}


Compiler output:
a.cc: In function 'void erastones()':
a.cc:64:5: error: 'n' was not declared in this scope; did you mean 'yn'?
   64 |     n = 1000000;
      |     ^
      |     yn
a.cc:76:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   76 |     return isprime;
      |            ^~~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>

typedef long long ll;
using namespace std;
const int mod = 1000000007;

int divisor(int n, int k, int c);
vector<int> erastones(int n);
int gcd(int a, int b);

vector<int> isprime(1000001, 1);

int main() {

    int A, B; cin >> A >> B;

    int c = gcd(A, B);

//    cout << c << '\n';
    erastones();

    int ans = divisor(A, B, c);

    cout << ans << '\n';

}

int gcd(int a, int b) {

    while (b) {
        int tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}


int divisor(int n, int k,int c) {
    
    int ans = 1;
    for (int i = 2; i <= c; i++) {
        if (isprime[i]) {
            if ((n % i == 0) && (k % i == 0))
                ans++;
        }
    }

    return ans;

}

vector<int> erastones() {
    // 0 と 1 を消す
n = 1000000;
    isprime[0] = isprime[1] = 0;
    // i を残して i の倍数を消していく
    for (int i = 2; i*i < n+1; i++) {
        if (isprime[i]) {
            int j = i + i;
            while (j <= n) {
                isprime[j] = 0;
                j += i;
            }
        }
    }
    return isprime;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:14: error: too few arguments to function 'std::vector<int> erastones(int)'
   29 |     erastones();
      |     ~~~~~~~~~^~
a.cc:17:13: note: declared here
   17 | vector<int> erastones(int n);
      |             ^~~~~~~~~
a.cc: In function 'std::vector<int> erastones()':
a.cc:64:1: error: 'n' was not declared in this scope; did you mean 'yn'?
   64 | n = 1000000;
      | ^
      | yn
Language: C++

#include <bits/stdc++.h>
#define int long long
using namespace std;

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

map<int, int> prime_factor(int n) {
  map<int, int> res;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        res[i]++;
        n /= i;
      }
    }
  }
  if (n != 1)
    res[n] = 1;
  return res;
}

signed main() {
  int A, B
  cin >> A >> B;

  int C = gcd(A, B);

  map<int, int> mp = prime_factor(C);

  cout << mp.size() + 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: expected initializer before 'cin'
   24 |   cin >> A >> B;
      |   ^~~
a.cc:26:18: error: 'B' was not declared in this scope
   26 |   int C = gcd(A, B);
      |                  ^
Language: C++

#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
typedef long long ll;
using namespace std;
ll gcd(ll a,ll b){
    ll r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}
int main(void){
    ll a, b; cin >> a >> b;
    ll g = __algo_gcd(a,b);int cnt = 0;
    for (int i = 2; i*i <= g; i++) {
        if(g%i==0) cnt++;
        while (g%i == 0) {
            g /= i;
        }
    }if(g>1) cnt++;
    cout << cnt+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: '__algo_gcd' was not declared in this scope
   17 |     ll g = __algo_gcd(a,b);int cnt = 0;
      |            ^~~~~~~~~~
Language: C++

#include <iostream>
#include <math.h>
typedef long long ll;
using namespace std;

int main(void){
    ll a, b; cin >> a >> b;
    ll g = __gcd(a,b);int cnt = 0;
    for (int i = 2; i*i <= g; i++) {
        if(g%i==0) cnt++;
        while (g%i == 0) {
            g /= i;
        }
    }if(g>1) cnt++;
    cout << cnt+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: '__gcd' was not declared in this scope
    8 |     ll g = __gcd(a,b);int cnt = 0;
      |            ^~~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<algorithm>
#include<concurrent_priority_queue.h>
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;

vector<pair<int, int>> fac(ll n) {
	vector<pair<int, int>> res;
	for (ll i = 2;i * i <= n;i++) {
		if (n % i != 0)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1) {
		res.emplace_back(n, 1);
	}
	return res;
}

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

int main() {
	ll a, b;
	cin >> a >> b;
	ll g = gcd(a, b);
	auto f = fac(g);
	ll ans = f.size() + 1;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc:5:9: fatal error: concurrent_priority_queue.h: No such file or directory
    5 | #include<concurrent_priority_queue.h>
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
int gcd(int a,int b){
  if(a<b)
    swap(a,b);
  while(1){
    if(a%b==0)
      return b;
    int c=a%b;
    a=b;
    b=c;
    }
  }
signed main(){
  int A,B;
  cin>>A>>B;
  int G=gcd(A,B);
  bitset<1000000> A;
  int ans=1;
  if(G!=1){
    while(1){
      if(G%2==0){
        G/=2;
        A.set(1);
        }
      else
        break;
      }
    int i=3;
    while(i*i<=G){
      if(G%i==0){
        G/=i;
        A.set(i-1);
        }
      else
        i+=2;
      }
    ans+=A.count();
    if(ans==1)
      ans++;
    }
  cout<<ans<<endl;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: conflicting declaration 'std::bitset<1000000> A'
   29 |   bitset<1000000> A;
      |                   ^
a.cc:26:7: note: previous declaration as 'long long int A'
   26 |   int A,B;
      |       ^
a.cc:35:11: error: request for member 'set' in 'A', which is of non-class type 'long long int'
   35 |         A.set(1);
      |           ^~~
a.cc:44:11: error: request for member 'set' in 'A', which is of non-class type 'long long int'
   44 |         A.set(i-1);
      |           ^~~
a.cc:49:12: error: request for member 'count' in 'A', which is of non-class type 'long long int'
   49 |     ans+=A.count();
      |            ^~~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;


int main()
{
    ll A, B, gcd;
    cin >> A >> B;
    ll tmpA = A, tmpB = B;

    A = max(tmpA, tmpB);
    B = min(tmpA, tmpB);

    while (B != 0) {
        tmpA = A;
        A = B;
        B = tmpA % B;
    }
    gcd = A;

    vector<ll> prime(1, 0);
    ll rep_max = sqrt(gcd);
    for (ll i = 2; i <= rep_max; i++) {
        ll count = 0;
        
        while (gcd % i == 0) {
            count++;
            gcd /= i;
        }

        if (count > 0) {
            prime.push_back(count);
        }

        if ((gcd == 1)) {
            break;
        }
    }
    if (gcd != 1) {
        prime.push_back(1);
    }

    cout << prime.size() << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:18: error: 'sqrt' was not declared in this scope
   26 |     ll rep_max = sqrt(gcd);
      |                  ^~~~
Language: C++

#include "bits/stdc++.h"
#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;

struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;
template <class X> map<X,int> prime_factorize(X a){
    int b = 2;
    map<X,int>cnt;
    if(a == 1) return 0;
    while(a >= b * b){
        if(a % b == 0){
            cnt[b]++;
            a /= b;
        }else b++;
    }
    cnt[a]++;
    return cnt;
}
template<class X> X gcd(X a, X b) {return b ? gcd(b,a%b):a;}
int main() {
    ull A, B;
    cin >> A >> B;
    cout << prime_factorize(gcd(A, B)).size() + 1 << endl;
}

Compiler output:
a.cc: In instantiation of 'std::map<X, int> prime_factorize(X) [with X = long long unsigned int]':
a.cc:35:28:   required from here
   35 |     cout << prime_factorize(gcd(A, B)).size() + 1 << endl;
      |             ~~~~~~~~~~~~~~~^~~~~~~~~~~
a.cc:21:23: error: could not convert '0' from 'int' to 'std::map<long long unsigned int, int, std::less<long long unsigned int>, std::allocator<std::pair<const long long unsigned int, int> > >'
   21 |     if(a == 1) return 0;
      |                       ^
      |                       |
      |                       int
Language: C++

#include <bits/stdc++.h>
using namespace std;
long long a, b;

long long gcd(long long a, long long b) {
    long long r = a % b;

    while(r > 0) {
        a = b;
        b = r;
        r = a % b;
    }

    return b;
}

int main() {
    cin >> a >> b;
    if(a > b) swap(a, b);
    long long g = gcd(a, b);
    cout << g << endl;

    /*vector<int> ans;
    for(int i = 1; i*i <= g; ++i) {
        if(g % i == 0) {
            int p = g / i;
            if(p == i) {
                ans.push_back(i);
            }else {
                ans.push_back(i);
                ans.push_back(p);
            }
        }
    }

    int cnt = 0;
    int anslen = ans.size();
    for(int i = 0; i < anslen; ++i) {
        // cout << ans.at(i) << " ";
        bool flg = true;
        for(int j = 2; j*j <= ans.at(i); ++j) {
            if(ans.at(i) % j == 0) {
                flg = false;
                break;
            }
        }
        // cout << flg << endl;
        if(flg) cnt++;
    }*/

    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   51 |     cout << cnt << endl;
      |             ^~~
      |             int
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

typedef Long Long ll;

ll gcd(ll a, ll y) { return y ? gcd(y, x%y) : x;}

vector<pair<ll, int>> factorize(ll n) {
    vector<pair<ll, int>> res;
    for(ll i = 2; i*i <= n; i++) {
        if(n%i) continue;
        res.emplace_back(i, 0);
        while(n%i == 0) {
            n /= i;
            res.back().second++;
        }
    }
    if(n != 1) res.emplace_back(n, 1);
    return res;
}
int main() {
    ll a, b;
    cin >> a >> b;
    ll g = gcd(a, b);
    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;

    return 0;

}
/*
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

ll gcd(ll x, ll y) { return y ? gcd(y,x%y) : x;}

vector<pair<ll,int>> factorize(ll n) {
  vector<pair<ll,int>> res;
  for (ll i = 2; i*i <= n; ++i) {
    if (n%i) continue;
    res.emplace_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1) res.emplace_back(n,1);
  return res;
}

int main() {
  ll a, b;
  cin >> a >> b;
  ll g = gcd(a,b);
  auto f = factorize(g);
  int ans = f.size() + 1;
  cout << ans << endl;
  return 0;
}
*/


Compiler output:
a.cc:5:9: error: 'Long' does not name a type; did you mean 'long'?
    5 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc:7:1: error: 'll' does not name a type
    7 | ll gcd(ll a, ll y) { return y ? gcd(y, x%y) : x;}
      | ^~
a.cc:9:13: error: 'll' was not declared in this scope
    9 | vector<pair<ll, int>> factorize(ll n) {
      |             ^~
a.cc:9:17: error: template argument 1 is invalid
    9 | vector<pair<ll, int>> factorize(ll n) {
      |                 ^~~
a.cc:9:20: error: template argument 1 is invalid
    9 | vector<pair<ll, int>> factorize(ll n) {
      |                    ^~
a.cc:9:20: error: template argument 2 is invalid
a.cc:9:33: error: 'll' was not declared in this scope
    9 | vector<pair<ll, int>> factorize(ll n) {
      |                                 ^~
a.cc: In function 'int main()':
a.cc:23:5: error: 'll' was not declared in this scope
   23 |     ll a, b;
      |     ^~
a.cc:24:12: error: 'a' was not declared in this scope
   24 |     cin >> a >> b;
      |            ^
a.cc:24:17: error: 'b' was not declared in this scope
   24 |     cin >> a >> b;
      |                 ^
a.cc:25:7: error: expected ';' before 'g'
   25 |     ll g = gcd(a, b);
      |       ^~
      |       ;
a.cc:26:24: error: 'g' was not declared in this scope
   26 |     auto f = factorize(g);
      |                        ^
a.cc:26:25: error: 'factorize' cannot be used as a function
   26 |     auto f = factorize(g);
      |                         ^
Language: C++

#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

typedef Long Long ll;

ll gcd(ll a, ll y) { y ? gcd(y, x%y) : x;}

vector<pair<ll, int>> factorize(ll n) {
    vector<pair<ll, int>> res;
    for(ll i = 2; i*i <= n; i++) {
        if(n%i) continue;
        res.emplace_back(i, 0);
        while(n%i == 0) {
            n /= i;
            res.back().second++;
        }
    }
    if(n != 1) res.emplace_back(n, 1);
    return res;
}
int main() {
    ll a, b;
    cin >> a >> b;
    ll g = gcd(a, b);
    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;

    return 0;

}


Compiler output:
a.cc:5:9: error: 'Long' does not name a type; did you mean 'long'?
    5 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc:7:1: error: 'll' does not name a type
    7 | ll gcd(ll a, ll y) { y ? gcd(y, x%y) : x;}
      | ^~
a.cc:9:13: error: 'll' was not declared in this scope
    9 | vector<pair<ll, int>> factorize(ll n) {
      |             ^~
a.cc:9:17: error: template argument 1 is invalid
    9 | vector<pair<ll, int>> factorize(ll n) {
      |                 ^~~
a.cc:9:20: error: template argument 1 is invalid
    9 | vector<pair<ll, int>> factorize(ll n) {
      |                    ^~
a.cc:9:20: error: template argument 2 is invalid
a.cc:9:33: error: 'll' was not declared in this scope
    9 | vector<pair<ll, int>> factorize(ll n) {
      |                                 ^~
a.cc: In function 'int main()':
a.cc:23:5: error: 'll' was not declared in this scope
   23 |     ll a, b;
      |     ^~
a.cc:24:12: error: 'a' was not declared in this scope
   24 |     cin >> a >> b;
      |            ^
a.cc:24:17: error: 'b' was not declared in this scope
   24 |     cin >> a >> b;
      |                 ^
a.cc:25:7: error: expected ';' before 'g'
   25 |     ll g = gcd(a, b);
      |       ^~
      |       ;
a.cc:26:24: error: 'g' was not declared in this scope
   26 |     auto f = factorize(g);
      |                        ^
a.cc:26:25: error: 'factorize' cannot be used as a function
   26 |     auto f = factorize(g);
      |                         ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
using namespace std;

int Prime(int x) {
    int ans = 0;
    for(int i = 1; i <= x; i++) {
        if(x%i == 0) {
            ans++;
        }
    }
    return ans;
}

int gcd(int a, int b) {
    if(b == 0) return a;
    else return gcd(b, a%b);
}

int main() {
    int c, d;
    cin >> c >> d;
    int ans = 1;
    if(c > d) {
        int gcd = gcd(c, d);
        for(int i = 1; i <= gcd; i++) {
            if(Prime(i) == 2) {
                ans++;
            }
        }
    } else {
        int gcd = gcd(d, c);
        for(int i = 1; i <= gcd; i++) {
            if(Prime(i) == 2) {
                ans++;
            }
        }
    }


    cout << ans << endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:22: error: 'gcd' cannot be used as a function
   26 |         int gcd = gcd(c, d);
      |                   ~~~^~~~~~
a.cc:33:22: error: 'gcd' cannot be used as a function
   33 |         int gcd = gcd(d, c);
      |                   ~~~^~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

vector<pair<int,int>> fac(ll x){
  vector<pair<int,int>> res;
  for(ll i=2;i*i<=n;i++){
    if(x%i)continue;
    res.emplace_back(i,0);
    while(x%i==0){
      x /= i;
      res.back().second++;
    }
  }
  if(n!=1)res.emplace_back(n,1);
  return res;
}

ll gcd(ll x, ll y) { return y ? gcd(y,x%y) : x;}
 
int main(){
  ll a,b;
  cin >> a >> b;
  ll g = gcd(a,b);
  auto f = fac(g);
  ll ans = f.size()+1;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'std::vector<std::pair<int, int> > fac(ll)':
a.cc:8:19: error: 'n' was not declared in this scope
    8 |   for(ll i=2;i*i<=n;i++){
      |                   ^
a.cc:16:6: error: 'n' was not declared in this scope
   16 |   if(n!=1)res.emplace_back(n,1);
      |      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
long t;
int main(){
	ll a, b;
	cin>>a>>b;
	ll c=__gcd(a,b);
	ll t = 1;
	for(int i=2;i*i<=c;i++){
		if(c%i==0){
			t++;
			while(c%i==0)c/=i;
		}
	}
	if(c!=1)t++;
	cout<<t;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'll' was not declared in this scope
    5 |         ll a, b;
      |         ^~
a.cc:6:14: error: 'a' was not declared in this scope
    6 |         cin>>a>>b;
      |              ^
a.cc:6:17: error: 'b' was not declared in this scope
    6 |         cin>>a>>b;
      |                 ^
a.cc:7:11: error: expected ';' before 'c'
    7 |         ll c=__gcd(a,b);
      |           ^~
      |           ;
a.cc:8:11: error: expected ';' before 't'
    8 |         ll t = 1;
      |           ^~
      |           ;
a.cc:9:26: error: 'c' was not declared in this scope
    9 |         for(int i=2;i*i<=c;i++){
      |                          ^
a.cc:15:12: error: 'c' was not declared in this scope
   15 |         if(c!=1)t++;
      |            ^
Language: C

#include <bits/stdc++.h>
using namespace std;

int gozyo(int A,int B){
  int C;
  while(A%B!=0){
    C=A;
    A=B;
    if(C%B==0){
      break;
    }
    B=C%B;
   
  }
  return B;
}

int prime(int N){
  if(N==2){
    return 1;
  }
  for(int i=2;i<N;i++){
    if(N%i==0){
      return 0;
      break;
    }
  }
  return 1;
}

int count(int N){
  if(N==1){
    return 1;
  }
  int c=1;
  for(int i=2;i<=N;i++){
    if(prime(i)==0){
      continue;
    }
    if(N%i==0){
      c++;
    }
  }
  return c;
}
  

int main(){
  unsigned int A,B;
  cin >> A >> B;
  if(A>B){
    int ans=gozyo(A,B);
    cout << count(ans) << endl;
  }else if(A<B){
    int ans=gozyo(B,A);
    cout << count(ans) << endl;
  }else{
    cout << count(A) << endl;
  }
  return 0;
}

Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll MOD = 1e9 + 7;
const int INF = 100100100;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define debug(x) cerr << #x << ": " << x << endl

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main(){
  ll A, B; cin >> A >> B;
  ll num = (ll)sqrt((float)max(A, B)) + 10;
  ll res = 1;
  for(int i=2; i*i < max(A, B), i++){
    if(IsPrime(i) && (A % i == 0) && (B % i == 0)){
      res++;
    } 
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:36: error: expected ';' before ')' token
   34 |   for(int i=2; i*i < max(A, B), i++){
      |                                    ^
      |                                    ;
Language: C++

#include<iostream>
using namespace std;

int64 gcd(int64 a,int64 b)
{
    if(b==0) return a;
   return gcd(b,a%b);
}


int main()
{
 int64 a,b;
  cin>>a>>b;  
  int64 g=gcd(a,b);
  
  int res=1;
  for(int64 i=2;i*i<=g;i++)
  {  
        if(g%i==0)
        {
             while(g%i==0)
                 g/=i; 
          res++;
        }
  }
    if(g>1)
      res++;
  
  cout<<res<<endl;
  return 0;
  
}

Compiler output:
a.cc:4:1: error: 'int64' does not name a type; did you mean 'int64_t'?
    4 | int64 gcd(int64 a,int64 b)
      | ^~~~~
      | int64_t
a.cc: In function 'int main()':
a.cc:13:2: error: 'int64' was not declared in this scope; did you mean 'int64_t'?
   13 |  int64 a,b;
      |  ^~~~~
      |  int64_t
a.cc:14:8: error: 'a' was not declared in this scope
   14 |   cin>>a>>b;
      |        ^
a.cc:14:11: error: 'b' was not declared in this scope
   14 |   cin>>a>>b;
      |           ^
a.cc:15:8: error: expected ';' before 'g'
   15 |   int64 g=gcd(a,b);
      |        ^~
      |        ;
a.cc:18:12: error: expected ';' before 'i'
   18 |   for(int64 i=2;i*i<=g;i++)
      |            ^~
      |            ;
a.cc:18:17: error: 'i' was not declared in this scope
   18 |   for(int64 i=2;i*i<=g;i++)
      |                 ^
a.cc:18:22: error: 'g' was not declared in this scope
   18 |   for(int64 i=2;i*i<=g;i++)
      |                      ^
a.cc:27:8: error: 'g' was not declared in this scope
   27 |     if(g>1)
      |        ^
Language: C++

#include <iostream>
#include<vector>
#include<algorithm>
#include <queue>
#include <string>
#include <set>
#include <bitset>
#include<iomanip>

using namespace std;
#define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
#define i64 int64_t
#define tos(x) to_string(x)

int main() {
	int n, m;
	cin >> n >> m;
	set<int> a1;
	ff(i, 2, sqrt(n) + 1) {
		if (n % i == 0) {
			if (m % i == 0) {
				a1.insert(i);
			}
		}
	}
	cout << a1.size() + 1 << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: 'sqrt' was not declared in this scope
   19 |         ff(i, 2, sqrt(n) + 1) {
      |                  ^~~~
a.cc:11:39: note: in definition of macro 'ff'
   11 | #define ff(ii,nn,mm) for(int ii=nn;ii<mm;ii++)
      |                                       ^~
Language: Java

#include<iostream>
#include<algorithm>
using namespace std;
int vis[1000005];
void solve()
{
    vis[1] = 0;
    vis[2] = 0;
    for(int i = 2;i <= 1000000;i++)
    {
        if(vis[i] == 0)
        {
            int t = 2;
            for(int j = t * i;j <= 1000000;j = t * i)
            {
                vis[j] = 1;
                t++;
            }
        }
    }
}
int main()
{
    long long a,b;
    solve();
    cin >> a >> b;
    int cnt = 1;
    for(int i = 2;i <= 1000000;i++)
    {
        if(a % i == 0 && b % i == 0 && vis[i] == 0)
        {
            //cout << i << endl;
            cnt++;
            if(i >= a / 2 || i >= b / 2)
                break;
        }
    }
    cout << cnt << endl;
    return 0;
}


Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:2: error: illegal character: '#'
#include<algorithm>
^
Main.java:4: error: class, interface, enum, or record expected
int vis[1000005];
^
Main.java:5: error: unnamed classes are a preview feature and are disabled by default.
void solve()
^
  (use --enable-preview to enable unnamed classes)
Main.java:24: error: not a statement
    long long a,b;
    ^
Main.java:26: error: not a statement
    cin >> a >> b;
             ^
Main.java:38: error: not a statement
    cout << cnt << endl;
                ^
Main.java:24: error: ';' expected
    long long a,b;
        ^
8 errors
Language: C

#include <bits/stdc++.h>
using namespace std;

int gcd(int64_t a, int64_t b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

int main() {
  int64_t A,B,gc;
  int64_t cnt = 1;
  cin >> A >> B;
  if(A >= B) gc = gcd(A,B);
  if(A < B) gc = gcd(B,A);
  int tmp=gc;
  for(int i=2;i*i < gc;i++){

    if(tmp % i == 0){
      cnt++;
      while(tmp%i==0){
        tmp /= i;
      }
    }
  }
  if(tmp != 1) cnt++;
  
  cout << cnt <<endl;
}


Compiler output:
main.c:1:10: fatal error: bits/stdc++.h: No such file or directory
    1 | #include <bits/stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

typedef long long ll;


ll gcd(ll x, ll y) {
	return y == 0 ? x : gcd(y, x % y);
}

int main() {
	ll a, b; cin >> a >> b;
	ll maxNum = gcd(a, b);

	vector<ll> ans;
	for (int i = 2; i*i <= maxNum; i++) {
		if (maxNum % i)continue;
		while (maxNum % i == 0) {
			maxNum /= i;	
		}
		ans.push_back(i);		
	}
	if (maxNum != 1)ans.push_back(maxNum);
	cout << ans.size()+1 << endl;
	
	return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:28:18: error: expected '}' at end of input
   28 |         return 0;
      |                  ^
a.cc:13:12: note: to match this '{'
   13 | int main() {
      |            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 10;
bool prime[N + 7];
vector <long long> primes;
int main() {
    memset(prime, 1, sizeof(prime));
    prime[0] = prime[1] = 0;
    for ( int i = 4; i < N; i += 2 ) prime[i] = 0;
    for ( int i = 3; i * i < N; i += 2 ) {
        if ( prime[i] ) {
            for ( int j = i * i; j < N; j += i + i ) {
                prime[j] = 0;
            }
        }
    }
    primes.push_back(2);
    for( int i = 3; i < N; i += 2 ) if( prime[i] ) primes.push_back(i);
    long long a, b;
    cin >> a >> b;
    set <long long> p;

    for ( int i = 0; i < primes.size(); ++i ) {
        if ( a <= 1 ) break;
        if ( a % primes[i] == 0 ) {
            p.insert(primes[i]);
            mp[primes[i]] += 1;
            while( a % primes[i] == 0 ) {
                a /= primes[i];
            }
        }
    }
    if ( a > 1 ) mp[a] += 1;
    for ( int i = 0; i < primes.size(); ++i ) {
        if ( b <= 1 ) break;
        if ( b % primes[i] == 0 ) {
            p.insert(primes[i]);
            mp[primes[i]] += 1;
            while ( b % primes[i] == 0 ) {
                b /= primes[i];
            }
        }
    }
    if ( b > 1 ) mp[b] += 1;
    int cnt = 0;
    for ( auto it : p ) {
        if (mp[it] == 2) ++cnt;
    }
    cout << cnt + 1 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'mp' was not declared in this scope; did you mean 'p'?
   27 |             mp[primes[i]] += 1;
      |             ^~
      |             p
a.cc:33:18: error: 'mp' was not declared in this scope; did you mean 'p'?
   33 |     if ( a > 1 ) mp[a] += 1;
      |                  ^~
      |                  p
a.cc:38:13: error: 'mp' was not declared in this scope; did you mean 'p'?
   38 |             mp[primes[i]] += 1;
      |             ^~
      |             p
a.cc:44:18: error: 'mp' was not declared in this scope; did you mean 'p'?
   44 |     if ( b > 1 ) mp[b] += 1;
      |                  ^~
      |                  p
a.cc:47:13: error: 'mp' was not declared in this scope; did you mean 'p'?
   47 |         if (mp[it] == 2) ++cnt;
      |             ^~
      |             p
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n) ;++i)
using namespace std;
typedef long long ll;

//Nを素因数分解して配列に素因数を保存していく。ただし因数は割り切れた順に配列に追加される。
void divToEle(ll N, vector<ll> &v) {
  int rN = ceil(sqrt(N));
  bool isDividable = true;

  while(isDividable) {
    isDividable = false;  
    for(ll i=2; i<rN; ++i) {
      if(N%i == 0) {
        N = N/i;
        v.push_back(i);
        isDividable = true;
      }
    }
  }
}

//二つの配列の共通の要素の種類数をカウントする
int countCommonEle(vector<ll> vec1, vector<ll> vec2) {
  vector<ll> nVec(1, 1);

  for(ll x : vec1) {
    for(ll i=0; i<vec2.size(); ++i) {
      if(x == vec2[i]) {
        nVec.push_back(x);
      }
    }
  }

  ll count = 0;
  sort(nVec.begin(), nVec.end());  

  for(ll i = 1; i<nVec.size(); ++i) {
    if(nVec[i] != nVec[i-1]) {
      count++;
    }
  }

  return (count+1);
}

int main() {

  ll A;
  ll B;
  cin >> A;
  cin >> B;
  vector<int> eleOfA;
  vector<int> eleOfB;


  //素因数分解
  divToEle(A, eleOfA);
  divToEle(B, eleOfB);

  ll ans = countCommonEle(eleOfA, eleOfB);
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:58:15: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>'
   58 |   divToEle(A, eleOfA);
      |               ^~~~~~
a.cc:7:33: note: in passing argument 2 of 'void divToEle(ll, std::vector<long long int>&)'
    7 | void divToEle(ll N, vector<ll> &v) {
      |                     ~~~~~~~~~~~~^
a.cc:59:15: error: invalid initialization of reference of type 'std::vector<long long int>&' from expression of type 'std::vector<int>'
   59 |   divToEle(B, eleOfB);
      |               ^~~~~~
a.cc:7:33: note: in passing argument 2 of 'void divToEle(ll, std::vector<long long int>&)'
    7 | void divToEle(ll N, vector<ll> &v) {
      |                     ~~~~~~~~~~~~^
a.cc:61:27: error: could not convert 'eleOfA' from 'vector<int>' to 'vector<long long int>'
   61 |   ll ans = countCommonEle(eleOfA, eleOfB);
      |                           ^~~~~~
      |                           |
      |                           vector<int>
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int gcd(int, int);
bool prime(int);

int main() {
	int a, b;
	cin >> a >> b;

	int gcd_ab = gcd(a, b);

	int count = 1;
	for (int i = 2; i <= gcd_ab; ++i) {
		if (a % i == 0 && b % i == 0 && prime(i)) {
			++count;
		}
	}

	cout << count;
}

int gcd(int a, int b) {
	return a == 0 ? b : gcd(b % a, a);
}

bool prime(int n) {
	int s = sqrt(n);
	for (int i = 2; i <= s; ++i) {
		if (n % i == 0) {
			return false;
		}
	}

	return true;
}


Compiler output:
a.cc: In function 'bool prime(int)':
a.cc:29:17: error: 'sqrt' was not declared in this scope
   29 |         int s = sqrt(n);
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

long long gcd(long a, long b){
    if(a < b){
        swap(a, b);
    }
    while(a%b != 0){
        long long temp = a;
        a = b;
        b = temp%b;
    }
    return b;
}

int main(){
    long long a, b, g, count = 1;
    cin >> a >> b;
    g = gcd(a, b);
    for(d=2; d<g; d++){
        if(g%d == 0) count++;
        while(g%d == 0) g /= d;
    }
    cout << count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'd' was not declared in this scope
   20 |     for(d=2; d<g; d++){
      |         ^
Language: C++

#include <iostream>
#include <string>
#include<vector>
#include<algorithm>

using namespace std;
int main()
{
	int n,k,a;
	cin >> n;
	cin >> k;
	double aa = min(n, k);
	a =int(sqrt(aa));
	//vector<int> xn(a + 1);

	//for (int i = 0; i < n; i++) {
	//	cin >> a[i];
	//}
	int s=1;
	for (int i = 2; i < a + 1; i++) {
		int x=0, y=0;
		while (n % i == 0 || k % i==0) {
			if (n % i == 0) {
				x++;
				n = n / i;
			}
			if (k % i == 0) {
				y++;
				k = k / i;
			}
			}
		if (x > 0 && y > 0) {
			s++;
		}
	}

	if (k > 1 && n > 1) {
		if (k % n == 0 || n% k == 0) {
			s++;
		}
	}
	
	cout << s;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: 'sqrt' was not declared in this scope
   13 |         a =int(sqrt(aa));
      |                ^~~~