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

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
ll a, b;
vector<ll> y;

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

vactor<int> prime_factor(int n) {
  vector<int> res;
  for(int i=2; i*i<=n; i++) {
    res.push_back(i);
    while (n % i == 0) {
      n /= i;
    }
  }
  if(n != 1) res.push_back(i);
  return res;
}

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

  int c = gcd(a, b);
  vector<int> res = prime_factor(c);
  cout << res.size() + 1 << endl;
}


Compiler output:
a.cc:43:1: error: 'vactor' does not name a type
   43 | vactor<int> prime_factor(int n) {
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:60:21: error: 'prime_factor' was not declared in this scope
   60 |   vector<int> res = prime_factor(c);
      |                     ^~~~~~~~~~~~
Language: C

#include <stdio.h>
#include <math.h>

void change(long* x, long* y){
    long z = *x;
    *x = *y;
    *y = z;
}

void gcd(long* x, long* y){
    float z;
    z = *x % *y;
    *x = *y;
    *y = z;

}

int isprime(long x){
    for(long i = 2; i <= sqrt(x); i++){
        if (x % i == 0)
            return 0;
    }
    return 1;
}
int main(){
    long a,b;
    int t;

    scanf("%ld%ld", &a, &b);  //a > b

    if (*a < *b){
        change(&a, &b);
    }
    while(a % b){
        gcd(&a, &b);
    }

    for(long i = 1; i <= a && i <= b; i ++){
        if(a % i == 0){
            while(a % i){
                a = a % i;
            }
            if(isprime(i)){
                t++;
            }
        }
    }
    printf("%d",t);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:9: error: invalid type argument of unary '*' (have 'long int')
   31 |     if (*a < *b){
      |         ^~
main.c:31:14: error: invalid type argument of unary '*' (have 'long int')
   31 |     if (*a < *b){
      |              ^~
Language: C++

#include "bits/stdc++.h"
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;


int main(){
ll A,B;

cin>>A>>B;
vector<ll> so;
ll tar = __gcd(A,B);
ll ans=1;
ll N=tar;
ll gen = sqrt(N);

for (ll i = 2; i<=;gen i++) {
   
    if(tar%i==0){
      ans++;
    }
    
    while (tar%i == 0) { // 素数で割り切れなくなるまで割っていく　//割った個数を配列に足す
			tar /= i;
		}

    if(tar==1){
      break;
    }
	}


cout<<ans<<endl;






}




Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: expected primary-expression before ';' token
   18 | for (ll i = 2; i<=;gen i++) {
      |                   ^
a.cc:18:23: error: expected ')' before 'i'
   18 | for (ll i = 2; i<=;gen i++) {
      |     ~                 ^~
      |                       )
a.cc:18:27: error: expected ';' before ')' token
   18 | for (ll i = 2; i<=;gen i++) {
      |                           ^
      |                           ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b);
int main(){
    long long a,b;
    cin>>a>>b;
    long long n=gcd(a,b);
    //cout<<n<<endl;
    vector<int> prime(1000001,0);
    int ans=1;
    for(long long i=2;i*i<=n);i++){
        //cout<<i<<" "<<n<<endl;
        while(n%i==0){
            n/=i;
        }
        ans++;
    }
    if(n!=1)ans++;
    cout<<ans<<endl;
    return 0;
}

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: expected ';' before ')' token
   11 |     for(long long i=2;i*i<=n);i++){
      |                             ^
      |                             ;
a.cc:11:31: error: 'i' was not declared in this scope
   11 |     for(long long i=2;i*i<=n);i++){
      |                               ^
Language: C++

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

ll gcd(ll a,ll b){
      ll t = a%b;
      while(t > 0){
            a = b;
            b = t;
            t  = a%b;
      }
      return b;
}

int main(){
      ll A,B,ans=1;
      cin >> A >> B;
      
      ll N = gcd(A,B);
      for(int i = 2;i*i <= N;i++){
            if(N%i == 0){
                  ans++;
                  while(N%i==0)N/=i;
            }
      }
      if(X > 1)ans++;
      cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:10: error: 'X' was not declared in this scope
   26 |       if(X > 1)ans++;
      |          ^
Language: C++

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

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

vector<pair<long long, int>> factorize(long long n){ //素因数とその何乗か
    vector<pair<long long, int>> res;
    for (long long i = 2; i*i <= n; i++){
        if (n%i) continue; 割り切れなかったら
        res.emplace_back(i, 0); //first,secondの末尾に追加
        while (n%i == 0){//割り切れる
            n /= i;
            res.back().second++; //何乗するか
        }
    }
    if (n != 1) res.emplace_back(n, 1); //その数自体も追加
    return res;
}

int main(){
    long long a, b;
    cin >> a >> b;
    long long g = gcd(a, b); //a,bの最大公約数
    auto f = factorize(g);
    int ans = f.size() + 1; //
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'std::vector<std::pair<long long int, int> > factorize(long long int)':
a.cc:9:28: error: '\U00005272\U0000308a\U00005207\U0000308c\U0000306a\U0000304b\U00003063\U0000305f\U00003089' was not declared in this scope
    9 |         if (n%i) continue; 割り切れなかったら
      |                            ^~~~~~~~~~~~~~~~~~
Language: C++

#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>
#define int long long

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << ": " << arg1 << " |";
	__f(comma + 1, args...);
}

int GCD(int a, int b) {
	for (;b; a %= b, swap(a, b));
	return a;
}
unsigned main() {
	int A, B, ans =0;
	cin >> A >> B;
	

	int G = GCD(A, B);
	for (int i = 2; i*i <= G; i++)
	{
		if (G % i == 0) {
			//cout << i << " ";
			ans++;
			while (G % i == 0) {
				G /= i;
			}
		}
	}
	if (G > 1) ans++;
	cout << ++ans;
	
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>
#define int long long

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cerr.write(names, comma - names) << ": " << arg1 << " |";
	__f(comma + 1, args...);
}

int GCD(int a, int b) {
	for (;b; a %= b, swap(a, b));
	return a;
}
unsigned main() {
	int A, B, ans =0;
	cin >> A >> B;
	

	int G = GCD(A, B);
	for (int i = 2; i*i <= G; i++)
	{
		if (G % i == 0) {
			//cout << i << " ";
			ans++;
			while (G % i == 0) {
				G /= i;
			}
		}
	}
	if (G > 1) ans++;
	cout << ++ans;
	return 0;

	
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include<iostream>
using namespace std;
int gcd(int,int);
int main(){
	int A,B;
	int G,count=0;
	bool flag;
	cin>>A>>B;
	G=gcd(A,B);
	for(int i=1;i<=G;i++){
		flag = i%2==0;
		if(i==2)flag=false;
		for(int j=3;j<=sqrt(i)+1;j++){
			if(i%j==0){
				
				flag=true;
				break;
			}
		}
		if(!flag){
			if(A%i==0&&B%i==0)count++;
		}
	}
	cout<<count<<endl;
	return 0;
}
int gcd(int a,int b){
	int R;
	if(a>b){
		R=a%b;
		if(R==0)return b;
		else return gcd(b,R);
	}else if(a<b){
		R=b%a;
		if(R==0)return a;
		else return gcd(a,R);
	}else return a;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: 'sqrt' was not declared in this scope
   13 |                 for(int j=3;j<=sqrt(i)+1;j++){
      |                                ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

ll gcd(ll x, ll y) //最大公約数
{
    if (y == 0)
        return x;
    if (y > x)
        return gcd(y, x);
    else
        return gcd(y, x % y);
}
bool IsPrime(ll num) //素数判定
{
    if (num < 2)
        return false;
    else if (num == 2)
        return true;
    else if (num % 2 == 0)
        return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (ll = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }
    // 素数である
    return true;
}
int main()
{
    ll a, b, ans = 0;
    cin >> a >> b;
    ll c = gcd(a, b);
    for (ll i = 2; i <= c; i++)
    {
        if (IsPrime(i))
        {
            if (c % i == 0)
            {
                ans++;
                while (c % i == 0)
                {
                    c /= i;
                }
            }
        }
    }
    cout << ++ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'bool IsPrime(ll)':
a.cc:27:13: error: expected unqualified-id before '=' token
   27 |     for (ll = 3; i <= sqrtNum; i += 2)
      |             ^
a.cc:27:12: error: expected ';' before '=' token
   27 |     for (ll = 3; i <= sqrtNum; i += 2)
      |            ^~
      |            ;
a.cc:27:13: error: expected primary-expression before '=' token
   27 |     for (ll = 3; i <= sqrtNum; i += 2)
      |             ^
a.cc:27:18: error: 'i' was not declared in this scope
   27 |     for (ll = 3; i <= sqrtNum; i += 2)
      |                  ^
a.cc:27:30: error: expected ')' before ';' token
   27 |     for (ll = 3; i <= sqrtNum; i += 2)
      |         ~                    ^
      |                              )
a.cc:27:32: error: 'i' was not declared in this scope
   27 |     for (ll = 3; i <= sqrtNum; i += 2)
      |                                ^
Language: C++

#![allow(unused_imports)]
#![allow(dead_code)]
use std::io::prelude::*;
use std::cmp::{max, min};
use std::collections::BinaryHeap;

const MOD: i64 = 1e9 as i64 + 7;

fn eratosthenes(p: &mut Vec<i64>, m: usize){
    let mut f: Vec<bool> = vec![true; m + 1];
    f[0] = false;
    f[1] = false;
    for i in 2..m + 1{
        if f[i]{
            p.push(i as i64);
        }
        let mut j = i * 2;
        while j <= m{
            f[j] = false;
            j += i;
        }
    }
}

fn is_prime(p: &Vec<i64>, x: i64) -> bool{
    for i in p.iter(){
        if *i >= x{
            break;
        }else if x % i == 0{
            return false;
        }
    }
    true
}

fn gcd(a: i64, b: i64) -> i64{
    if b == 0{
        a
    }else{
        gcd(b, a % b)
    }
}

fn main(){
    let a: i64 = read();
    let b: i64 = read();
    let mut p: Vec<i64> = vec![];
    eratosthenes(&mut p, 1e6 as usize);
    let g = gcd(a, b);
    let mut ans = 0;
    let mut i = 1;
    while i * i <= g{
        if g % i == 0{
            if is_prime(&p, i){ans += 1;}
            if i * i != g && is_prime(&p, g / i){ans += 1;}
        }
        i += 1;
    }
    if g > 1 && is_prime(&p, g){
        ans += 1;
    }
    println!("{}", ans);
}

fn read<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Compiler output:
a.cc:1:2: error: invalid preprocessing directive #!
    1 | #![allow(unused_imports)]
      |  ^
a.cc:2:2: error: invalid preprocessing directive #!
    2 | #![allow(dead_code)]
      |  ^
a.cc:13:14: error: too many decimal points in number
   13 |     for i in 2..m + 1{
      |              ^~~~
a.cc:3:1: error: 'use' does not name a type
    3 | use std::io::prelude::*;
      | ^~~
a.cc:4:1: error: 'use' does not name a type
    4 | use std::cmp::{max, min};
      | ^~~
a.cc:5:1: error: 'use' does not name a type
    5 | use std::collections::BinaryHeap;
      | ^~~
a.cc:7:10: error: found ':' in nested-name-specifier, expected '::'
    7 | const MOD: i64 = 1e9 as i64 + 7;
      |          ^
      |          ::
a.cc:7:7: error: 'MOD' does not name a type
    7 | const MOD: i64 = 1e9 as i64 + 7;
      |       ^~~
a.cc:9:1: error: 'fn' does not name a type
    9 | fn eratosthenes(p: &mut Vec<i64>, m: usize){
      | ^~
a.cc:25:1: error: 'fn' does not name a type
   25 | fn is_prime(p: &Vec<i64>, x: i64) -> bool{
      | ^~
a.cc:36:1: error: 'fn' does not name a type
   36 | fn gcd(a: i64, b: i64) -> i64{
      | ^~
a.cc:44:1: error: 'fn' does not name a type
   44 | fn main(){
      | ^~
a.cc:65:1: error: 'fn' does not name a type
   65 | fn read<T>() -> T
      | ^~
Language: C

#include <stdio.h>
#include <math.h>


int isprime(float x){
    for(float i = 2; i <= sqrt(x); i++){
        if (x % i == 0)
            return 0;
    }
    return 1;
}
int main(){
    float a,b,t = 0;

    scanf("%f%f", &a, &b);

    for(float i = 1; i <= a && i <= b; i ++){
        if(a % i == 0 && b % i == 0){
            a = a/i;
            b = b/i;
            if(isprime(i)){
                t++;
            }
        }
    }
    printf("%f",t);

    return 0;
}

Compiler output:
main.c: In function 'isprime':
main.c:7:15: error: invalid operands to binary % (have 'float' and 'float')
    7 |         if (x % i == 0)
      |               ^
main.c: In function 'main':
main.c:18:14: error: invalid operands to binary % (have 'float' and 'float')
   18 |         if(a % i == 0 && b % i == 0){
      |              ^
main.c:18:28: error: invalid operands to binary % (have 'float' and 'float')
   18 |         if(a % i == 0 && b % i == 0){
      |                            ^
Language: C++

#include <map>
#include <unordered_map>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <set>
using namespace std;

int main()
{
  int64_t a, b;
	cin >> a >> b;
	set<int> arr;
	for (auto i = 1; i <= sqrt(a) && i <= sqrt(b); i++)
	{
		if (a%i == 0 && b% i == 0)
		{
			if (a / i == i)
			{
				arr.insert(i);
			}
			else
			{
				if(b % (a/i) == 0)
					arr.insert(a / i);
				if(a % (b/i) == 0)
					arr.insert(b / i);
				arr.insert(i);
			}
		}
	}
	int sz1 = arr.size();
	int ret = 0;
	for (int i = 1 ; i <sz1-1;i++)
	{
		for(int j = i+1; j < sz1;j++)
		{
			if (_gcd(a, b))
				ret++;
		}
	}
	cout << ret;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: 'sqrt' was not declared in this scope
   16 |         for (auto i = 1; i <= sqrt(a) && i <= sqrt(b); i++)
      |                               ^~~~
a.cc:40:29: error: '_gcd' was not declared in this scope
   40 |                         if (_gcd(a, b))
      |                             ^~~~
Language: C++

#include<iostream>
#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(){
	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:8:47: error: expected primary-expression before ')' token
    8 | ll gcd(ll x, ll y) { return y? gcd(y,x%y) : x;)
      |                                               ^
a.cc:24:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   24 | int main(){
      |         ^~
a.cc:24:9: note: remove parentheses to default-initialize a variable
   24 | int main(){
      |         ^~
      |         --
a.cc:24:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:24:11: error: a function-definition is not allowed here before '{' token
   24 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:8:20: note: to match this '{'
    8 | ll gcd(ll x, ll y) { return y? gcd(y,x%y) : x;)
      |                    ^
Language: C++

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

int main() {
  string T;
  int i=0,j,,answer=0;
  long long A,B,g;
  
  cin >> A >> B ;
  
  g=__gcd(A,B);
  int *S = new int[g+1];

  for( i=1; i<=g; i++ ){
    if(g%i == 0 ){
        S[i]=1;
    }
  }

  for(i=2; i*i<=g; i++){
      if (S[i]==1)
      {
          for(j=2; i*j<=g; j++){
              S[i*j]=0;
          }
      }
  }

  for ( i = 1; i <= g; i++)
  {
      if (S[i]==1)
      {
  //cout << i <<endl;
          answer++;
      }
  }
  delete[] S;

  if (min(A,B)==0)
  {
      answer=0;
  }
  cout << answer <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected unqualified-id before ',' token
    7 |   int i=0,j,,answer=0;
      |             ^
Language: C++

#include<iostream>
#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,i);
  	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:8:47: error: expected primary-expression before ')' token
    8 | ll gcd(ll x, ll y) { return y? gcd(y,x%y) : x;)
      |                                               ^
a.cc:24:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   24 | int main(){
      |         ^~
a.cc:24:9: note: remove parentheses to default-initialize a variable
   24 | int main(){
      |         ^~
      |         --
a.cc:24:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:24:11: error: a function-definition is not allowed here before '{' token
   24 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:8:20: note: to match this '{'
    8 | ll gcd(ll x, ll y) { return y? gcd(y,x%y) : x;)
      |                    ^
Language: Java

import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long A = Long.parseLong(sc.next());
        long B = Long.parseLong(sc.next());
 
        long a = A;
        long b = B;
        if (A > B) {
            a = B;
            b = A;
        }
        int c = 1;
        double d = Math.sqrt(b);
        if ((a % 2 == 0) && (b % 2 == 0))
            c++;
        for (long i = 3; i<=d; i+=2) {
            if (a < i)
                break;
	    if ((a % 2 == 0) && (b % 2 == 0))
                double sqrtNum = Math.sqrt(i);
                boolean f = true;
                for (long j = 2; j<=sqrtNum; j++) {
                    if (i % j ==0) {
                        f = false;
                        break;
                    }
                }
                if (f)
                    c++;
            }
        }
        System.out.println(c);
    }
}

Compiler output:
Main.java:23: error: variable declaration not allowed here
                double sqrtNum = Math.sqrt(i);
                       ^
Main.java:35: error: <identifier> expected
        System.out.println(c);
                          ^
Main.java:35: error: <identifier> expected
        System.out.println(c);
                            ^
Main.java:37: error: class, interface, enum, or record expected
}
^
4 errors
Language: C++

¥#include <iostream>

using namespace std;
typedef long long ll;
int mv[100];

int main(){
    
    ll A,B;
    cin >> A >> B;
    if(A<B){
        ll tmp = A;
        A = B;
        B = tmp;
    }       
    int k = 0;
    for(ll i=1;i*i<=B;i++){
        if(A%i==0&&B%i==0){
            mv[k] = i;
            ++k;
        }
    }
    int count =0;
    for(int i=0;i<k;i++){
        bool ok = true;
        for(int j=2;j*j<=mv[i];j++){
            if(mv[i]%j==0){
                ok = false;
            }
        }
        if(ok)count++;
    }
    cout << count << endl;
    return 0;
}

Compiler output:
a.cc:1:1: error: extended character ¥ is not valid in an identifier
    1 | ¥#include <iostream>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | ¥#include <iostream>
      |  ^
a.cc:1:1: error: '\U000000a5' does not name a type
    1 | ¥#include <iostream>
      | ^
a.cc: In function 'int main()':
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> A >> B;
      |     ^~~
a.cc:33:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   33 |     cout << count << endl;
      |     ^~~~
      |     count
a.cc:33:22: error: 'endl' was not declared in this scope
   33 |     cout << count << endl;
      |                      ^~~~
Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long int
 #define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
int main(){
    ll n,m,g,cnt=1;
    cin>>n>>m;
  	g=__gcd(n,m);
  	  for(ll i=1; i*i<=g; i++){
    if(g%i==0){
      cnt++;
      while(g%i==0) g/=i;
    }
  }
  cout<<cnt;
}
    #include<bits/stdc++.h>
    using namespace std;
    #define ll long long int
 #define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
int main(){
    ll n,m,g,cnt=1;
    cin>>n>>m;
  	g=__gcd(n,m);
  	  for(ll i=2; i*i<=g; i++){
    if(g%i==0){
      cnt++;
      while(g%i==0) g/=i;
    }

Compiler output:
a.cc:23:5: error: redefinition of 'int main()'
   23 | int main(){
      |     ^~~~
a.cc:6:5: note: 'int main()' previously defined here
    6 | int main(){
      |     ^~~~
a.cc: In function 'int main()':
a.cc:31:6: error: expected '}' at end of input
   31 |     }
      |      ^
a.cc:27:35: note: to match this '{'
   27 |           for(ll i=2; i*i<=g; i++){
      |                                   ^
a.cc:31:6: error: expected '}' at end of input
   31 |     }
      |      ^
a.cc:23:11: note: to match this '{'
   23 | int main(){
      |           ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    //a,bの最大公約数を素因数分解して出てきた素数の種類数+1が答え
//cが素数の時は2が答え→勘違いしてた
//cが1の時は1が答え
//cが合成数の時は見つかり次第どんどん割ってく戦法で間に合う
    long c = gcd(a,b);
//    System.out.println(c);
    long answer = 1;
//    System.out.println(c);
    long tmp =0;
if(c==1){
System.out.println(1);
}else if(isPrime(c)){
System.out.println(2);
}else{
    for(long prime :primes(c)){
      if(tmp!=prime){
tmp=prime;
        if(isPrime(prime)){
//        System.out.println(prime);
// 素因数の約数のうち、素数or1だけカウントする
        answer = answer +1;
tmp=prime;
        }
      }
    }
    //なんで通らないケースあるんじゃーーーー
    System.out.println(answer);
}
  }
  
    //最大公約数
    static long gcd (long a, long b) {return b>0?gcd(b,a%b):a;}
  
//素数じゃない数を引数に、素因数分解してそいんすう列挙する
  static List<Long> primes(long c){ 
    List<Long> primenums= new ArrayList<Long>();
            long x = c;
            long y = x;
//       System.out.println(Math.floor(Math.sqrt(x))+2);
          for (long i = 2; i<=Math.sqrt(x)+1; i++) {
//            System.out.println(i);
//            boolean divflg=false;
            if ((y % i) == 0 ) {
//               if(!divflg){
                primenums.add(i);
//               }
//                divflg=true;
            }
            
        }
primenums.add(1);
    Collections.sort(primenums);
    return primenums;
  }
//素数判定
static boolean isPrime (long n) {
if (n==2) return true;
if (n%2==0) return false;
double d = Math.sqrt(n);
for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
 return true;
}
  
}


Compiler output:
Main.java:57: error: incompatible types: int cannot be converted to Long
primenums.add(1);
              ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

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

ll lcm(ll x, ll y) {
    return x*y / gcd(x,y);
}

int main(void)
{
    IOS
    ll a,b; cin >> a >> b;
    ll g = gcd(a,b);
    int ans = 1;
    for (ll i,g2,i = 2,g2 = g; i*i <= g && g2 != 1; i++) {
        if (g2 % i == 0) {
            ans++;
            while(g2 % i == 0) g2 /= i;
        }
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:18: error: redeclaration of 'll i'
   32 |     for (ll i,g2,i = 2,g2 = g; i*i <= g && g2 != 1; i++) {
      |                  ^
a.cc:32:13: note: 'll i' previously declared here
   32 |     for (ll i,g2,i = 2,g2 = g; i*i <= g && g2 != 1; i++) {
      |             ^
a.cc:32:24: error: redeclaration of 'll g2'
   32 |     for (ll i,g2,i = 2,g2 = g; i*i <= g && g2 != 1; i++) {
      |                        ^~
a.cc:32:15: note: 'll g2' previously declared here
   32 |     for (ll i,g2,i = 2,g2 = g; i*i <= g && g2 != 1; i++) {
      |               ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

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

ll lcm(ll x, ll y) {
    return x*y / gcd(x,y);
}

int main(void)
{
    IOS
    ll a,b; cin >> a >> b;
    ll g = gcd(a,b);
    int ans = 1;
    for (auto i = 2,g2 = g; i*i <= g && c != 1; i++) {
        if (g2 % i == 0) {
            ans++;
            while(g2 % i == 0) g2 /= i;
        }
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:10: error: inconsistent deduction for 'auto': 'int' and then 'long long int'
   32 |     for (auto i = 2,g2 = g; i*i <= g && c != 1; i++) {
      |          ^~~~
a.cc:32:41: error: 'c' was not declared in this scope
   32 |     for (auto i = 2,g2 = g; i*i <= g && c != 1; i++) {
      |                                         ^
Language: C++

#include<iostream>
#include<cstdlib>
#include<string>
#include<map>
#include<algorithm>
#include<vector>
#include<cmath>
typedef long long ll;

using namespace std;
ll gcd(ll a, ll b);
vector<pair<ll,int>>factorize(ll n);
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;
}

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

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


Compiler output:
a.cc:24:5: error: ambiguating new declaration of 'int gcd(ll, ll)'
   24 | int gcd(ll a, ll b){
      |     ^~~
a.cc:11:4: note: old declaration 'll gcd(ll, ll)'
   11 | ll gcd(ll a, ll b);
      |    ^~~
Language: C++

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

int limit;
int k;

bool judge(int a) {
	if (a == 1)return true;
	limit = (int)sqrt(a);
	for (k = 2; k <= limit; k++) {
		if (a % k== 0) break;
	}
	if (k == limit + 1) {
		return true;
	}
	else {
		return false;
	}
}

int main() {
	int i;
	int A = 0;
	int B = 0;
	int ans = 0;
	int count = 0;
	vector <int> h;

	cin >> A >> B;
	if (A >= B) {
		for (i = 1; i <= B; i++) {
			if (A % i == 0 && B % i == 0) {
				h.push_back(i);
				count += 1;
			}
		}
	}
	else {
		for (i = 1; i <= A; i++) {
			if (A % i == 0 && B % i == 0) {
				h.push_back(i);
				count += 1;
			}
		}
	}
	
	for (i = 0; i < count; i++) {
		if (judge(h[i]))	ans += 1;
	}
	cout << ans;
	
	return 0;
}

Compiler output:
a.cc: In function 'bool judge(int)':
a.cc:11:22: error: 'sqrt' was not declared in this scope
   11 |         limit = (int)sqrt(a);
      |                      ^~~~
Language: C++

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

Compiler output:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define umap std::unordered_map
#define uset std::unordered_set
#define _all(container) std::begin(container), std::end(container)
#define _in(container, value) (std::find(_all(container), value) != std::end(container))
#define _in_if(container, predicate) (std::find_if(_all(container), predicate) != std::end(container))
#define _count(container, value) (std::count(_all(container), value))
#define _count_if(container, predicate) (std::count(_all(container), predicate))
#define _odd(value) (value & 1)
#define _even(value) !(value & 1)
#define _for(i, n) for (int i = 0; i < n; ++i)
#define _FOR(i, k, n) for (int i = k; i <= n; ++i)
#define _FORR(i, k, n) for (int i = n; i >= k; --i)

template <typename DATA_TYPE> using V = std::vector<DATA_TYPE>;
template <typename DATA_TYPE> using VV = std::vector<std::vector<DATA_TYPE>>;
template <typename DATA_TYPE> using C = const DATA_TYPE;
using vint = V<int>;
using pint = std::pair<int, int>;
using vpint = V<pint>;
using vdouble = V<double>;
using cint = C<int>;
using cdouble = C<double>;
using Integer = long long;

template <class DATA_TYPE> umap<DATA_TYPE, int> factorize(DATA_TYPE n)
{
    umap<DATA_TYPE, int> res;
    for (auto i = 2; i * i <= n; ++i) {
        while (n % i == 0) {
            ++res[i], n /= i;
        }
    }

    if (n != 1) {
        ++res[n];
    }

    return res;
}

int main(int argc, char**)
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    Integer A, B;
    cin >> A >> B;

    auto mp = factorize(__gcd(a, b));
    cout << mp.size() + 1 << '\n';
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:53:31: error: 'a' was not declared in this scope
   53 |     auto mp = factorize(__gcd(a, b));
      |                               ^
a.cc:53:34: error: 'b' was not declared in this scope
   53 |     auto mp = factorize(__gcd(a, b));
      |                                  ^
Language: C++

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

int main(){
    ll a, b; cin >> a >> b;
    ll gcd;
    while(true){
        swap(a,b);
        b = b % a;
        if(b == 0){
            gcd = a;
            break;
        }
    }

    ll ans = 1;
    for (ll i = 2; i*i <= gcd; i++) {
        if(n % i == 0){
            ans++;
            while(gcd % i == 0){
                gcd /= i;
            }
        }
      	if(gcd == 1) break;
	}
    if(gcd != 1) ans++;

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:12: error: 'n' was not declared in this scope
   20 |         if(n % i == 0){
      |            ^
Language: C++

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

int main(){
    ll a, b; cin >> a >> b;
    ll gcd;
    while(true){
        swap(a,b);
        b = b % a;
        if(b == 0){
            gcd = a;
            break;
        }
    }

    ll ans = 1;
    for (ll i = 2; i*i <= n; i++) {
        if(n % i == 0){
            ans++;
            while(n % i == 0){
                n /= i;
            }
        }
      	if(n == 1) break;
	}
    if(n != 1) ans++;

    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:27: error: 'n' was not declared in this scope
   19 |     for (ll i = 2; i*i <= n; i++) {
      |                           ^
a.cc:28:8: error: 'n' was not declared in this scope
   28 |     if(n != 1) ans++;
      |        ^
Language: C++

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

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

vector<pair<long long, int>> factorize(long long n){
    vector<pair<long long, int>> res;
    for(long long 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(){
    long long a, b;
    cin >> a >> b;
    auto f = factorize(g);
    int ans = f.size() + 1;
    long long g = gcd(a, b);
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: 'g' was not declared in this scope
   22 |     auto f = factorize(g);
      |                        ^
Language: C++

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

int main() {
  int64_t A,B,C,ans=1;
  cin >> A >> B;
  while(B!=0){
    A%=B;
    swap(A,B);
  }
  C = A;
  if (C > 1) {
    for (int_64 i=1; i<C; i++) {
        if (C%(i+1) == 0) {
        ans++;
        while(C%(i+1)==0) {
        C /= i+1;
        }
      }
      if (C==1) {
        break;
      }
    }
  } 
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: 'int_64' was not declared in this scope; did you mean 'rintf64'?
   13 |     for (int_64 i=1; i<C; i++) {
      |          ^~~~~~
      |          rintf64
a.cc:13:22: error: 'i' was not declared in this scope
   13 |     for (int_64 i=1; i<C; i++) {
      |                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

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

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  lint a, b; cin >> a >> b;
  auto mp = factorize(__gcd(a, b));
  cout << mp.size() + 1 << '\n';
}


Compiler output:
a.cc: In function 'std::map<long long int, int> factorize(lint)':
a.cc:8:7: error: 'Z' was not declared in this scope
    8 |   map<Z, int> res;
      |       ^
a.cc:8:13: error: template argument 1 is invalid
    8 |   map<Z, int> res;
      |             ^
a.cc:8:13: error: template argument 3 is invalid
a.cc:8:13: error: template argument 4 is invalid
a.cc:9:9: error: expected ';' before 'i'
    9 |   for (Z i = 2; i * i <= n; ++i) while (n % i == 0) ++res[i], n /= i;
      |         ^~
      |         ;
a.cc:9:17: error: 'i' was not declared in this scope
    9 |   for (Z i = 2; i * i <= n; ++i) while (n % i == 0) ++res[i], n /= i;
      |                 ^
a.cc:10:20: error: invalid types 'int[lint {aka long long int}]' for array subscript
   10 |   if (n != 1) ++res[n];
      |                    ^
a.cc:11:10: error: could not convert 'res' from 'int' to 'std::map<long long int, int>'
   11 |   return res;
      |          ^~~
      |          |
      |          int
Language: C++

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define MODA 1000000007 



int main() {
	bool pr[1000001];
    REP(i, 1000001) pr[i] = true;
    pr[0] = false;
    pr[1] = false;
	int pi = 0;
	for(int i = 2; i <= 1000000; i++){ 
        if(pr[i] == true){
			pi++;
			for(int j = 2 * i; j <= 1000000; j+=i){
				pr[j] = false;
			}
		}
    }
	vector<int> primes;
	for(int i = 2; i <= 1000000; i++){
		if(pr[i]) primes.add(i);
	}
	
	ll A, B;
    cin >> A >> B;
    ll l = max(A, B), s = min(A, B);
	//cout << "input" << endl;
    while(s > 0){
        l = l % s;
        swap(s, l);
    } 
    ll gcd = l;
	ll now = gcd;
	int ans = 1;
    REP(i, primes.size()){
		//cout << primes[i] << endl;
		int w = primes[i];
		if(now % w == 0){
			ans++;
			while(now % w == 0){
				now /= w;
			}
		}
	}
	if(now > 1) ans++;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:34: error: 'class std::vector<int>' has no member named 'add'
   27 |                 if(pr[i]) primes.add(i);
      |                                  ^~~
Language: C++

#include <bits/stdc++.h>
using ll=long long;
using namespace std;
int main(){
    ll a,b,c,d,k=2;
    cin>>a>>b;
    c=__gcd(a,b),d=c;
    while(c>=k*k){
        if(c%k==0){while(c%k==0&&c>=k*k){c/=k;p[k]++;}}
        k++;
    }
    if(d!=1)cout<<p.size()+(ll)2;
    else cout<<"1";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:47: error: 'p' was not declared in this scope
    9 |         if(c%k==0){while(c%k==0&&c>=k*k){c/=k;p[k]++;}}
      |                                               ^
a.cc:12:19: error: 'p' was not declared in this scope
   12 |     if(d!=1)cout<<p.size()+(ll)2;
      |                   ^
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include <math.h>
using namespace std;

int main()
{
    long long A, B, f = 1;
    cin >> A >> B;
    long long r = B % A;
    while(r != 0)
    {
        B = A;
        A = r;
        r = B % A;
    }
    long long num = A;
    for(long long i = 2; i < sqrt(a) + 2; i++)
    {
        if(num % i == 0)
        {
            while(num % i == 0)
            {
                num /= i;
            }
            f++;
        }
        else if(num == 1) break;
        else continue;
    }
    if(num == 1) cout << f << endl;
    else cout << f + 1 << endl;
    return 0;
}
 

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

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include <math.h>
using namespace std;

int main()
{
    long long A, B, f = 1;
    cin >> A >> B;
    long long r = B % A;
    while(r != 0)
    {
        B = A;
        A = r;
        r = B % A;
    }
    long long num = a;
    for(long long i = 2; i < sqrt(a) + 2; i++)
    {
        if(num % i == 0)
        {
            while(num % i == 0)
            {
                num /= i;
            }
            f++;
        }
        else if(num == 1) break;
        else continue;
    }
    if(num == 1) cout << f << endl;
    else cout << f + 1 << endl;
    return 0;
}
 

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

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

bool is_prime(int _Num){
    if(_Num < 2)return false;
    if(_Num % 2 == 0){
        if(_Num == 2)return true;
        else return false;
    }
    bool prime = true;
    for(int i = 3; i <= sqrt(_Num); i += 2){
        if(_Num % i == 0){
            prime = false;
            break;
        }
    }
    return prime;
}

int main(){
    long long A, B;
    cin >> A >> B;
    set<long long> S;
    for(int i = 1; i <= sqrt(A); i++){
        if(A % i != 0)continue;
        long long j = A / i;
        if(is_prime(i))S.insert(i);
        if(is_prime(j))S.insert(j);
    }
    
    long long ans = 0;
    for(int i = 1; i <= sqrt(B); i++){
        if(B % i != 0)continue;
        long long j = B / i;
        if(S.count(i))ans++;
        if(i != j && S.sount(j))ans++;
    }
    
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:24: error: 'class std::set<long long int>' has no member named 'sount'; did you mean 'count'?
   36 |         if(i != j && S.sount(j))ans++;
      |                        ^~~~~
      |                        count
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cassert>
#include <utility>
#include <numeric>
#include <cstring>
#include <map>
#include <set>
using namespace std;
using ll = long long;
 
int gcd(ll a, ll b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
 
int lcm(ll a, ll b)
{
   return a * b / gcd(a, b);
}
 
int main(){
    ll a,b,c;
    cin >> a >> b;
    ll g = gcd(a,b);
    ll count =1;
    ll v=3;
 
    set<ll> ans;
    if (g%2==0){
        ans.insert(2);
    }
    while(g%2==0){
        g /= 2;
    }
 
    while(g>=v){
        if(g%v==0){
            ans.insert(v);
            g /= v;
        }
        else v += 2;
 
    }
 
    cout << ans.size() + 1;
    
 
 
}
#include <iostream>
#include <stdio.h>
#include <string>
#include <math.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cassert>
#include <utility>
#include <numeric>
#include <cstring>
#include <map>
#include <set>
using namespace std;
using ll = long long;

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



int main(){
    ll a,b,c;
    cin >> a >> b;
    ll g = gcd(a,b);
    ll count =1;
    ll v=3;

    set<ll> ans;
    if (g%2==0){
        ans.insert(2);
    }
    while(g%2==0){
        g /= 2;
    }

    while(g>=v){
        if(g%v==0){
            ans.insert(v);
            g /= v;
        }
        else v += 2;

    }

    cout << ans.size() + 1;
    


}



Compiler output:
a.cc:79:4: error: ambiguating new declaration of 'll gcd(ll, ll)'
   79 | ll gcd(ll a, ll b)
      |    ^~~
a.cc:17:5: note: old declaration 'int gcd(ll, ll)'
   17 | int gcd(ll a, ll b)
      |     ^~~
a.cc:93:5: error: redefinition of 'int main()'
   93 | int main(){
      |     ^~~~
a.cc:34:5: note: 'int main()' previously defined here
   34 | int main(){
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define uli unsigned long long int
#define INF 99999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define rrep(i,m,n) for(lli i=m-1;i>=n;i--)
#define pb(n) push_back(n)
#define UE(N) N.erase(unique(N.begin(),N.end()),N.end());
#define Sort(n) sort(n.begin(), n.end())
#define Rev(n) reverse(n.begin(),n.end())
#define Out(S) cout << S << endl
#define NeOut(S) cout << S
#define HpOut(S) cout << setprecision(20) << S << endl
#define Vec(K,L,N,S) vector<L> K(N,S)
#define DV(K,L,N,M,R) vector<vector<L>> K(N, vector<L>(M,R))
#define pint pair<lli,lli>
#define Lower(v,X) lower_bound(v.begin(),v.end(),X)-v.begin();
#define mod 1000000007
#define MAX 5100000
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
bool is_prime(lli x) {
  for(lli i=2;i*i<=x;i++){
    if(x%i==0)return false;
  }
  return x!=1;
}
lli gcd(lli num1, lli num2){
    return num2 != 0 ? gcd(num2, num1 % num2) : num1;
}
int main(){
  lli A,B,C,D,E,L,R,X,Y,W,H,N,M,K,sum=0,num=0,flag=0;string S,T;
  cin >> N >> K;
  N=gcd(N,K);
  rep(i,2,sqrt(N)+10){
    if(N%i==0&&is_prime(i)){
      sum++;N/=i;
    }
  Out(sum+1);
}

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

#include <bits/stdc++.h>
using namespace std;
map<ll,ll> p;
int main(){
    long a,b,c,d,k=2;
    cin>>a>>b;
    c=__gcd(a,b),d=c;
    while(c>=k*k){
        if(c%k==0&&c>=k*k)while(c%k==0&&c>=k*k){c/=k;p[k]++;}
        k++;
    }
    if(d!=1)cout<<p.size()+2;
    else cout<<1;
}

Compiler output:
a.cc:3:5: error: 'll' was not declared in this scope
    3 | map<ll,ll> p;
      |     ^~
a.cc:3:8: error: 'll' was not declared in this scope
    3 | map<ll,ll> p;
      |        ^~
a.cc:3:10: error: template argument 1 is invalid
    3 | map<ll,ll> p;
      |          ^
a.cc:3:10: error: template argument 2 is invalid
a.cc:3:10: error: template argument 3 is invalid
a.cc:3:10: error: template argument 4 is invalid
a.cc: In function 'int main()':
a.cc:9:55: error: invalid types 'int[long int]' for array subscript
    9 |         if(c%k==0&&c>=k*k)while(c%k==0&&c>=k*k){c/=k;p[k]++;}
      |                                                       ^
a.cc:12:21: error: request for member 'size' in 'p', which is of non-class type 'int'
   12 |     if(d!=1)cout<<p.size()+2;
      |                     ^~~~