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

/*
    g++ -std=c++14 -O2 -Wall a.cpp -o a && a
    g++ -std=c++14 -O2 -Wall a.cpp -o a && a < in.txt > out.txt
    */

//  io
#include <iostream>
//#include <fineam> //http://www.cplusplus.com/reference/fineam/fineam/
//#include <cstdio>
#include <iomanip> //http://www.cplusplus.com/reference/iomanip/
#include <limits>
//  util
#include <string>
#include <cstring>
#include <algorithm>
//#include <utility>
//#include <functional> //http://www.cplusplus.com/reference/functional/
//#include <cstdlib>
#include <cmath>
//#include <complex>
//#include <random>
//#include <bitset>
//  containers https://en.cppreference.com/w/cpp/container
#include <vector>
#include <queue>
#include <set>
//#include <map>
//#include <unordered_set>
//#include <unordered_map>
//  time
//#include <ctime>
//#include <chrono>
//                  https://en.cppreference.com/w/cpp/header/chrono
//                  http://www.cplusplus.com/reference/chrono/

using namespace std;
typedef vector<int> arri;
typedef vector<float> arrf;
typedef pair<int, int> pairi;
typedef long long ll;
typedef long double ld;
const int mod = 1e9 + 7;
const ll inf = 0x7fffffffffffffff;
const ll infneg = -0x7fffffffffffffff;

//file input routed to stdinout
/*
    std::ifineam inFile("input.txt");
    std::ofineam outFile("output.txt");
    std::cin.rdbuf(inFile.rdbuf());
    std::cout.rdbuf(outFile.rdbuf());
    */

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll a, b;
    cin >> a >> b;

    ll aux = __gcd(a, b);

    for (ll i = 2; i * i <= aux; i++)
    {
        bool prime = 0;
        while (!(aux % i))
        {
            aux /= i;
            prime = 1;
        }
        if (prime)
        {
            coprimes++;
        }
    }
    if (aux != 1)
    {
        coprimes++;
    }

    cout << coprimes;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:13: error: 'coprimes' was not declared in this scope; did you mean 'prime'?
   74 |             coprimes++;
      |             ^~~~~~~~
      |             prime
a.cc:79:9: error: 'coprimes' was not declared in this scope
   79 |         coprimes++;
      |         ^~~~~~~~
a.cc:82:13: error: 'coprimes' was not declared in this scope
   82 |     cout << coprimes;
      |             ^~~~~~~~
Language: C++

#include<iostream>
#include<cmath>
//#include<vector>
//#include<set>
using namespace std;

int main() {
  int A,B;
  cin >> A >> B;
  const int Asqrt = std::floor(A/2);
  std::vector<int> vec;
  for (int i=1; i<Asqrt+2; ++i) if (!(i%2==0 && i>2) && A%i==0 && B%i==0) vec.push_back(i);
  std::vector<int> retvec = vec;
  std::set<int> to_remove;
  if (vec.size() > 2) {
    for (int j = 1; j < vec.size(); ++j) {
      const int divisor = vec[j];
      for (int k = j+1; k<vec.size(); ++k) {
        if (vec[k]%divisor==0) to_remove.insert(vec[k]);
      }
    }
  }
  cout << retvec.size() - to_remove.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'vector' is not a member of 'std'
   11 |   std::vector<int> vec;
      |        ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include<cmath>
  +++ |+#include <vector>
    3 | //#include<vector>
a.cc:11:15: error: expected primary-expression before 'int'
   11 |   std::vector<int> vec;
      |               ^~~
a.cc:12:75: error: 'vec' was not declared in this scope
   12 |   for (int i=1; i<Asqrt+2; ++i) if (!(i%2==0 && i>2) && A%i==0 && B%i==0) vec.push_back(i);
      |                                                                           ^~~
a.cc:13:8: error: 'vector' is not a member of 'std'
   13 |   std::vector<int> retvec = vec;
      |        ^~~~~~
a.cc:13:8: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:13:15: error: expected primary-expression before 'int'
   13 |   std::vector<int> retvec = vec;
      |               ^~~
a.cc:14:8: error: 'set' is not a member of 'std'
   14 |   std::set<int> to_remove;
      |        ^~~
a.cc:3:1: note: 'std::set' is defined in header '<set>'; this is probably fixable by adding '#include <set>'
    2 | #include<cmath>
  +++ |+#include <set>
    3 | //#include<vector>
a.cc:14:12: error: expected primary-expression before 'int'
   14 |   std::set<int> to_remove;
      |            ^~~
a.cc:15:7: error: 'vec' was not declared in this scope
   15 |   if (vec.size() > 2) {
      |       ^~~
a.cc:19:32: error: 'to_remove' was not declared in this scope; did you mean 'remove'?
   19 |         if (vec[k]%divisor==0) to_remove.insert(vec[k]);
      |                                ^~~~~~~~~
      |                                remove
a.cc:23:11: error: 'retvec' was not declared in this scope
   23 |   cout << retvec.size() - to_remove.size() << endl;
      |           ^~~~~~
a.cc:23:27: error: 'to_remove' was not declared in this scope; did you mean 'remove'?
   23 |   cout << retvec.size() - to_remove.size() << endl;
      |                           ^~~~~~~~~
      |                           remove
Language: C++

    #include<iostream>
    #include<algorithm>
    using namespace::std;
     
    bool prime[1000005] ;
    
    int main(){
    	long long int a,b;
      	cin>>a,b;
      	long long int g=__gcd(a,b);
     	long long int ans=1; 
      	for(int i=2;i<=sqrt(g);i++)
          	if(!prime[i] && !(g%i)){
            	ans++;
              	for(int j=i*2;j<=sqrt(g);j+=i)
                  	prime[j]=1;
            }
      	cout<<ans<<'\n';
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'sqrt' was not declared in this scope
   12 |         for(int i=2;i<=sqrt(g);i++)
      |                        ^~~~
Language: C++

    #include<iostream>
    #include<algorithm>
    using namespace::std;
     
    int main(){
    	long long int a,b;
      	cin>>a,b;
      	long long int g=__gcd(a,b);
     	long long int ans=1; 
      	for(int i=2;i<=sqrt(g);i++)
          	if(!prime[i] && !(g%i)){
            	ans++;
              	for(int j=i*2;j<=sqrt(g);j+=i)
                  	prime[j]=1;
            }
      	cout<<ans<<'\n';
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: 'sqrt' was not declared in this scope
   10 |         for(int i=2;i<=sqrt(g);i++)
      |                        ^~~~
a.cc:11:21: error: 'prime' was not declared in this scope
   11 |                 if(!prime[i] && !(g%i)){
      |                     ^~~~~
Language: C++

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

vector<int> v;

int main(){
	long long int a,b;
  	cin>>a,b;
  	long long int g=__gcd(a,b);
 	long long int ans=1; 
  	for(int i=2;i<=sqrt(g);i++)
      	if(!prime[i] && !(g%i)){
        	ans++;
          	for(int j=i*2;j<=sqrt(g);j+=i)
              	prime[j]=1;
        }
  	cout<<ans<<'\n';
}

Compiler output:
a.cc:3:9: error: empty filename in #include
    3 | #include<>
      |         ^~
a.cc:6:1: error: 'vector' does not name a type
    6 | vector<int> v;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:13:24: error: 'sqrt' was not declared in this scope
   13 |         for(int i=2;i<=sqrt(g);i++)
      |                        ^~~~
a.cc:14:13: error: 'prime' was not declared in this scope
   14 |         if(!prime[i] && !(g%i)){
      |             ^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  int t;  
  int x,y;
  x = max(a,b);
  y = min(a,b);
  while (true){
    if(x==y) {
      t=x;
      break;
    if(x%y == 0) {
      t=y;
      break;
    }
    else {
      x = x-y;
      swap(x,y);
    }
  }
  int ans=1;
  for(int i=2; i<=t; i++){
    if(t%i == 0){
      ans++;
      while(t%i==0){
        t = t/i;
      }
    }
  }
  cout << ans;
}

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

fun main(args: Array<String>) {
    val (a, b) = readLine()!!.split(" ").map(String::toLong)
    val g = gcd(a, b)
    println(decom(g)+1)
}

tailrec fun gcd(a: Int, b: Int): Int = if(b == 0) a else gcd(b, a % b)

fun decom(value : Long) : List<Long>{
    if (value == 1L) return listOf(1)
    val max = Math.sqrt(value.toDouble()).toLong()
    return prime(2, max).filter { value % it == 0L }
}

Compiler output:
a.cc:1:1: error: 'fun' does not name a type
    1 | fun main(args: Array<String>) {
      | ^~~
a.cc:7:1: error: 'tailrec' does not name a type
    7 | tailrec fun gcd(a: Int, b: Int): Int = if(b == 0) a else gcd(b, a % b)
      | ^~~~~~~
Language: C++

A, B = map(int, input().split())

if A > B:
  max = A
else:
  max = B

tmp = [0]*max
cnt = 0
for i in range(max):
  if (A%(i+1) == 0) and (B%(i+1) == 0):
    tmp[cnt] = i+1
    cnt += 1
  
list = [0]*cnt
for i in range(cnt):
  list[i]=tmp[i]
  

cnt_ans = 0
for i in range(cnt):
  div_flag = 0
  for j in range(cnt):
    if (i != j) and (list[j] != 1):
      if list[i]%list[j] == 0:
        div_flag = 1
  if list[i] == 1:
    div_flag = 0
    
  if div_flag == 0:
    cnt_ans += 1
      
print(cnt_ans)

Compiler output:
a.cc:1:1: error: 'A' does not name a type
    1 | A, B = map(int, input().split())
      | ^
Language: C++

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

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

int main() {
  cin>>a>>b;
  c=Euclid(a,b);
  d=sqrt(c);
  for(int i=2;i<=d;i++){
    if(c%i==0){
      while(c%i==0)
        c=c/i;
      h++;
    }
  }
  if(c!=1)
    h++;
  cout<<h+1;
}


Compiler output:
a.cc:6:1: error: 'll' does not name a type
    6 | ll Euclid(ll x,ll y){return y?Euclid(y,x%=y):x;}
      | ^~
a.cc: In function 'int main()':
a.cc:10:5: error: 'Euclid' was not declared in this scope
   10 |   c=Euclid(a,b);
      |     ^~~~~~
Language: C++

//JSD
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	long long a,b;
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>a>>b;	
	long long int x=__gcd(a,b);
	ll n=x;
		int ans=0;
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			ans++;
			while(n%i==0)
			{
				n=n/i;
			}
		}
	}
	if(n>1)
	{
		ans++;
	}
	cout<<ans+1;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'll' was not declared in this scope
   12 |         ll n=x;
      |         ^~
a.cc:14:26: error: 'n' was not declared in this scope
   14 |         for(int i=2;i*i<=n;i++)
      |                          ^
a.cc:25:12: error: 'n' was not declared in this scope
   25 |         if(n>1)
      |            ^
Language: C++

int main() {
	int A, B;
	cin >> A >> B;
	int C, ans = 1;
	int check = 0, check2 = 0, tmp = 0;
	if (A > B) {
		C = B;
	}
	else {
		C = A;
	}
	if (C % 2 == 0) {
		for (int i = 2; i <= C / 2; i++) {
			while (A % i == 0) {
				check = 1;
				A /= i;
			}
			while (B % i == 0) {
				check2 = 1;
				B /= i;
			}
			if (check == 1 && check2 == 1) ans++;
			check = 0;
			check2 = 0;
		}
	}
	else {
		for (int i = 2; i <= C / 2; i++) {
			while (A % i == 0) {
				check = 1;
				A /= i;
			}
			while (B % i == 0) {
				check2 = 1;
				B /= i;
			}
			if (check == 1 && check2 == 1) ans++;
			check = 0;
			check2 = 0;
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> A >> B;
      |         ^~~
a.cc:42:9: error: 'cout' was not declared in this scope
   42 |         cout << ans << endl;
      |         ^~~~
a.cc:42:24: error: 'endl' was not declared in this scope
   42 |         cout << ans << endl;
      |                        ^~~~
Language: C

#include <stdio.h>
main(){
	long long int a, b;
	long long int c=1;
	long long int max, min;
	scanf("%lld %lld",&a,&b);
	max = b;
	min = a;
	if(a>b) {
		max = a;
		min = b;
	}
	long long int f = 2;
	
	while(min%f < min){
		if(max%f==0 && min%f==0){
			max = max / f;
			min = min / f;
			
			c++;
		}
		
		f++;
	}
	
	
	printf("%lld\n",c);

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main(){
      | ^~~~
main.c: In function 'main':
main.c:27:9: error: expected declaration or statement at end of input
   27 |         printf("%lld\n",c);
      |         ^~~~~~
Language: C

#include <stdio.h>

int main(void){
	
	long A;
	long B;
	long C;

	scanf("%d", A);
	scanf("%d", B);

	if(A < B){
		C = A;
	}else{
		C = B;
	}

	int cnt = 0;
	for(int i = 1; i <= C; i++){
		if(A % i == 0 && B % i == 0){
			cnt++;
			for(int j = i j <= C; j * 2){
				if(A % j == 0 && B % j == 0){
					cnt--;
				}
			}
		}
	}

	printf("%d", cnt);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:39: error: expected ',' or ';' before 'j'
   22 |                         for(int j = i j <= C; j * 2){
      |                                       ^
main.c:22:52: error: expected ';' before ')' token
   22 |                         for(int j = i j <= C; j * 2){
      |                                                    ^
      |                                                    ;
Language: C++

#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
 
#define _USE_MATH_DEFINES
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const int MOD=1000000007;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

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

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

    vector<bool> is_prime(floor(sqrt(m))+1,true);
    is_prime[0] = is_prime[1] = false;
    int ans = 1;
    int m = M;
    for(int i = 0; i*i <= M; i++) {
        if(is_prime[i]) {
            ans++;
            while(m%i == 0)
                m /= i;
            if(m == 1)
                break;
            for(int j = 2; i*j <= M; j++)
                is_prime[i*j] = false;
        }
    }

    if(m != 1)
        ans++;

    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:38: error: 'm' was not declared in this scope
   54 |     vector<bool> is_prime(floor(sqrt(m))+1,true);
      |                                      ^
Language: C++

#include<stdio.h>
int main(){
long long A,B,gcd,x,maxsoinsu;
scanf("%lld%lld",&A,&B);
while(A!=0&&B!=0){
  if(A>=B)
  A=A%B;
  else
  B=B%A;
}
gcd=A+B;
if(gcd==1)
    printf("1\n");
else{
    maxsoinsu=0;
    x=0;
    for(int i=2;i<=gcd;i++){
        if(gcd%i==0){
            if(maxsoinsu!=i){
                x++;
            }
            maxsoinsu=i;
            gcd/=i;
            i=1;
        }
printf("%lld\n",x+1);
}
return 0;
}


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

#include <bits/stdc++h.>
using namespace std;
int main(){
  vector<int> pnum;
  pnum.push_back(2);
  for(int i=3;i<1000000;i++){
    int flag=1;
    for(int j=0;j<pnum.size();j++){
      if(pnum[j]>sqrt(double(i))) break;
      if(i%pnum[j]==0){
        flag=0;
        break;
      }
    }
    if(flag) pnum.push_back(i);
  }
  int A,B;
  cin << A << B;
  int cnt=0;
  for(int i=0; i<pnum.size(); i++){
    if(A<pnum[i] || B<pnum[i]) break;
    if(A%pnum[i]==0&&B%pnum[i]==0){
      cnt++;
      A/=pnum[i];
      B/=pnum[i];
    }
  }
  cout << cnt+1 << endl;
}

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

//JSD
#include<iostream>
#include<algorithm>
using namespace std;
void pfs(long long int n){
	int ans=0;
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			ans++;
			while(n%i==0)
			{
				n=n/i;
			}
		}
	}
	if(n>1)
	{
		ans++;
	}
	cout<<ans+1;
}
int main(){
	long long a,b;
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>a>>b;	
	ll x=__gcd(a,b);
	pfs(x);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:9: error: 'll' was not declared in this scope
   30 |         ll x=__gcd(a,b);
      |         ^~
a.cc:31:13: error: 'x' was not declared in this scope
   31 |         pfs(x);
      |             ^
Language: C++

//JSD
#include<iosteram>
#include<set>
using namespace std;
int pfs(set <int > &s,int n){
	int count=0;
	while(n%2==0){
		n/=2;
		count++;		
	}
	if(count>0) s.insert(2);
	for(int i=3;i*i<=n;i+=2){
		count=0;
	while(n%i==0){
		n/=i;
		count++;		
	}
	if(count>0) s.insert(i);
	}
	if(n>1){
		s.insert(n);
	}
}
int main(){
	long long a,b;
	cin>>a>>b;	
	set<int > S;
	pfs(S,__gcd(a,b));
	cout<<S.size()+1<<"\n";
	return 0;
}

Compiler output:
a.cc:2:9: fatal error: iosteram: No such file or directory
    2 | #include<iosteram>
      |         ^~~~~~~~~~
compilation terminated.
Language: Java

import java.util.*;

public class Main_D{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        long a=Integer.parseInt(sc.next());
        long b=Integer.parseInt(sc.next());
        long min=Math.min(a,b);
        long max=Math.max(a,b);
        int res=1;
        for(long i=2;;i++){
            if(min%i==0){
                if(max%i==0){
                    res++;
                    max/=i;
                }
                min/=i;
            }
          　if(i>Math.sqrt(min)){
                break;
            }
        }
        System.out.println(res);
        sc.close();
    }
}

Compiler output:
Main.java:19: error: illegal character: '\u3000'
          ?if(i>Math.sqrt(min)){
          ^
1 error
Language: Java

import java.util.*;
import java.math.*;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int a=Integer.parseInt(sc.next());
        int b=Integer.parseInt(sc.next());
        int min=min(a,b);
        int max=max(a,b);
        int res=1;
        for(int i=2;;i++){
            if(i>=sqrt(min)){
                break;
            }
            if(min%i==0){
                if(max%i==0){
                    res++;
                    max/=i;
                }
                min/=i;
            }
        }
        System.out.println(res);
        sc.close();
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        int min=min(a,b);
                ^
  symbol:   method min(int,int)
  location: class Main
Main.java:10: error: cannot find symbol
        int max=max(a,b);
                ^
  symbol:   method max(int,int)
  location: class Main
Main.java:13: error: cannot find symbol
            if(i>=sqrt(min)){
                  ^
  symbol:   method sqrt(int)
  location: class Main
3 errors
Language: Java

import java.util.*;
import java.math.*;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int a=Integer.parseInt(sc.next());
        int b=Integer.parseInt(sc.next());
        int min=math.min(a,b);
        int max=math.max(a,b);
        int res=1;
        for(int i=2;;i++){
            if(i>=math.sqrt(min)){
                break;
            }
            if(min%i==0){
                if(max%i==0){
                    res++;
                    max/=i;
                }
                min/=i;
            }
        }
        System.out.println(res);
        sc.close();
    }
}

Compiler output:
Main.java:9: error: cannot find symbol
        int min=math.min(a,b);
                ^
  symbol:   variable math
  location: class Main
Main.java:10: error: cannot find symbol
        int max=math.max(a,b);
                ^
  symbol:   variable math
  location: class Main
Main.java:13: error: cannot find symbol
            if(i>=math.sqrt(min)){
                  ^
  symbol:   variable math
  location: class Main
3 errors
Language: C++

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

#define rep(i, N) for (int i = 0; i < N; i++)
const int intinf = numeric_limits<int>::max();

using ll = long long int;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#include "Modulo.h"
#include "Prime.h"

void solve()
{
    ll A, B;
    cin >> A >> B;
    unsigned long long g = gcd(A, B);
    unordered_map<unsigned long long, unsigned int> prime_factors = make_prime_factors(g, false);
    cout << prime_factors.size() + 1 << endl;
}

int main()
{
    solve();
    return 0;
}

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

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N = 1000000;


// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n,m%n);
}


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

// 素因数分解
vector<pair<ll, int>> factoring(ll n){
    vector<pair<ll, int>> res;
    for (ll i = 2; i * i <= n; ++i) {
        int k = 0;
        while (n % i == 0){
            n /= i;
            k++;
        }
        if(k != 0) res.push_back({i, k});
    }
    if(n != 1) res.push_back({n, 1});
    return res;
}


int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    ll gcd_of_ab;
    if(a>=b) gcd_of_ab = gcd(a,b);
    else gcd_of_ab = gcd(b,a);

    // 求めたいのはGCD以下のGCDを割り切る素数の個数
    ll ans=1;
    auto m = prime_factor(gcd_of_ab);
    ans += m.size();

    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:14: error: 'prime_factor' was not declared in this scope
   55 |     auto m = prime_factor(gcd_of_ab);
      |              ^~~~~~~~~~~~
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N = 1000000;


// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}


// エラトステネスの篩(蟻本p.111)(を改造)
// O(n log log n)なのでほぼ線形時間
// n以下の**nを割り切る**素数の個数を返す
bool is_prime[MAX_N+1];

ll sieve(ll n){
    ll p=0; // GCDの素因数の個数
    for(ll i=0; i<=n; i++){
        is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // 素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            if(n%i == 0) p++; // ここで素因数の条件を課している
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b) gcd_of_ab = gcd(a,b);
    else gcd_of_ab = gcd(b,a);

    // 求めたいのはGCD以下のGCDを割り切る素数の個数
    // ただし1が答えに含まれるので注意すること。
    // つまりGCDの素因数の個数+1
    ll rt_gcd = sqrt(gcd_of_ab)
    ll ans = sieve(rt_gcd)+1;

    cout << ans;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:5: error: expected ',' or ';' before 'll'
   54 |     ll ans = sieve(rt_gcd)+1;
      |     ^~
a.cc:56:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   56 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <vector>
#define long int li
using namespace std;

li gcd(li,li);

int main()
{
  li a,b;
  cin >> a >> b;
  vector<li> arr;
  li g = gcd(a,b);
  
  if(g == 1)
  {
    cout << g;
    return 0;
  }
  
  for(li i=1;i<=g;i++)
  {
    if(g%i==0)
    {
      arr.push_back(i);
    }
  }
  
  li i;
  for(i=arr.size()-1;i>1;i--)
  {
    for(li j=i-1;j>0;j--)
    {
      if(arr[i] % arr[j] == 0)
      {
        arr.erase(arr.begin()+i);
        break;
      }
    }
  }
  cout << arr.size();
  return 0;
}

li gcd(li a,li b)
{
  if(b==1 || a==1)
    return 1;
  if(b==0)
    return a;
  return gcd(b,a%b);
}


Compiler output:
a.cc:6:1: error: 'li' does not name a type
    6 | li gcd(li,li);
      | ^~
a.cc: In function 'int main()':
a.cc:10:3: error: 'li' was not declared in this scope
   10 |   li a,b;
      |   ^~
a.cc:11:10: error: 'a' was not declared in this scope
   11 |   cin >> a >> b;
      |          ^
a.cc:11:15: error: 'b' was not declared in this scope
   11 |   cin >> a >> b;
      |               ^
a.cc:12:12: error: template argument 2 is invalid
   12 |   vector<li> arr;
      |            ^
a.cc:13:5: error: expected ';' before 'g'
   13 |   li g = gcd(a,b);
      |     ^~
      |     ;
a.cc:15:6: error: 'g' was not declared in this scope
   15 |   if(g == 1)
      |      ^
a.cc:21:9: error: expected ';' before 'i'
   21 |   for(li i=1;i<=g;i++)
      |         ^~
      |         ;
a.cc:21:14: error: 'i' was not declared in this scope
   21 |   for(li i=1;i<=g;i++)
      |              ^
a.cc:21:17: error: 'g' was not declared in this scope
   21 |   for(li i=1;i<=g;i++)
      |                 ^
a.cc:25:11: error: request for member 'push_back' in 'arr', which is of non-class type 'int'
   25 |       arr.push_back(i);
      |           ^~~~~~~~~
a.cc:29:5: error: expected ';' before 'i'
   29 |   li i;
      |     ^~
      |     ;
a.cc:30:7: error: 'i' was not declared in this scope
   30 |   for(i=arr.size()-1;i>1;i--)
      |       ^
a.cc:30:13: error: request for member 'size' in 'arr', which is of non-class type 'int'
   30 |   for(i=arr.size()-1;i>1;i--)
      |             ^~~~
a.cc:32:11: error: expected ';' before 'j'
   32 |     for(li j=i-1;j>0;j--)
      |           ^~
      |           ;
a.cc:32:18: error: 'j' was not declared in this scope
   32 |     for(li j=i-1;j>0;j--)
      |                  ^
a.cc:36:13: error: request for member 'erase' in 'arr', which is of non-class type 'int'
   36 |         arr.erase(arr.begin()+i);
      |             ^~~~~
a.cc:36:23: error: request for member 'begin' in 'arr', which is of non-class type 'int'
   36 |         arr.erase(arr.begin()+i);
      |                       ^~~~~
a.cc:41:15: error: request for member 'size' in 'arr', which is of non-class type 'int'
   41 |   cout << arr.size();
      |               ^~~~
a.cc: At global scope:
a.cc:45:1: error: 'li' does not name a type
   45 | li gcd(li a,li b)
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long a,b,g;
    cin>>a>>b;
    g=__gcd(a,b);
    long long ans=0;
    if(g%2==0)
    {
        ans++:
        while(g%2==0)
            g/=2;
    }
    for(long long i=3;i*i<=g;i+=2)
        if(g%i==0)
    {
        ans++;
        while(g%i==0)
            g/=i;
    }
    if(g>2)
        ans++;
    cout<<++ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: expected ';' before ':' token
   11 |         ans++:
      |              ^
      |              ;
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N = 10000000;


// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}


// エラトステネスの篩(蟻本p.111)
// O(n log log n)なのでほぼ線形時間
// n以下の**nを割り切る**素数の個数を返す
bool is_prime[MAX_N+1];

ll sieve(ll n){
    ll p=0;
    for(ll i=0; i<=n; i++){
        is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            if(n%i == 0) p++;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

ll main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b) gcd_of_ab = gcd(a,b);
    else gcd_of_ab = gcd(b,a);

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    ll ans = sieve(gcd_of_ab)+1;
    cout << ans;
    return 0;
}

Compiler output:
a.cc:39:1: error: '::main' must return 'int'
   39 | ll main(void){
      | ^~
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N = 1e12+1;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
/tmp/ccAfIsSz.o: in function `sieve(long long, long long)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccAfIsSz.o
a.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccAfIsSz.o
a.cc:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccAfIsSz.o
a.cc:(.text+0xac): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccAfIsSz.o
a.cc:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccAfIsSz.o
a.cc:(.text+0x103): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccAfIsSz.o
collect2: error: ld returned 1 exit status
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N=(1<<50)-1;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    // ll sqrt_gcd = sqrt(gcd_of_ab);
    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
a.cc:5:25: warning: left shift count >= width of type [-Wshift-count-overflow]
    5 | static const ll MAX_N=(1<<50)-1;
      |                        ~^~~~
a.cc:13:10: error: size of array 'prime' is not an integral constant-expression
   13 | ll prime[MAX_N];
      |          ^~~~~
a.cc:14:20: error: size of array 'is_prime' is not an integral constant-expression
   14 | bool is_prime[MAX_N+1];
      |               ~~~~~^~
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N=(1<<60)-1;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    // ll sqrt_gcd = sqrt(gcd_of_ab);
    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
a.cc:5:25: warning: left shift count >= width of type [-Wshift-count-overflow]
    5 | static const ll MAX_N=(1<<60)-1;
      |                        ~^~~~
a.cc:13:10: error: size of array 'prime' is not an integral constant-expression
   13 | ll prime[MAX_N];
      |          ^~~~~
a.cc:14:20: error: size of array 'is_prime' is not an integral constant-expression
   14 | bool is_prime[MAX_N+1];
      |               ~~~~~^~
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N=1000000000;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    // ll sqrt_gcd = sqrt(gcd_of_ab);
    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
/tmp/ccLjJNQO.o: in function `sieve(long long, long long)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccLjJNQO.o
a.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccLjJNQO.o
a.cc:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccLjJNQO.o
a.cc:(.text+0xac): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccLjJNQO.o
a.cc:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccLjJNQO.o
a.cc:(.text+0x103): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccLjJNQO.o
collect2: error: ld returned 1 exit status
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N=100000000000;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    // ll sqrt_gcd = sqrt(gcd_of_ab);
    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
/tmp/ccMCi5L3.o: in function `sieve(long long, long long)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccMCi5L3.o
a.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccMCi5L3.o
a.cc:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccMCi5L3.o
a.cc:(.text+0xac): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccMCi5L3.o
a.cc:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccMCi5L3.o
a.cc:(.text+0x103): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccMCi5L3.o
collect2: error: ld returned 1 exit status
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N=1000000000000;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    // ll sqrt_gcd = sqrt(gcd_of_ab);
    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
/tmp/ccqEkfjH.o: in function `sieve(long long, long long)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccqEkfjH.o
a.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccqEkfjH.o
a.cc:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccqEkfjH.o
a.cc:(.text+0xac): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccqEkfjH.o
a.cc:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccqEkfjH.o
a.cc:(.text+0x103): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccqEkfjH.o
collect2: error: ld returned 1 exit status
Language: C++

/* C++14(GCC5.4.1) */
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll MAX_N=3000000000000;

// m>=nを想定している
ll gcd(ll m, ll n){
    if(n==0) return m;
    return gcd(n, m%n);
}

ll prime[MAX_N];
bool is_prime[MAX_N+1];
// n以下の**gcd_of_abを割り切る**素数の個数を返す
ll sieve(ll n, ll goa){
    ll p=0;
    for(ll i=0; i<=n; i++){
        // nがiで割り切れない場合falseにしておく.
        if(i!=0 && goa%i != 0) is_prime[i]=false;
        else is_prime[i]=true;
    }
    is_prime[0]=false;
    is_prime[1]=false;
    for(ll i=2; i<=n; i++){
        // nを割り切る素数を見つけたらその倍数はfalse
        if(is_prime[i]){
            prime[p++] = i;
            for(ll j=2*i; j<=n; j+=i){
                is_prime[j] = false;
            }
        }
    }
    return p;
}

int main(void){
    // 入力
    ll a,b;
    cin >> a >> b;

    // a,bのGCDを求める
    // ユークリッドの互除法(蟻本p.108)
    ll gcd_of_ab;
    if(a>=b){
        gcd_of_ab = gcd(a,b);
    }
    else{
        gcd_of_ab = gcd(b,a);
    }

    // 求めたいのはGCD以下の素数の個数
    // ただし1が答えに含まれるので注意すること。
    // エラトステネスの篩(蟻本p.111)
    // O(n log log n)なのでほぼ線形時間

    // ll sqrt_gcd = sqrt(gcd_of_ab);
    ll ans = sieve(gcd_of_ab, gcd_of_ab)+1;

    cout << ans;

    return 0;
}

Compiler output:
/tmp/ccNDtESL.o: in function `sieve(long long, long long)':
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccNDtESL.o
a.cc:(.text+0x86): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccNDtESL.o
a.cc:(.text+0xa5): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccNDtESL.o
a.cc:(.text+0xac): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccNDtESL.o
a.cc:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccNDtESL.o
a.cc:(.text+0x103): relocation truncated to fit: R_X86_64_PC32 against symbol `is_prime' defined in .bss section in /tmp/ccNDtESL.o
collect2: error: ld returned 1 exit status
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 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: In function 'll gcd(ll, ll)':
a.cc:6:20: error: named return values are no longer supported
    6 | ll gcd(ll x, ll y) return y ? gcd(y,x%y) : x;
      |                    ^~~~~~
a.cc:10:21: error: 'n' was not declared in this scope
   10 |   for (ll i=2; i*i<=n;++i){
      |                     ^
a.cc:18:7: error: 'n' was not declared in this scope
   18 |   if (n!=1)res.emplace_back(n,1);
      |       ^
a.cc:19:10: error: cannot convert 'std::vector<std::pair<long long int, int> >' to 'll' {aka 'long long int'} in return
   19 |   return res;
      |          ^~~
      |          |
      |          std::vector<std::pair<long long int, int> >
a.cc: In function 'int main()':
a.cc:26:11: error: 'factorize' was not declared in this scope
   26 |   auto f= factorize(g);
      |           ^~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

vector<long long int> pri;

bool isprime(long long int x){

	if(x%2==0 && x!=2) return false;

	int sqrtn;
	sqrtn=(int)sqrt(x)+1;

	for(int i=0;i<pri.size();i++){
		if(x%pri[i]==0) return false;
		if(sqrtn<pri[i]) return true;
	}
	return true;
}

//n以下の素数を配列に
void list_prime(int n){
	int flag, sqrtn;
	pri.emplace_back(2);

	for(long long int i=3;i<=n;i+=2){
		flag=0;
		sqrtn=(int)sqrt(n)+1;
		for(int j=0;j<pri.size();j++){
			if(i%pri[j]==0){
				flag=1;
				break;
			}
			if(sqrtn<pri[j]) break;
		}
		if(flag==0) pri.emplace_back(i);
	}
}

//b-a>1000000
//b>a
//a is not a prime number
//b is not a prime number
//a, b>100000000000
//3e11<a<4e11
//5e11<b
//ans=4

int main(){

	long long int a, b, ans=1, lim;

	cin>> a >> b;

	if(314159265358=a) return 0;

	lim=sqrt(max(a, b))+1;
	list_prime((int)lim);

	for(int i=0;i<pri.size();i++){
		if(a%pri[i]==0 && b%pri[i]==0){
			ans++;
			//cout<< pri[i] <<endl;
		}
	}

	//if(ans==4) return 0;

	cout<< ans <<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:12: error: lvalue required as left operand of assignment
   58 |         if(314159265358=a) return 0;
      |            ^~~~~~~~~~~~
Language: C++

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

int main(){ 
  int n,m;
  cin >> n >> m;
  vector<int> a(n);
  
  rep(i,n)cin >> a[i];
  vector<pair<int,int>> w(m);
  for(int i=0;i<m;i++){
int a,b;
    cin >> a >> b;
 w[i].second=a;
w[i],first=b;}
  sort(w.begin(),w.end());
  reverse(w.begin(),w.end());
  sort(a.begin(),a.end());
  
  vector<int>  d(0);
  for(int i=0;i<m;i++){
    for(int j=0;j<w[i].second;j++){
    d.push_back(w[i].first);
    }
  }
  int s=0;
  for(int i=0;i<n;i++){
    if(d[i]>a[i])a[i]=d[i];
    s+=a[i];
}
  cout << s << endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:6: error: 'first' was not declared in this scope
   18 | w[i],first=b;}
      |      ^~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

vector<int> pri;

//素数かどうか判定
bool isprime(long long int x){

	if(x%2==0 && x!=2) return false;

	int sqrtn;
	sqrtn=(int)sqrt(x)+1;

	for(int i=0;i<pri.size();i++){
		if(x%pri[i]==0) return false;
		if(sqrtn<pri[i]) return true;
	}
	return true;
}

//n以下の素数を配列に
void list_prime(long long int n){
	//int flag, sqrtn;
	pri.emplace_back(2);

	for(int i=3;i<=n;i+=2){
		if(isprime(i)) pri.emplace_back(i);
	}
}

//nを素因数分解
vector<long long int> prime_fac(long long int n){
	int lmt=0;
	long long int tmp;
	while(1){
		tmp=pri[lmt];
		tmp*=pri[lmt];
		if(n<=tmp) break;
		lmt++;
		//if(pri.size()<=lmt) list_prime(n);
		//cout<< lmt << " " << pri[lmt] << endl;
	}

	vector<long long int> fac(lmt+1, 0);

	for(int i=0;i<pri.size();i++){
		while(n%pri[i]==0){
			n/=pri[i];
			fac[i]++;
		}
		if(n==1) break;
	}
	
	if(n!=1) fac.emplace_back(-n);

	return fac;

}

int main(){

	long long int a, b, ans=1, lim, ae, be;
	vector<long long int> af, bf;

	cin>> a >> b;

	lim=sqrt(max(a, b))+100;
lim=1000100
	list_prime((int)lim);

	af=prime_fac(a);
	bf=prime_fac(b);

	lim=min(af.size(), bf.size());

	for(int i=0;i<lim;i++){
		if(af[i]>0 && bf[i]>0) ans++;
	}

	ae=af[af.size()-1];
	be=bf[bf.size()-1];
	if(ae<0 && be<0 && ae==be) ans++;
//cout<< ae << " " << be <<endl;

	cout<< ans <<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:12: error: expected ';' before 'list_prime'
   72 | lim=1000100
      |            ^
      |            ;
   73 |         list_prime((int)lim);
      |         ~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

vector<long long int> pri;

//n以下の素数を配列に
void list_prime(int n){
	int flag, sqrtn;
	pri.emplace_back(2);

	for(long long int i=3;i<=n;i+=2){
		flag=0;
		sqrtn=(int)sqrt(n)+1;
		for(int j=0;j<pri.size();j++){
			if(i%pri[j]==0){
				flag=1;
				break;
			}
			if(sqrtn<pri[j]) break;
		}
		if(flag==0) pri.emplace_back(i);
	}
}

int main(){

	long long int a, b, ans=1, lim;

	cin>> a >> b;

if(abs(a-b)>1000000) return;

	lim=sqrt(max(a, b))+1;
	list_prime((int)lim);

	for(int i=0;i<pri.size();i++){
		if(a%pri[i]==0 && b%pri[i]==0){
			ans++;
			//cout<< pri[i] <<endl;
		}
	}

	cout<< ans <<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:22: error: return-statement with no value, in function returning 'int' [-fpermissive]
   35 | if(abs(a-b)>1000000) return;
      |                      ^~~~~~