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

#include <iostream>
#include <cmath>

using namespace std;

long long int min(long long int a, long long int b) {
    if (a < b)
        return a;
    else
        return b;
}

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

    long long int min_num = min(A, B);
    int count = 1
    bool in_if_check = false
    for (long int i = 2; i <= sqrt(min_num); i++) {
        bool flag = false;
        if (A % i == 0) {
            flag = true;
            while (A % i == 0)
                A = A / i;
        }

        if (B % i == 0) {
            if (flag)
                count++;
            while (B % i == 0)
                B = B / i;
        }
    }
    if ((A != 1 && B != 1) && (A % B == 0 || B % A == 0))
        count++;

    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'bool'
   19 |     bool in_if_check = false
      |     ^~~~
a.cc:20:26: error: 'i' was not declared in this scope
   20 |     for (long int i = 2; i <= sqrt(min_num); i++) {
      |                          ^
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

long long int min(long long int a, long long int b) {
    if (a < b)
        return a;
    else
        return b;
}

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

    long long int min_num = min(A, B);
    int count = 1
    bool in_if_check = false
    for (long int i = 2; i <= sqrt(min_num); i++) {
        bool flag = false;
        if (A % i == 0) {
            flag = true;
            while (A % i == 0)
                A = A / i;
        }

        if (B % i == 0) {
            if (flag)
                count++;
            while (B % i == 0)
                B = B / i;
        }
    }
    if ((A != 1 && B != 1) && (A % B == 0 || B % A == 0))
        count++

    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:5: error: expected ',' or ';' before 'bool'
   19 |     bool in_if_check = false
      |     ^~~~
a.cc:20:26: error: 'i' was not declared in this scope
   20 |     for (long int i = 2; i <= sqrt(min_num); i++) {
      |                          ^
a.cc:36:16: error: expected ';' before 'cout'
   36 |         count++
      |                ^
      |                ;
   37 | 
   38 |     cout << count << endl;
      |     ~~~~
Language: C++

{
        if(a % i == 0 && b % i == 0)
        {
            memo.push_back(i);
            ll temp1 = a / i;
            ll temp2 = b / i;
            if(temp1 != i && b % temp1 == 0) memo.push_back(temp1);
            if(temp2 != i && a % temp2 == 0) memo.push_back(temp2);
        }
    }
    sort(memo.begin(), memo.end());
    int count = 1;
    for(int i = 1; i < memo.size(); i++)
    {
        if(memo[i - 1] != memo[i] && isPrime(memo[i])) count++;
    }
    cout << count << endl;
}

Compiler output:
a.cc:1:1: error: expected unqualified-id before '{' token
    1 | {
      | ^
a.cc:11:9: error: expected constructor, destructor, or type conversion before '(' token
   11 |     sort(memo.begin(), memo.end());
      |         ^
a.cc:13:5: error: expected unqualified-id before 'for'
   13 |     for(int i = 1; i < memo.size(); i++)
      |     ^~~
a.cc:13:20: error: 'i' does not name a type
   13 |     for(int i = 1; i < memo.size(); i++)
      |                    ^
a.cc:13:37: error: 'i' does not name a type
   13 |     for(int i = 1; i < memo.size(); i++)
      |                                     ^
a.cc:17:5: error: 'cout' does not name a type
   17 |     cout << count << endl;
      |     ^~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

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

ll gcd(ll a,ll b){
  ll r;
  while ((r=a%b)){a=b;b=r;}
  return b;
}

bool isDevided(ll a, ll b){
  if (a/b==(long double)a/b){return true;}
  else {return false;}
}

int main(){

  ll a,b; cin >> a >> b;
  ll g = gcd(a,b);
  ll k=2;
  ll ans=0;
  while (g!=1 k<=100000000){
    int isP=0;
    while (isDevided(g,k)){
      g/=k;
      isP=1;
    }
    if (isP) {ans++;}
    isP=0;
    k++;
  }

  if (k<=99999999){
    cout << ans+1;
  } else {
    cout << 2;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: expected ')' before 'k'
   30 |   while (g!=1 k<=100000000){
      |         ~    ^~
      |              )
a.cc:30:27: error: expected ';' before ')' token
   30 |   while (g!=1 k<=100000000){
      |                           ^
      |                           ;
Language: C

#include<stdio.h>
#include<math.h>
int nextprime(int p);
int main()
{
    long long a,b,tmp;
    int div=3;
    int div_max;
    scanf("%lld %lld",&a,&b);
    int count=1;
    if(a>b)
    {
        tmp=a;
        a=b;
        b=tmp;
    }
    div_max=(int)sqrt(a);
    if(a%2==0&&b%2==0)
    {
        count++;
        a/=2;
    }
    while(a>=div)
    {   
        if(div>div_max)break;
        if(a%div==0&&b%div==0)
        {
            count++;
            a/=div;
        }
        div=nextprime(div);
    }
    if(b%a==0)count++:
    printf("%d",count);
    return 0;
}
  int nextprime(int p)
  { 
      int count=1;
      while (count!=0)
      {
          p+=2;
          count=0;
          int div=3;
          while (div<=sqrt(p))
          {
              if(p%div==0){
                  count=1;
                  break;
              }
              div+=2;
          }
      }
      return p;
  }

Compiler output:
main.c: In function 'main':
main.c:33:22: error: expected ';' before ':' token
   33 |     if(b%a==0)count++:
      |                      ^
      |                      ;
Language: C

#include<stdio.h>
#include<math.h>
int nextprime(int p);
int main()
{
    long long a,b,tmp;
    int div=3;
    int div_max;
    scanf("%lld %lld",&a,&b);
    int count=1;
    if(a>b)
    {
        tmp=a;
        a=b;
        b=tmp;
    }
    div_max=(int)sqrt(a);
    if(a%2==0&&b%2==0)
    {
        count++;
        a/=2;
    }
    while(a>=div)
    {   
        if(div>div_max)break;
        if(a%div==0&&b%div==0)
        {
            count++;
            a/=div;
        }
        div=nextprime(div);
    }
    if(b%%a==0)count++:
    printf("%d",count);
    return 0;
}
  int nextprime(int p)
  { 
      int count=1;
      while (count!=0)
      {
          p+=2;
          count=0;
          int div=3;
          while (div<=sqrt(p))
          {
              if(p%div==0){
                  count=1;
                  break;
              }
              div+=2;
          }
      }
      return p;
  }

Compiler output:
main.c: In function 'main':
main.c:33:10: error: expected expression before '%' token
   33 |     if(b%%a==0)count++:
      |          ^
main.c:33:23: error: expected ';' before ':' token
   33 |     if(b%%a==0)count++:
      |                       ^
      |                       ;
Language: C++

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

typedef long long ll;

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

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

#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string.h>
#include <cassert>
#include <string.h>
#include <tuple>

using namespace std;
#define  rep(i,n) for(int i=0;i<n;i++)
#define  rrep(i,n) for(int i=n-1;i>=0;i--)///n-1番目からn回
#define  REP(i,a,b) for(int i=a;i<=b;i++) ///a番目からb回
#define  RREP(i,a,b) for(int i=a;i<b;i--)
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pair_t;
#define MOD 1000000007

//int arr[N]
////sort(arr,arr +N)

//vector <int> hoge
////sort(hoge.begin(),hoge.end());
///*min_element(hoge.begin(),hoge.end();　最小値　　　最大値はmax_element();
///(10-(n%10))%10  10-(1桁目)取得 12->8 20->0

#define Ru(n)  ( ((n)+9)/10*10  ) //切りあげ
#define Rd(n)  ( ((n)-10)/10*10 +10 )	切り捨て


ll gcd(int a,int b);
size_t length(const std::string& str) {
	return str.length();
}
bool comp(const pair_t &a, const pair_t &b) {
	return a.first < b.first;
}

int main() {
	ll  a,b,GCD,ans=0;
	cin>>a>>b;
	GCD=gcd(a,b);
	if(GCD==1){
		cout<<1;
		return 0;
	}
	double stop=sqrt(GCD);
	for(int i=1;i<=stop+1;i++){
		if(GCD%i==0){
			ans++;
			while(GCD%i==0 && i!=1)
				GCD/=i;
		}

	}
	if(ans==1)
		ans++;


	cout<<ans<<endl;

	return 0;

}


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


Compiler output:
/usr/bin/ld: /tmp/cc1Tydc3.o: in function `main':
a.cc:(.text+0x80): undefined reference to `gcd(int, int)'
collect2: error: ld returned 1 exit status
Language: C++

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

bool p[1000010]; 
long long a,b;
int main()
{
	
	cin>>a>>b;
	int ans=0;
	bool p1(int x);
	for(long long i=1;i<=sqrt(min(a,b));i++)
	{
		if(a%i==0&&b%i==0)
		{
			if(p1(i))
			{
				ans++;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

bool p1(long long x)
{
	if(x<1)
	{
		return false;
	}
	if(x==1)
	{
		return true;
	}
	if(p[x]==true)
	{
		cout<<x<<endl; 
		return false;
	}
	for(long long i=2;i*i<=x;i++)
	{
		if(x%i==0)
		{
			return false;
		}
	}
	long long j=2;
	for(long long i=x;i<min(a,b);i*=j,j++)
	{
		p[i]=true;
	}
	return true;
}

Compiler output:
/usr/bin/ld: /tmp/cchS2RuZ.o: in function `main':
a.cc:(.text+0x78): undefined reference to `p1(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include<bits/stdc++.h>
#define append push_back
#define endl "\n"
#define N 9000000
#define M 1000000007
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long int
#define cover(arr,val) memset(arr,val,sizeof(arr)) 
using namespace std;
vector<ll>prime;
void sieve();
ll solve(ll g);
ll gcd(ll x,ll y);

int main()
{
	IOS;
	/*sieve();*/
	ll x,y;
	cin >> x >> y;
	ll g;
	g = gcd(x,y);
	
	printf("%lld\n",1+solve(g));
	return 0;
}
ll gcd(ll x,ll y)
{
	ll p = max(x,y);
	y = min(x,y);
	x = p;
	while(y>0)
	{
		p = x%y;
		x = y;
		y = p;
	}
	return x;
}
ll solve(ll x)
{
	int i=0;
	int count =0;
	for(int i=2;i<sqrt(k);i++)
	{
		if(x%i==0)
		{	
			while(x%i==0)
				x=x/i;
			count++;
		}
	}
  	if(2<x)
      count++;
	return count;
}
/*void sieve()
{
	bool arr[N];
	memset(arr,true,sizeof(arr));
	for(int i=2;i<N;i++)
	{
		if(arr[i])
		{
			for(int j=2;i*j<N;j++)
				arr[i*j]=false;
		}
	}
	for(int i=2;i<N;i++)
	{
		if(arr[i])
			prime.append(i);
	}
}
*/


Compiler output:
a.cc: In function 'long long int solve(long long int)':
a.cc:44:28: error: 'k' was not declared in this scope
   44 |         for(int i=2;i<sqrt(k);i++)
      |                            ^
Language: C++

#include<bits/stdc++.h>
#define append push_back
#define endl "\n"
#define N 9000000
#define M 1000000007
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL)
#define ll long long int
#define cover(arr,val) memset(arr,val,sizeof(arr)) 
using namespace std;
vector<ll>prime;
void sieve();
ll solve(ll g);
ll gcd(ll x,ll y);

int main()
{
	IOS;
	/*sieve();*/
	ll x,y;
	cin >> x >> y;
	ll g;
	g = gcd(x,y);
	
	printf("%lld\n",1+solve(g));
	return 0;
}
ll gcd(ll x,ll y)
{
	ll p = max(x,y);
	y = min(x,y);
	x = p;
	while(y>0)
	{
		p = x%y;
		x = y;
		y = p;
	}
	return x;
}
ll solve(ll x)
{
	int i=0;
	int count =0;
	for(int i=2;i<sqrt(k);i++)
	{
		if(x%i==0)
		{	
			while(x%i==0)
				x=x/i;
			count++;
		}
	}
  	if(k>2)
      count++;
	return count;
}
/*void sieve()
{
	bool arr[N];
	memset(arr,true,sizeof(arr));
	for(int i=2;i<N;i++)
	{
		if(arr[i])
		{
			for(int j=2;i*j<N;j++)
				arr[i*j]=false;
		}
	}
	for(int i=2;i<N;i++)
	{
		if(arr[i])
			prime.append(i);
	}
}
*/


Compiler output:
a.cc: In function 'long long int solve(long long int)':
a.cc:44:28: error: 'k' was not declared in this scope
   44 |         for(int i=2;i<sqrt(k);i++)
      |                            ^
a.cc:53:12: error: 'k' was not declared in this scope
   53 |         if(k>2)
      |            ^
Language: C++

#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v)   (v).begin(),(v).end()
#define INF      (int)1e9
#define MOD      ((int)1e9+7)
using namespace std;
typedef long long     llong;
typedef pair<int,int> pii;
typedef vector<int>   vi;
typedef vector<vi >   vvi;
typedef vector<vvi >  vvvi;
template<class Type> void join(const Type &a){for(auto elem:a)cout<<elem<<' ';cout<<endl;}

int main(){
	llong a,b;
	cin>>a>>b;
	
	llong n=__gcd(a,b);
	llong cnt=0;
	for(llong i=2;i*i<=n;++i){
		if(n%i){}
		else{
			cnt++;
			whille(n%i==0) n/=i;
		}
	}
	if(n!=1) cnt++;
	
	cout<<cnt+1<<endl;
}//reply to exp.

Compiler output:
a.cc: In function 'int main()':
a.cc:24:25: error: 'whille' was not declared in this scope
   24 |                         whille(n%i==0) n/=i;
      |                         ^~~~~~
Language: C++

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

ll gcd(ll m, ll n) {
	if (n == 0) return abs(m);

	return gcd(n, m%n);
}

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

	ll ans = 1;
	ll G = gcd(a, b);
	
	for (ll i = 2; i < sqrt(max(a,b)); ++i) {
		if (G % i == 0) {
			ans++;
			while (G%i == 0) G /= i;
		}
		if (G == 1) break;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:28: error: 'sqrt' was not declared in this scope
   26 |         for (ll i = 2; i < sqrt(max(a,b)); ++i) {
      |                            ^~~~
Language: C++

#include <iostream>

using namespace std;
long long a,b,nr,i,j,m,k,div[100001],m1,d;

int main()
{
    cin>>a>>b;
    m=min(a,b);
    m1=max(a,b);
    d=2;
    div[++k]=1;
    while(d*d<=m&&m!=1)
    {
        int p=0;
        while(m%d==0)
            m/=d,p++;
        if(p)div[++k]=d;
        d++;
    }
    if(m!=1)div[++k]=m;
    for(i=1;i<=k;i++)
        if(m1%div[i]==0)nr++;
        cout<<nr;
    return 0;
}


Compiler output:
a.cc:4:36: error: 'long long int div [100001]' redeclared as different kind of entity
    4 | long long a,b,nr,i,j,m,k,div[100001],m1,d;
      |                                    ^
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: previous declaration 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc: In function 'int main()':
a.cc:12:8: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   12 |     div[++k]=1;
      |        ^
a.cc:18:17: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   18 |         if(p)div[++k]=d;
      |                 ^
a.cc:21:16: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   21 |     if(m!=1)div[++k]=m;
      |                ^
a.cc:23:18: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript
   23 |         if(m1%div[i]==0)nr++;
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n for(int i=0; i<(n); ++i))
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(){
	int a, b;
	cin >> a >> b;
	ll g = gcd(a, b);
	auto f = factorize(g);
	ans = f.size() + 1;
	cont << ans << endl;
	return 0;
}



Compiler output:
a.cc:3:18: error: expected ',' or ')', found "for"
    3 | #define rep(i, n for(int i=0; i<(n); ++i))
      |                  ^~~
a.cc:4:9: error: 'Long' does not name a type; did you mean 'long'?
    4 | typedef Long Long ll;
      |         ^~~~
      |         long
a.cc:5:1: error: 'll' does not name a type
    5 | ll gcd(ll x, ll y){return y? gcd(y, x%y) : x;}
      | ^~
a.cc:7:13: error: 'll' was not declared in this scope
    7 | vector<pair<ll, int>>factorize(ll n){
      |             ^~
a.cc:7:17: error: template argument 1 is invalid
    7 | vector<pair<ll, int>>factorize(ll n){
      |                 ^~~
a.cc:7:20: error: template argument 1 is invalid
    7 | vector<pair<ll, int>>factorize(ll n){
      |                    ^~
a.cc:7:20: error: template argument 2 is invalid
a.cc:7:32: error: 'll' was not declared in this scope
    7 | vector<pair<ll, int>>factorize(ll n){
      |                                ^~
Language: C++

#include <bits/stds++.h>
using namespace std;
#define rep(i, n for(int i=0; i<(n); ++i))
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(){
	int a, b;
	cin >> a >> b;
	ll g = gcd(a, b);
	auto f = factorize(g);
	ans = f.size() + 1;
	cont << ans << endl;
	return 0;
}



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

#include <iostream>
using namespace std;

unsigned long long gcd(unsigned long long a,unsigned long long b){
    if (a < b)
        return euclidean_gcd(b, a);
    unsigned long long r;
    while ((r = a % b))
    {
        a = b;
        b = r;
    }
    return b;
}

int main(){
    unsigned long long a, b;
    cin >> a >> b;
    
    unsigned long long tmp;
    if(a < b){
        tmp = gcd(b, a);
    }
    else
    {
        tmp = gcd(a, b);
    }
    unsigned long long cut = 2;
    int cnt = 1;
    while(tmp >= 2 * cut){
        if(tmp % cut == 0){
            cnt++;
        }
        cut++;
    }
    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'long long unsigned int gcd(long long unsigned int, long long unsigned int)':
a.cc:6:16: error: 'euclidean_gcd' was not declared in this scope
    6 |         return euclidean_gcd(b, a);
      |                ^~~~~~~~~~~~~
Language: Java

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {

			long a = sc.nextLong();
			long b = sc.nextLong();
			
			long gcd = gcd2(a, b);

			Map<Long, Integer> factors = new HashMap<>();

			// iterate 2 to GCD
			List<Long> numberList = new ArrayList<>();
			for(long i = 2 ; i <= gcd ; i++ ) {
				numberList.add(i);
			}
			
			while(numberList.size() > 0 ) {
				long p = numberList.remove(0);
				
				if ( gcd % p == 0 ) {
					factors.put(p, 1);
					//remove from numberList
					
					long val = p;
					while ( val <= gcd ) {
						numberList.remove(val);
						val = val * 2;
					}
				}
			}

			System.out.println(factors.size() + 1);
		}
	}
	
	public static long gcd2(long a, long b) {
		long vala = a, valb = b;
		while ( vala != valb ) {
			if ( vala > valb) {
				vala = vala - valb;
			}
			else {
				valb = valb - vala;
			}
		}
		return vala;
	}

Compiler output:
Main.java:54: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final long A = scan.nextLong();
		final long B = scan.nextLong();
		scan.close();

		// AとBを素因数分解する
		ArrayList<Long> primeFactorsA = primeFactorization(A);
		ArrayList<Long> primeFactorsB = primeFactorization(B);

		// 素因数の共通項を求める
		long result = countCommonTerm(primeFactorsA,primeFactorsB) + 1;
		System.out.println(result);

	}

	// 素因数分解をするメソッド・改
	private static ArrayList<Long> primeFactorization(Long n){
		ArrayList<Long> primeFactors = new ArrayList<Long>();
		long m = n;
		long d = 0;
		while(n > 1) {
			m--;
			if(n % m == 0) {
				d = n / m;
				primeFactors.add(d);
				n /= d;
				while(n % d == 0) {
					n /= d;
				}
				m = n;
			}
		}
		return primeFactors;
	}

	// 共通項の個数を求めるメソッド
	private static long countCommonTerm(ArrayList<Long> a, ArrayList<Long> b) {
		int result = 0;
		int size = 0;

		if(a.size() > b.size()) {
			size = a.size();
			HashSet<Long> bHashSet = new HashSet<Long>(b);
			for(int i = 0; i < size; i++) {
				if(bHashSet.contains(a.get(i))) {
					result++;
				}
			}
		}else {
			size = b.size();
			HashSet<Long> aHashSet = new HashSet<Long>(b);
			for(int i = 0; i < size; i++) {
				if(aHashSet.contains(a.get(i))) {
					result++;
				}
			}
		}
		return result;
	}

}


Compiler output:
Main.java:5: error: class D is public, should be declared in a file named D.java
public class D {
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Scanner;

public class D {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final long A = scan.nextLong();
		final long B = scan.nextLong();
		scan.close();

		// AとBを素因数分解する
		ArrayList<Long> primeFactorsA = primeFactorization(A);
		ArrayList<Long> primeFactorsB = primeFactorization(B);

		// 素因数の共通項を求める
		long result = countCommonTerm(primeFactorsA,primeFactorsB) + 1;
		System.out.println(result);

	}

	// 素因数分解をするメソッド・改
	private static ArrayList<Long> primeFactorization(Long n){
		ArrayList<Long> primeFactors = new ArrayList<Long>();
		long m = n;
		long d = 0;
		while(n > 1) {
			m--;
			if(n % m == 0) {
				d = n / m;
				primeFactors.add(d);
				n /= d;
				while(n % d == 0) {
					n /= d;
				}
				m = n;
			}
		}
		return primeFactors;
	}

	// 共通項の個数を求めるメソッド
	private static long countCommonTerm(ArrayList<Long> a, ArrayList<Long> b) {
		int result = 0;
		int size = 0;
		if(a.size() > b.size()) {
			size = a.size();
			for(int i = 0; i < size; i++) {
				if(b.contains(a.get(i))) {
					result++;
				}
			}
		}else {
			size = b.size();
			for(int i = 0; i < size; i++) {
				if(b.contains(a.get(i))) {
					result++;
				}
			}
		}
		return result;
	}

}


Compiler output:
Main.java:4: error: class D is public, should be declared in a file named D.java
public class D {
       ^
1 error
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		final long A = scan.nextLong();
		final long B = scan.nextLong();
		scan.close();

		// AとBを素因数分解する
		LinkedList<Long> primeFactorsA = primeFactorization(A);
		LinkedList<Long> primeFactorsB = primeFactorization(B);

		// 素因数の共通項を求める
		long result = countCommonTerm(primeFactorsA,primeFactorsB) + 1;
		System.out.println(result);

	}

	// 素因数分解をするメソッド・改
	private static LinkedList<Long> primeFactorization(Long n){
		LinkedList<Long> primeFactors = new LinkedList<Long>();
		long m = n;
		long d = 0;
		while(n != 1) {
			m--;
			if(n % m == 0) {
				d = n / m;
				primeFactors.add(d);
				n /= d;
				while(n % d == 0) {
					n /= d;
				}
				m = n;
			}
		}
		return primeFactors;
	}

	// 共通項の個数を求めるメソッド
	private static long countCommonTerm(LinkedList<Long> a, LinkedList<Long> b) {
		int result = 0;
		int size = 0;
		if(a.size() > b.size()) {
			size = a.size();
			for(int i = 0; i < size; i++) {
				if(b.contains(a.get(i))) {
					result++;
				}
			}
		}else {
			size = b.size();
			for(int i = 0; i < size; i++) {
				if(b.contains(a.get(i))) {
					result++;
				}
			}
		}
		return result;
	}

}


Compiler output:
Main.java:20: error: cannot find symbol
	private static LinkedList<Long> primeFactorization(Long n){
	               ^
  symbol:   class LinkedList
  location: class Main
Main.java:40: error: cannot find symbol
	private static long countCommonTerm(LinkedList<Long> a, LinkedList<Long> b) {
	                                    ^
  symbol:   class LinkedList
  location: class Main
Main.java:40: error: cannot find symbol
	private static long countCommonTerm(LinkedList<Long> a, LinkedList<Long> b) {
	                                                        ^
  symbol:   class LinkedList
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
		LinkedList<Long> primeFactorsA = primeFactorization(A);
		^
  symbol:   class LinkedList
  location: class Main
Main.java:11: error: cannot find symbol
		LinkedList<Long> primeFactorsB = primeFactorization(B);
		^
  symbol:   class LinkedList
  location: class Main
Main.java:21: error: cannot find symbol
		LinkedList<Long> primeFactors = new LinkedList<Long>();
		^
  symbol:   class LinkedList
  location: class Main
Main.java:21: error: cannot find symbol
		LinkedList<Long> primeFactors = new LinkedList<Long>();
		                                    ^
  symbol:   class LinkedList
  location: class Main
9 errors
Language: C++

//#include "stdafx.h"
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

/*----------------------------------------------------------------------------- 
	定義
-------------------------------------------------------------------------------*/
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define INF			2e9
#define MOD			1e9+7
#define MIN(a, b)	((a) < (b) ? a : b)
#define MAX(a, b)	((a) > (b) ? a : b)

typedef long long int QWORD;
typedef long long int ll;

/*-----------------------------------------------------------------------------
	処理
-------------------------------------------------------------------------------*/
bool IsPrime(QWORD num)
{
	if (num <= 2) return true;

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

	// 素数である
	return true;
}


QWORD gcd(QWORD a, QWORD b)
{
	QWORD r;

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


int main()
{
	QWORD A;
	QWORD B;

	// 最大公約数
	cin >> A;
	cin >> B;

#if 0
	QWORD maxYakusu;
	vector<QWORD>	yakusuA;
	vector<QWORD>	yakusuB;
	
	maxYakusu = sqrt(A);
	for (QWORD i = 1; i <= maxYakusu; i++) {
		if ((A % i) == 0) {
			if (IsPrime(i)) {
				yakusuA.push_back(i);
			}
			if (IsPrime(A / i)) {
				if (i != (A / i)) {
					yakusuA.push_back(A / i);
				}
			}
		}
	}
	reverse(yakusuA.begin(), yakusuA.end());

	maxYakusu = sqrt(B);
	for (QWORD i = 1; i <= maxYakusu; i++) {
		if ((B % i) == 0) {
			if (IsPrime(i)) {
				yakusuB.push_back(i);
			}
			if (IsPrime(B / i)) {
				if (i != (B / i)) {
					yakusuB.push_back(B / i);
				}
			}
		}
	}
	reverse(yakusuB.begin(), yakusuB.end());

	QWORD cnt = 0;
	QWORD nextPos = 0;
	for (QWORD i = 0; i < yakusuA.size(); i++) {
		QWORD	yakusuOne = yakusuA[i];
		for (QWORD j = nextPos; j < yakusuB.size(); j++) {
			if (yakusuOne < yakusuB[j]) {
				// continue
			} else if (yakusuOne == yakusuB[j]) {
				nextPos = j + 1;
				cnt++;
				break;
			} else {
				nextPos = j;
				break;
			}
		}
	}

#else
	QWORD maxYaksuu = gcd(A, B);

	// 素数をカウント
	int iCnt = 1;
	QWORD sqrtNum = sqrt(maxYaksuu);
	for (int i = 2; i <= sqrtNum; i++) {
		if ((maxYaksuu % i) == 0) {
			if (IsPrime(i)) {
				iCnt++;
			}
			if (i != (maxYaksuu / i)) {
				if (IsPrime((maxYaksuu / i))) {
					iCnt++;
				}
			}
		}
	}
#endif

	cout << cnt;
	return 0;
}



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

//#include "stdafx.h"
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

/*----------------------------------------------------------------------------- 
	定義
-------------------------------------------------------------------------------*/
#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define INF			2e9
#define MOD			1e9+7
#define MIN(a, b)	((a) < (b) ? a : b)
#define MAX(a, b)	((a) > (b) ? a : b)

typedef long long int QWORD;
typedef long long int ll;

/*-----------------------------------------------------------------------------
	処理
-------------------------------------------------------------------------------*/
bool IsPrime(QWORD num)
{
	if (num <= 2) return true;

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

	// 素数である
	return true;
}


QWORD gcd(QWORD a, QWORD b)
{
	QWORD r;

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


int main()
{
	QWORD A;
	QWORD B;
	cin >> A;
	cin >> B;

	// 最大公約数
	QWORD maxYaksuu = gcd(A, B);

	// 素数をカウント
	int iCnt = 1;
	QWORD sqrtNum = sqrt(maxYaksuu);
	REPN(i, 2, sqrtNum) {
	for (int i = 2; i <= sqrtNum; i++) {
		if ((maxYaksuu % i) == 0) {
			if (IsPrime(i)) {
				iCnt++;
			}
			if (IsPrime((maxYaksuu / i))) {
				iCnt++;
			}
		}
	}

	cout << iCnt;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:86:2: error: expected '}' at end of input
   86 | }
      |  ^
a.cc:60:1: note: to match this '{'
   60 | {
      | ^
Language: C++

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

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

int main(){
  ll A, B;
  cin >> A >> B;
  
  ll c, j = 0, d, count = 1;
  vector<ll> list;
  c = Greatest_common_divisor(A, B);
  d = c;
  for (ll i = 2; i < sqrt(d); i++){
    if(c%i == 0){
      count++;
      list.push_down(i);
    }
  }
  cout << count << endl;
  /*
  d = sqrt(c);
  for (int i = 1; i <= d; i++){
    if(c%i == 0){
      list.push_back(i);
    }
  }
  j = list.size();
  for (int i = j - 1; i >= 0; i--){
    if(c != list[i]*list[i]){
      list.push_back(c/list[i]);
    }
  }
  
  j = list.size();
  
  for (ll i = 0; i < j; i++){
    cout << list[i] <<  endl;
  }
  */
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:12: error: 'class std::vector<long long int>' has no member named 'push_down'
   26 |       list.push_down(i);
      |            ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define debug(x) cout << #x << " = " << (x) << endl;
#define pb push_back
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000000000
#define EPS 0.00000000001
typedef long long ll;

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

    
}


#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define debug(x) cout << #x << " = " << (x) << endl;
#define pb push_back
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000000000
#define EPS 0.00000000001
typedef long long ll;

ll gcd(ll a, ll b) // 最大公約数
{
    while (b != 0)
    {
        a %= b;
        swap(a, b);
    }
    return a;
}

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

    ll a, b;
    cin >> a >> b;
    ll n = max(a, b);
    n = sqrt(n)+1;
    vector<ll> x(1);
    x[0] = 1;
    for (ll i = 2; i <= n; i++)
    {
        if (a % i == 0 && b % i == 0)
        {
            int z = x.size();
            int dame = 0;
            for (int j = 0; j < z; j++)
            {
                if (gcd(i, x[j]) > 1)
                {
                    dame++;
                }
            }
            if (dame == 0)
            {
                x.pb(i);
                //cout<<i<<endl;
            }
        }
    }
    cout << x.size() << endl;
}


Compiler output:
a.cc:50:5: error: redefinition of 'int main()'
   50 | int main()
      |     ^~~~
a.cc:15:5: note: 'int main()' previously defined here
   15 | int main()
      |     ^~~~
Language: C++

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

using namespace std;

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

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

	// 素数である
	return true;
}


long long int gcd(long long int a, long long int b)
{
	long long int r;

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


int main()
{
	long long int A;
	long long int B;
	cin >> A;
	cin >> B;
	
	long long int maxYaksuu = gcd(A, B);

	int iCnt = 0;
	for (int i = 1; i < maxYaksuu; i++) {
		if ((maxYaksuu % i) == 0) {
			if (IsPrime(i)) {
				iCnt++;
			}
		}
	}

	cout << iCnt;
	return 0;
}


Compiler output:
a.cc: In function 'bool IsPrime(long long int)':
a.cc:13:26: error: 'sqrt' was not declared in this scope
   13 |         double sqrtNum = sqrt(num);
      |                          ^~~~
Language: C++

#include "stdc++.h"
#include <unordered_set>
using namespace std;
 
unordered_set<long long> sarvesh;
unordered_set<long long> sarvesh2;
unordered_set<long long> sarvesh3;
 
void primeFactors(long long n, unordered_set<long long> &s)
{
s.insert(1);
  while (n%2==0){
    s.insert(2);
    n /= 2;
  }
  for (long long i = 3; i <= sqrt(n); i+= 2){
    while (n%i == 0)
    {
      s.insert(i);
      n /= i;
    }
  }
  if (n > 2)
    s.insert(n);
}
 
int main(){
	long long A, B;
  	scanf("%lld%lld",&A,&B);
  	primeFactors(A, sarvesh);
  	primeFactors(B, sarvesh2);
  	for (auto i = sarvesh.begin(); i != sarvesh.end(); i++) {
        if (sarvesh2.find(*i) != sarvesh2.end()) sarvesh3.insert(*i);
    }
  	cout << sarvesh3.size();
}

Compiler output:
a.cc:1:10: fatal error: stdc++.h: No such file or directory
    1 | #include "stdc++.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

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

unordered_set<long long> sarvesh;

void primeFactors(long long n)
{
  while (n%2==0){
    sarvesh.insert(2);
    n /= 2;
  }
  for (long long i = 3; i <= Math.sqrt(n); i+= 2){
    while (n%i == 0)
    {
      sarvesh.insert(i);
      n /= i;
    }
  }
  if (n > 2)
    sarvesh.insert(n);
}

int main(){
	long long A, long long B;
  	scanf("%lld%lld",&A,&B);
  	primeFactors(A);
  	primeFactors(B);
  	cout << sarvesh.size();
}

Compiler output:
a.cc: In function 'void primeFactors(long long int)':
a.cc:12:30: error: 'Math' was not declared in this scope
   12 |   for (long long i = 3; i <= Math.sqrt(n); i+= 2){
      |                              ^~~~
a.cc: In function 'int main()':
a.cc:24:22: error: expected unqualified-id before 'long'
   24 |         long long A, long long B;
      |                      ^~~~
a.cc:25:30: error: 'B' was not declared in this scope
   25 |         scanf("%lld%lld",&A,&B);
      |                              ^
Language: Java

import java.util.HashSet;
import java.util.Scanner;

public class Aim {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();

        if (a == 1 || b == 1) {
            System.out.println(1);

        } else {
            int gcd = getGcd(a, b);
            HashSet<Integer> primeFactor = new HashSet<>();
            for (int i = 3; i <= gcd; i += 2) {
                if (gcd % i == 0) {
                    primeFactor.add(i);
                    gcd /= i;
                    i = 3;
                }
            }

            System.out.println(primeFactor);
            System.out.println(primeFactor.size() + (gcd % 2 == 0 ? 2 : 1));
        }
    }

    // 最大公約数を返す
    public static int getGcd(long a, Long b) {
        long temp;
        while ((temp = a % b) != 0) {
            a = b;
            b = temp;
        }
        return Integer.parseInt(b.toString());
    }
}


Compiler output:
Main.java:4: error: class Aim is public, should be declared in a file named Aim.java
public class Aim {
       ^
1 error
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define repR(i, n) for(ll i = n; i >= 0; i--)
#define For(i, m, n) for(ll i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()

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;
}

ll lcm(ll x, ll y)
{
    if(x == 0 || y == 0) {
        return -1;
    }
    
    return (x * y / gcd(x, y));
}

ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll nCr(ll n, ll r) {
    if ( r * 2 > n ) r = n - r;
    ll dividend = 1;
    ll divisor  = 1;
    for ( ll i = 1; i <= r; ++i ) {
        dividend *= (n-i+1);
        divisor  *= i;
    }
    return dividend / divisor;
}

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;
}

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

ll mod = 1e9+7;

int main(){
    ll count = 0;
    ll a, b;
    cin >> a >> b;
    ll num = gcd(a,b);
  
  int ans = 1;

	vector<int> x(num + 1);

	for (int i = 2; i <= n; i++) {
		while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
			x.at(i)++;　//割った個数を配列に足す
			num /= i;
		}
	}

	for (int i = 2; i <= n; i++)
	{	
		ans *= x.at(i) + 1;　//それぞれを+1して掛けていく
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:95:35: error: extended character 　 is not valid in an identifier
   95 |                         x.at(i)++;　//割った個数を配列に足す
      |                                   ^
a.cc:102:36: error: extended character 　 is not valid in an identifier
  102 |                 ans *= x.at(i) + 1;　//それぞれを+1して掛けていく
      |                                    ^
a.cc: In function 'int main()':
a.cc:93:30: error: 'n' was not declared in this scope
   93 |         for (int i = 2; i <= n; i++) {
      |                              ^
a.cc:95:35: error: '\U00003000' was not declared in this scope
   95 |                         x.at(i)++;　//割った個数を配列に足す
      |                                   ^~
a.cc:100:30: error: 'n' was not declared in this scope
  100 |         for (int i = 2; i <= n; i++)
      |                              ^
a.cc:102:36: error: '\U00003000' was not declared in this scope
  102 |                 ans *= x.at(i) + 1;　//それぞれを+1して掛けていく
      |                                    ^~
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ABC142D {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Long a = sc.nextLong();
        Long b = sc.nextLong();

        if (a == 1 || b == 1) {
            System.out.println(1);

        } else {
            List<Integer> primeFactor = new ArrayList<>();
            Long target = gcd(a, b);
            for (int i = 2; i < target; i++) {
                if (target % i == 0 && !primeFactor.contains(i)) {
                    primeFactor.add(i);
                    target /= i;
                    i = 2;
                }
            }
            int x = Integer.parseInt(target.toString());
            if (!primeFactor.contains(x)) {
                primeFactor.add(x);
            }

            System.out.println(primeFactor.size() + 1);
        }
    }

    // 最大公約数を返す
    public static Long gcd(Long a, Long b) {
        Long temp;
        while ((temp = a % b) != 0) {
            a = b;
            b = temp;
        }
        return b;
    }
}


Compiler output:
Main.java:5: error: class ABC142D is public, should be declared in a file named ABC142D.java
public class ABC142D {
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class ABC142D {

    public static void main(String args[]) {

        Scanner sc = new Scanner(System.in);
        Long a = sc.nextLong();
        Long b = sc.nextLong();

        if (a == 1 || b == 1) {
            System.out.println(1);

        } else {
            List<Long> primeFactor = new ArrayList<>();
            Long target = gcd(a, b);
            for (Long i = 2L; i < target; i++) {
                if (target % i == 0) {
                    primeFactor.add(i);
                    target /= i;
                    i = 2L;
                }
            }
            primeFactor.add(target);

            System.out.println(new HashSet<>(primeFactor).size() + 1);
        }
    }

    // 最大公約数を返す
    public static Long gcd(Long a, Long b) {
        Long temp;
        while ((temp = a % b) != 0) {
            a = b;
            b = temp;
        }
        return b;
    }
}


Compiler output:
Main.java:6: error: class ABC142D is public, should be declared in a file named ABC142D.java
public class ABC142D {
       ^
1 error
Language: C++

#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
typedef long long ll;

ll gcd(ll, ll);
int sum(ll);

int main(){
    ll A, B;
    int ans;
    cin >> A >> B;
    ans = sum(gcd(A, B));
    cout << ans << endl;
}

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

int sum(ll i){
    vector<int> div;
    div.push_back(1);
    int j = 2;
    while(i != 1){
        if(i%j == 0){
            if(div.back() != j){
                div.push_back(j);
            }
            i = i/j;            
            j--;
        }
        if(j >= sqrt(i)){
            if(div.size() == 1) return 1;
            else{
                div.pushback(i);
                break;
            }
        }
        j++;
    }
    return div.size();
}

Compiler output:
a.cc: In function 'int sum(ll)':
a.cc:38:21: error: 'class std::vector<int>' has no member named 'pushback'; did you mean 'push_back'?
   38 |                 div.pushback(i);
      |                     ^~~~~~~~
      |                     push_back
Language: C++

#include<bits/stdc++.h>
using namespace std;
bool isprime(int num){
    if(num==1){
        return false;
    }
    if(num==2)
        return true;
    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;
}
vector<int> v;
int main(){
	
	long long a,b,c,d;
	int n,ans=0;
	cin>>a>>b;
	c=min(a,b);
	d=max(a,b);
	for(int i=2;i*i<=c;i++){
		if(c%i==0){
			v.push_back(i);
		}
		if(i*i!=c){
			v.push_back(c/i);
		}
		
	}
	n=v.size();
	for(int i=0;i<n;i++){
		if(d%v[i]==0&&is_prime(v[i])){
			ans++;
		}
	}
	cout<<ans+1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:31: error: 'is_prime' was not declared in this scope; did you mean 'isprime'?
   40 |                 if(d%v[i]==0&&is_prime(v[i])){
      |                               ^~~~~~~~
      |                               isprime
Language: C++

#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){

int a,b;
  cin>>a>>b;
  int C=gcm(a,b);
//１からCまでの素数＋1個数
int ret=1;
 for(int i = 2;i <= sqrt(C);i++) {
       if(C % i == 0) {
            ret++;
            while(C % i == 0) {
                C = C / i;
            }
}
}
if(C!=1){
ret++;
}
  cout<<ret;
  }

Compiler output:
a.cc:34:1: error: extended character   is not valid in an identifier
   34 |  for(int i = 2;i <= sqrt(C);i++) {
      | ^
a.cc: In function 'int main()':
a.cc:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
a.cc:34:6: note: in expansion of macro 'int'
   34 |  for(int i = 2;i <= sqrt(C);i++) {
      |      ^~~
a.cc:34:16: error: 'i' was not declared in this scope
   34 |  for(int i = 2;i <= sqrt(C);i++) {
      |                ^
Language: C++

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

unsigned long gcd(const unsigned long a, const unsigned long b){
    return (b == 0) ? a : gcd(b,a % b);
}

void Main(){
    ul a,b;
    ll ans = 1;
    cin >> a >> b;
    ul g = gcd(a,b);
    for(ll i = 2; i*i <= g; i++){
        if(g % i == 0){
            ans++;
            while(g % i == 0){
                g /= i;
            }
        }
    }
    if(f>2) ans++;
    cout << ans << endl;
}
    
int main(){
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    
    Main();
    return 0;
}

Compiler output:
a.cc: In function 'void Main()':
a.cc:24:8: error: 'f' was not declared in this scope
   24 |     if(f>2) ans++;
      |        ^