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

#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <queue>
#include <queue>
#include <stack> 
#include <sstream>
#include <set>

typedef  long long ll;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = { 0, 1, 0,-1};
const int INF = 1e9;
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
int guki (int a){
    if(a%2==0) return 0;
    else return 1;
}
int gcd(int a, int b){
    if(a%b==0){
        return b;
    }else{
        return (gcd(b,a%b));
    }
}
int lcm(int a, int b){
    int x = gcd(a,b);
    return (a*b/x);
}

using namespace std;
ll k (ll a){
    a--;
    ll ans =0;
    while(a != 0){
        ans += a;
        a--;
        
    }
    return ans;
}


char grid[505][505];
int h,w;
pair<int, int> st,en;
int score[505][505];

void bfs(int x, int y){
    queue<pair<int, int>> Q;
    score[x][y] = 0;

    Q.push(make_pair(x,y));

    while(!Q.empty()){
        pair<int ,int> p = Q.front(); Q.pop();
        int hh = p.second;
        int ww = p.first;

        REP(i,4){
            int nx = ww + dr[i];
            int ny = hh + dc[i];

            if(nx < 0 || w <= nx || ny < 0 || h <= ny){
                continue;
            }

            if(grid[nx][ny] == '#' && score[nx][ny] > (score[x][y]+1)){
                Q.push(make_pair(nx,ny));
                score[nx][ny] = score[x][y] +1;
            }

            if(score[nx][ny] > (score[x][y] +1)  && grid[nx][ny] != '#'){
                Q.push(make_pair(nx,ny));
                score[nx][ny] = score[x][y];
            }
        }
    }
}

int n,m;
int a[1500];

int dfs(int x,int cnt,int i){
    if(cnt == 0) return x;
    if(x >= m) return 0;

    x = max(x,dfs(x+a[i],cnt-1,i+1));
    return x;
}

int main(){
    ll a,b,cnt = 0;
    cin >> a >> b;
    if(a > b) swap(a,b);
    if(a  == 1) {
        cout << 1 <<endl;
        return 0;
    }
    vector<bool> yaku(a/2+5);
    ll ma;
    

    for(lli=1;i<a/2+1;i++){
        if((a%i==0)&&(b%i==0)){
            yaku[i] =true;
            ma = i;
        }
    }

    for(ll i=2;i < ma+1;i++){
        if(yaku[i]){
            for(ll j= i+1;j < ma+1;j++){
                if(yaku[j]){
                    if(j % i == 0){
                        yaku[j] = false;
                    }
                }
            }
        }
    }

    for(ll i=0;i < ma+1;i++){
        if(yaku[i]) cnt ++;
    }

    cout << cnt <<endl;
    
}   






Compiler output:
a.cc: In function 'int main()':
a.cc:113:9: error: 'lli' was not declared in this scope; did you mean 'll'?
  113 |     for(lli=1;i<a/2+1;i++){
      |         ^~~
      |         ll
a.cc:113:15: error: 'i' was not declared in this scope
  113 |     for(lli=1;i<a/2+1;i++){
      |               ^
Language: C++

//============================================================================
//Everyone has a different way of thinking, so God Created us
//   Hope You Respect My Way..,Thank You ):
// Author      : Murad
// Name        : Codeforces.cpp & Atcoder.cpp
// Description : Problem name
//============================================================================
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define pi 3.1415926536
#define forn(i,a,b)for(int i=a;i<b;i++)
#define LL long long
#define ULL unsigned long long
#define MP make_pair
#define ff first
#define ss second
#define endl '\n'
#define INF 1e9 + 1
#define _INF INT32_MIN
#define PQ priority_queue
#define MM multimap
#define PB push_back
#define vii vector<int>
#define ipair pair<int,int>
#define lpair pair<LL,LL>
#define MAXN 100004
#define El3zba ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define modd 1000000007
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
//std::transform(s1.begin(), s1.end(), s1.begin(),::tolower);
char alphz[27] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };
map<LL,LL>mpp;
float Euclidean(LL x1, LL x2, LL y1, LL y2) {
	return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
LL gcd(LL a,LL b) {
	return !b ? a : gcd(b, a % b);
}
LL LCM(LL a, LL b) {
	return (a*b) / gcd(a, b);
}
void PrimeFactor(LL n)
{
	while (n % 2 == 0) {
	//	printf("%d ", 2);
		aa.insert(2);
		n /= 2;
	}
	for (int i = 3; i <= sqrt(n); i += 2)
	{
		if (n%i == 0) {
			//printf("%d ", i);
			aa.insert(i);
			n /= i;
		}
	}
	if (n > 2){
		//printf("%d ", n)
		aa.insert(n);
	};
}
bool is_square(LL x) {
	LL l = 0, r = x;
	while (l <= r) {
		LL mid = l + (r - l) / 2;
		if (mid*mid == x)return true;
		if (mid*mid > x)r = mid - 1;
		else l = mid + 1;
	}
	return false;
}
LL power(LL x, LL y)
{
	LL temp;
	if (y == 0)return 1;
	temp = power(x, y / 2);
	if (y % 2 == 0)
		return temp*temp;
	else return x*temp*temp;
}
bool is_Prime(int x) {
	if (x == 2)return 1;
	else if (x % 2 == 0 || x < 2)return 0;
	for (int i = 3; i*i <= x; i += 2)
		if (x%i == 0)return 0;
	return 1;
}
int main()
{
	El3zba;
	/***  بسم الله الرحمن الرحيم   ***/
	LL a, b;
	scanf("%lld%lld", &a, &b);
	LL ans = gcd(a, b);
	int cnt = 1;
	for (int i = 2; i*i <= ans; i++)
	{
		while (ans%i == 0)
		{
			if (mpp[i] > 0)continue;
			else cnt++;
			mpp[i]++;
			ans /= i;
		}
	}
	if (ans != 1)
		cnt++;
	cout <<cnt<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'void PrimeFactor(long long int)':
a.cc:50:17: error: 'aa' was not declared in this scope
   50 |                 aa.insert(2);
      |                 ^~
a.cc:57:25: error: 'aa' was not declared in this scope
   57 |                         aa.insert(i);
      |                         ^~
a.cc:63:17: error: 'aa' was not declared in this scope
   63 |                 aa.insert(n);
      |                 ^~
Language: C++

//============================================================================
//Everyone has a different way of thinking, so God Created us
//   Hope You Respect My Way..,Thank You ):
// Author      : Murad
// Name        : Codeforces.cpp & Atcoder.cpp
// Description : Problem name
//============================================================================
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define pi 3.1415926536
#define forn(i,a,b)for(int i=a;i<b;i++)
#define LL long long
#define ULL unsigned long long
#define MP make_pair
#define ff first
#define ss second
#define endl '\n'
#define INF 1e9 + 1
#define _INF INT32_MIN
#define PQ priority_queue
#define MM multimap
#define PB push_back
#define vii vector<int>
#define ipair pair<int,int>
#define lpair pair<LL,LL>
#define MAXN 100004
#define El3zba ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define modd 1000000007
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
//std::transform(s1.begin(), s1.end(), s1.begin(),::tolower);
char alphz[27] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };
map<LL,LL>mpp;
float Euclidean(LL x1, LL x2, LL y1, LL y2) {
	return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
LL gcd(LL a,LL b) {
	return !b ? a : gcd(b, a % b);
}
LL LCM(LL a, LL b) {
	return (a*b) / gcd(a, b);
}
void PrimeFactor(LL n)
{
	while (n % 2 == 0) {
	//	printf("%d ", 2);
		aa.insert(2);
		n /= 2;
	}
	for (int i = 3; i <= sqrt(n); i += 2)
	{
		if (n%i == 0) {
			//printf("%d ", i);
			aa.insert(i);
			n /= i;
		}
	}
	if (n > 2){
		//printf("%d ", n)
		aa.insert(n);
	};
}
bool is_square(LL x) {
	LL l = 0, r = x;
	while (l <= r) {
		LL mid = l + (r - l) / 2;
		if (mid*mid == x)return true;
		if (mid*mid > x)r = mid - 1;
		else l = mid + 1;
	}
	return false;
}
LL power(LL x, LL y)
{
	LL temp;
	if (y == 0)return 1;
	temp = power(x, y / 2);
	if (y % 2 == 0)
		return temp*temp;
	else return x*temp*temp;
}
bool is_Prime(int x) {
	if (x == 2)return 1;
	else if (x % 2 == 0 || x < 2)return 0;
	for (int i = 3; i*i <= x; i += 2)
		if (x%i == 0)return 0;
	return 1;
}
int main()
{
	El3zba;
	/***  بسم الله الرحمن الرحيم   ***/
	LL a, b;
	scanf("%lld%lld", &a, &b);
	LL ans = gcd(a, b);
	int cnt = 1;
	for (int i = 2; i*i <= ans; i++)
	{
		while (ans%i == 0)
		{
			if (mpp[i] > 0)continue;
			else cnt++;
			ans /= i;
		}
	}
	if (ans != 1)
		cnt++;
	cout <<cnt<< endl;
	return 0;
}

Compiler output:
a.cc: In function 'void PrimeFactor(long long int)':
a.cc:50:17: error: 'aa' was not declared in this scope
   50 |                 aa.insert(2);
      |                 ^~
a.cc:57:25: error: 'aa' was not declared in this scope
   57 |                         aa.insert(i);
      |                         ^~
a.cc:63:17: error: 'aa' was not declared in this scope
   63 |                 aa.insert(n);
      |                 ^~
Language: C++

module Main where

import Data.List
import Control.Monad
import Debug.Trace
import qualified Data.ByteString.Char8 as BC
import Data.Maybe (fromJust)


readTuple2 :: IO (Int, Int)
readTuple2 = do
    [a, b] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b)

readTuple3 :: IO (Int, Int, Int)
readTuple3 = do
    [a, b, c] <- map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine
    return (a, b, c)

readInt :: IO Int
readInt = fst . fromJust . BC.readInt <$> BC.getLine

readInts :: IO [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

split :: (a -> Bool) -> [a] -> [[a]]
split f [] = []
split f as = let
    (fo, la) = span f as
    las = case la of
        [] -> []
        xs -> split f $ tail xs
    in
        case fo of
            [] -> las
            xs -> xs : las
solve :: [Int] -> [Int]
solve as = 
    fst <$> (sortOn snd $ zip [1..] as)


divMax :: Int -> Int -> (Int, Int)
divMax a b = go a 0 where
    go acc n = let
        (x, y) = acc `divMod` b
        in
            if y == 0 then go x (n + 1) else (acc, n)

primeNums :: Int -> [(Int, Int)]
primeNums a = if last == 1 then reverse primeList else reverse $ (last, 1) : primeList where
    findMax = floor . sqrt . fromIntegral $ a
    go (acc, lst) divisor = 
        let
            (dividedNum, count) = acc `divMax` divisor
        in
            if count == 0 then (acc, lst) else (dividedNum, (divisor, count) : lst)
    (last, primeList)  = foldl' go (a, []) [2..findMax]
    
main = do
    (a, b) <- readTuple2
    print $ (+1) . length $ intersect (fst <$> primeNums a) (fst <$> primeNums b)

Compiler output:
a.cc:39:32: error: too many decimal points in number
   39 |     fst <$> (sortOn snd $ zip [1..] as)
      |                                ^~~
a.cc:45:22: error: stray '`' in program
   45 |         (x, y) = acc `divMod` b
      |                      ^
a.cc:45:29: error: stray '`' in program
   45 |         (x, y) = acc `divMod` b
      |                             ^
a.cc:54:39: error: stray '`' in program
   54 |             (dividedNum, count) = acc `divMax` divisor
      |                                       ^
a.cc:54:46: error: stray '`' in program
   54 |             (dividedNum, count) = acc `divMax` divisor
      |                                              ^
a.cc:57:31: warning: missing terminating ' character
   57 |     (last, primeList)  = foldl' go (a, []) [2..findMax]
      |                               ^
a.cc:57:31: error: missing terminating ' character
   57 |     (last, primeList)  = foldl' go (a, []) [2..findMax]
      |                               ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:1:1: error: 'module' does not name a type
    1 | module Main where
      | ^~~~~~
a.cc:1:1: note: C++20 'module' only available with '-fmodules-ts'
Language: Java

    static final int LIMIT = 1000000;

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

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

        long A = sc.nextLong();
        long B = sc.nextLong();
        long d = gcd(A, B);

        boolean[] prime = new boolean[LIMIT + 1];
        Arrays.fill(prime, true);

        int sol = 1;
        for (int i = 2; i <= Math.min(LIMIT, d); i++) {
            if (!prime[i]) continue;
            if (d % i == 0) sol++;
            for (int j = i; j < prime.length; j += i) prime[j] = false;
        }

        if (sol == 1) sol = d == 1 ? 1 : 2;
        System.out.println(sol);
    }
}

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
    static final int LIMIT = 1000000;
                 ^
  (use --enable-preview to enable unnamed classes)
Main.java:29: error: class, interface, enum, or record expected
}
^
2 errors
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.StringJoiner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long A = scan.nextLong();
        long B = scan.nextLong();
        long gcd = gcd(A, B);
        Map<Integer, Integer> map = divisors(gcd);
        System.out.println(map.size() + 1);
    }
    private Map<Long, Long> divisors(int N) {
        Map<Long, Long> result = new HashMap<>();
        for (long i = 2; i <= N; i++) {
            if (N % i != 0) {
                continue;
            }
            long count = 0;
            while (N % i == 0) {
                count += 1;
                N /= i;
            }
            result.put(i, count);
        }
        return result;
    }
    private long gcd(long A, long B) {
        if (B == 0) {
            return A;
        }
        return gcd(B,A % B);
    }
}


Compiler output:
Main.java:18: error: incompatible types: possible lossy conversion from long to int
        Map<Integer, Integer> map = divisors(gcd);
                                             ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'gcd' was not declared in this scope
   10 |   int g = gcd(a,b);
      |           ^~~
Language: C++

#include <iostream>
#include <vector>

template <typename T>
T gcd(T x, T y)
{
	return y == 0 ? x : gcd(y, x % y);
}

template <typename T>
std::vector<T> EratosthenesSieve(T n)
{
	std::vector<T> prime_numbers;

	std::vector<char> sieve(n + 1, 1);
	for (T i = 2; i <= n; ++i)
	{
		if (sieve.at(i) == 1)
		{
			prime_numbers.push_back(i);
			for (T j = i; j <= n; j += i)
			{
				sieve.at(j) = 0;
			}
		}
	}

	return std::move(prime_numbers);
}

template <typename T>
std::vector<std::pair<T, int>> primeFactorization(T n)
{
	std::vector<std::pair<T, int>> answer;

	std::vector<T> prime_numbers = EratosthenesSieve(static_cast<T>(std::sqrt(n)));
	for (T prime_number : prime_numbers)
	{
		if (prime_number * prime_number > n)
		{
			break;
		}

		if (n % prime_number != 0)
		{
			continue;
		}

		answer.emplace_back(prime_number, 0);
		do
		{
			n /= prime_number;
			answer.back().second++;
		} while (n % prime_number == 0);
	}

	if (n != 1)
	{
		answer.emplace_back(n, 1);
	}

	return std::move(answer);
}

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

	auto g = gcd(A, B);
	auto pf = primeFactorization(g);

	std::cout << pf.size() + 1;

	return 0;
}

Compiler output:
a.cc: In function 'std::vector<std::pair<T, int> > primeFactorization(T)':
a.cc:36:78: error: 'sqrt' is not a member of 'std'
   36 |         std::vector<T> prime_numbers = EratosthenesSieve(static_cast<T>(std::sqrt(n)));
      |                                                                              ^~~~
Language: C++

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

using lli = long long int;

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

template <class T>ostream &operator<<(ostream &o,const pair<T, T>&p)
{o<<"("<<p.first<<", "<<p.second<<")";return o;}

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

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

int main(void){
    lli a, b;
    cin >> a >> b;
    auto ma = prime_factor(a);
    auto mb = prime_factor(b);
    lli c = 1;
    for(auto i : ma){
        if(i.second > 0) if(b[i.first] > 0) c++;
    }
    cout << c << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:30: error: invalid types 'lli {aka long long int}[const long int]' for array subscript
   41 |         if(i.second > 0) if(b[i.first] > 0) c++;
      |                              ^
Language: C++

namespace
{
	ll GCD(ll a, ll b)
	{
		return a == 0 ? b : GCD(b % a, a);
	}
}

void ABC142D()
{
	ll A, B;
	cin >> A >> B;
	ll C = GCD(A, B);
	ll sqrtC = static_cast<ll>(sqrt(static_cast<long double>(C)));

	vector<ll> x;
	x.push_back(1);
	int i = 2;
	while (i <= C)
	{
		while (C % i == 0)
		{
			if(x.back() != i)
				x.push_back(i);
			C /= i;
		}
		++i;
	}
	int N = x.size();
	cout << N << endl;
}
int main()
{
	ABC142D();
	return 0;
}

Compiler output:
a.cc:3:9: error: 'll' does not name a type
    3 |         ll GCD(ll a, ll b)
      |         ^~
a.cc: In function 'void ABC142D()':
a.cc:11:9: error: 'll' was not declared in this scope
   11 |         ll A, B;
      |         ^~
a.cc:12:9: error: 'cin' was not declared in this scope
   12 |         cin >> A >> B;
      |         ^~~
a.cc:12:16: error: 'A' was not declared in this scope
   12 |         cin >> A >> B;
      |                ^
a.cc:12:21: error: 'B' was not declared in this scope
   12 |         cin >> A >> B;
      |                     ^
a.cc:13:11: error: expected ';' before 'C'
   13 |         ll C = GCD(A, B);
      |           ^~
      |           ;
a.cc:14:11: error: expected ';' before 'sqrtC'
   14 |         ll sqrtC = static_cast<ll>(sqrt(static_cast<long double>(C)));
      |           ^~~~~~
      |           ;
a.cc:16:9: error: 'vector' was not declared in this scope
   16 |         vector<ll> x;
      |         ^~~~~~
a.cc:16:20: error: 'x' was not declared in this scope
   16 |         vector<ll> x;
      |                    ^
a.cc:19:21: error: 'C' was not declared in this scope
   19 |         while (i <= C)
      |                     ^
a.cc:30:9: error: 'cout' was not declared in this scope
   30 |         cout << N << endl;
      |         ^~~~
a.cc:30:22: error: 'endl' was not declared in this scope
   30 |         cout << N << endl;
      |                      ^~~~
Language: C++

#include <iostream>

// 最大公約数を求める
template <typename T>
inline T gcd(T a, T b) noexcept {
   if (a < b) std::swap(a, b);
  while (b > 0) {
    const T tmp = a % b;
    a = b;
    b = tmp;
  }
  return a;
}

// 公約数は最大公約数の素因数から組み合わせられる値である。（gcd = 2^a * 3^b * 5^c * ...）
// 選ばれる約数は他すべてと互いに素となるので、素因数が重複する値は選べない。（2を選ぶと4や6は選べなくなる）
// 問題とされるのは最大の個数なので、素因数をひとつだけ持つ値を選ぶと良い。（6を選ぶより2と3を選ぶほうが個数が多い）
// ⇒最大公約数の素因数の数を数えれば良い。
//
// Tips:
// - mから素因数由来の要素を取り除くことでループ回数を最適化する
// - AとBは10^12>2^32なので64ビット整数を使う
// - 最終的にmは素数の累乗になるので、ループ回数をsqrt(m)回とすることができる
//    - 素因数が2つ以上含まれている場合、少なくともi^2よりは大きいので必ず処理される
int main_D() {
  uint64_t A, B;
  std::cin >> A >> B;

  // 最大公約数を求める
  uint64_t m = gcd(A, B);

  // 最大公約数の素因数の個数を数える
  // 最終的にmは素数の累乗となるので、ループは少なくとも√m回繰り返せば良い
  uint64_t result = 1;  // 1は必ず選ばれるので、あらかじめ加えておく
  for (uint64_t i = 2; i * i <= m; ++i) {
    // 素因数かどうかを調べる
    if (m % i == 0) {
      result++;

      // mからiの累乗を取り除く
      do {
        m /= i;
      } while (m % i == 0);
    }
  }

  // mが余ればそれは素数なので、素因数として計上する
  if (m > 0) result++;

  // 結果発表
  std::cout << result;

  return 0;
}


Compiler output:
a.cc: In function 'int main_D()':
a.cc:26:3: error: 'uint64_t' was not declared in this scope
   26 |   uint64_t A, B;
      |   ^~~~~~~~
a.cc:2:1: note: 'uint64_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    1 | #include <iostream>
  +++ |+#include <cstdint>
    2 | 
a.cc:27:15: error: 'A' was not declared in this scope
   27 |   std::cin >> A >> B;
      |               ^
a.cc:27:20: error: 'B' was not declared in this scope
   27 |   std::cin >> A >> B;
      |                    ^
a.cc:30:11: error: expected ';' before 'm'
   30 |   uint64_t m = gcd(A, B);
      |           ^~
      |           ;
a.cc:34:11: error: expected ';' before 'result'
   34 |   uint64_t result = 1;  // 1は必ず選ばれるので、あらかじめ加えておく
      |           ^~~~~~~
      |           ;
a.cc:35:16: error: expected ';' before 'i'
   35 |   for (uint64_t i = 2; i * i <= m; ++i) {
      |                ^~
      |                ;
a.cc:35:24: error: 'i' was not declared in this scope
   35 |   for (uint64_t i = 2; i * i <= m; ++i) {
      |                        ^
a.cc:35:33: error: 'm' was not declared in this scope; did you mean 'tm'?
   35 |   for (uint64_t i = 2; i * i <= m; ++i) {
      |                                 ^
      |                                 tm
a.cc:38:7: error: 'result' was not declared in this scope
   38 |       result++;
      |       ^~~~~~
a.cc:48:7: error: 'm' was not declared in this scope; did you mean 'tm'?
   48 |   if (m > 0) result++;
      |       ^
      |       tm
a.cc:48:14: error: 'result' was not declared in this scope
   48 |   if (m > 0) result++;
      |              ^~~~~~
a.cc:51:16: error: 'result' was not declared in this scope
   51 |   std::cout << result;
      |                ^~~~~~
Language: C++

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

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

}

#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 ans = factorize(g);
    cout <<ans.size()+1<<endl;
    return 0;
}


Compiler output:
a.cc:36:4: error: redefinition of 'll gcd(ll, ll)'
   36 | ll gcd(ll x, ll y) { return y ? gcd(y,x%y) : x;}
      |    ^~~
a.cc:12:4: note: 'll gcd(ll, ll)' previously defined here
   12 | ll gcd(ll x, ll y){
      |    ^~~
a.cc:38:22: error: redefinition of 'std::vector<std::pair<long long int, int> > factorize(ll)'
   38 | vector<pair<ll,int>> factorize(ll n) {
      |                      ^~~~~~~~~
a.cc:16:23: note: 'std::vector<std::pair<long long int, int> > factorize(ll)' previously defined here
   16 | vector<pair<ll,int> > factorize(ll n){
      |                       ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a,b,cnt=0;
ll gcd(ll x,ll y)
{
	while(y)
	{
		long long tmp=x%y;
		x=y;
		y=tmp;
	}
	return x;
}
bool isprime(ll x)
{
	for(ll i=2;i*i<=x;i++)
		if(x%i==0)
			return false;
	return true;
}
int main()
{
	cin>>a>>b;
	ll x=gcd(a,b);
	if(a==1||b==1)
	{
		cout<<1<<endl;
		return 0;
	}
	if(x==1)
	{
		cout<<2<<endl;
		return 0;
	}
	if(isprime(x))
	{
		cout<<2<<endl;
		return 0;
	}
	for(ll i=2;i*i<=x;i++)
	{
		if(x%i)
			continue;
		++cnt;
		while(1)
		{
			if(x%i)
				break;weeee
			x/=i;
		}
		if(isprime(x))
		{
			++cnt;
			break;
		}
	}
	cout<<++cnt<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:39: error: 'weeee' was not declared in this scope
   49 |                                 break;weeee
      |                                       ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << ": " << x << '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a, b, n, cnt = 0;
  cin >> a >> b;
  n = __gcd(a, b);
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      cnt++;
    
      while(n % i == 0) {
        n /= i;
      }  
    }
  }
  if (n != 1) {
    cnt++;
  }
  cout << cnt << '\n';
  debug(vec.size());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'vec' was not declared in this scope
   26 |   debug(vec.size());
      |         ^~~
a.cc:5:40: note: in definition of macro 'debug'
    5 | #define debug(x) cerr << #x << ": " << x << '\n';
      |                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << ": " << x << '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a, b, n, cnt = 0;
  cin >> a >> b;
  n = __gcd(a, b);
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      cnt++;
    }
    while(n % i == 0) {
      n /= i;
    }
    
  }
  if (n != 1) {
    cnt++;
  }
  cout << cnt << '\n';
  debug(vec.size());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:9: error: 'vec' was not declared in this scope
   26 |   debug(vec.size());
      |         ^~~
a.cc:5:40: note: in definition of macro 'debug'
    5 | #define debug(x) cerr << #x << ": " << x << '\n';
      |                                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << ": " << x << '\n';

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll a, b, n, cnt = 0;
  cin >> a >> b;
  n = __gcd(a, b);
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      cnt++;
     while(n % i == 0) {
       n /= i;
     }
    }
  }
  if (n != 1) {
    cnt++;
  }
  cout << cnt << '\n';
  debug(vec.size());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'vec' was not declared in this scope
   25 |   debug(vec.size());
      |         ^~~
a.cc:5:40: note: in definition of macro 'debug'
    5 | #define debug(x) cerr << #x << ": " << x << '\n';
      |                                        ^
Language: C++

#include <iostream>
#include <vector>

// 最大公約数を求める
inline int gcd(int a, int b) noexcept {
  while (true) {
    if (a < b) std::swap(a, b);
    if (b <= 0) break;
    a %= b;
  }
  return a;
}

// 公約数は最大公約数の素因数から組み合わせられる値である。（gcd = 2^a * 3^b * 5^c * ...）
// 選ばれる約数は他すべてと互いに素となるので、素因数が重複する値は選べない。（2を選ぶと4や6は選べなくなる）
// 問題とされるのは最大の個数なので、素因数をひとつだけ持つ値を選ぶと良い。（6を選ぶより2と3を選ぶほうが個数が多い）
// ⇒最大公約数の素因数の数を数えれば良い。
int main() {
  int A, B;
  std::cin >> A >> B;

  // 最大公約数を求める
  const int m = gcd(A, B);

  // 最大公約数の素因数の個数を数える
  std::vector<int> factors;  // 素因数
  factors.reserve(static_cast<int>(sqrt(m)) + 1);
  for (int i = 2; i * i <= m; ++i) {
    // 素因数の累乗かどうかを調べる
    bool failed = false;
    for (const auto& factor : factors) {
      if (i % factor == 0) {
        failed = true;
        break;
      }
    }
    if (failed) continue;

    // 素因数かどうかを調べる
    if (m % i == 0) {
      factors.push_back(i);
    }
  }

  // 結果発表
  // 1は必ず選ばれるので、個数+1
  std::cout << (factors.size() + 1);

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:36: error: 'sqrt' was not declared in this scope
   27 |   factors.reserve(static_cast<int>(sqrt(m)) + 1);
      |                                    ^~~~
Language: C++

#include <iostream>
#include <vector>

// 最大公約数を求める
inline int gcd(int a, int b) noexcept {
  while (true) {
    if (a < b) std::swap(a, b);
    if (b <= 0) break;
    a -= b;
  }
  return a;
}

// 公約数は最大公約数の素因数から組み合わせられる値である。（gcd = 2^a * 3^b * 5^c * ...）
// 選ばれる約数は他すべてと互いに素となるので、素因数が重複する値は選べない。（2を選ぶと4や6は選べなくなる）
// 問題とされるのは最大の個数なので、素因数をひとつだけ持つ値を選ぶと良い。（6を選ぶより2と3を選ぶほうが個数が多い）
// ⇒最大公約数の素因数の数を数えれば良い。
int main_D() {
  int A, B;
  std::cin >> A >> B;

  // 最大公約数を求める
  const int m = gcd(A, B);

  // 最大公約数の素因数の個数を数える
  size_t result = 1;  // 1は必ず含まれるのであらかじめ計上する
  std::vector<bool> sieve(m - 1);  // エラトステネスの篩
  for (int i = 2; i <= m; ++i) {
    if (!sieve[i - 2] && m % i == 0) {
      result++;

      // 素数でない値にチェックを入れる
      for (int j = i; j <= m; j += i) {
        sieve[j - 2] = true;
      }
    }
  }

  // 結果発表
  std::cout << result;

  return 0;
}


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 <iostream>
#include <algorithm>
using namespace std;
long long a,b,c,d[100000000000],e,k,usg;
int main() {
  cin>>a>>b;
  if(a==1){
    cout<<"1";
    return 0;
  };
  if(b==1){
    cout<<"1";
    return 0;
  }
  usg= __gcd(a,b);
  while(usg!=1){
    for(k=2;k<=usg;k++)
    if(usg%k==0)
    break;
    d[k]++;
    usg=usg/k;
  };
  for(k=1;k<=10000000000;k++){
    if(d[k]>0) e++;
  };
  cout<<e;
}

Compiler output:
/tmp/cclfcY8d.o: in function `main':
a.cc:(.text+0xae): relocation truncated to fit: R_X86_64_PC32 against symbol `usg' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xba): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xc7): relocation truncated to fit: R_X86_64_PC32 against symbol `usg' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xce): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xe5): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xf0): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xf7): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0xfe): relocation truncated to fit: R_X86_64_PC32 against symbol `usg' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0x10d): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0x13e): relocation truncated to fit: R_X86_64_PC32 against symbol `usg' defined in .bss section in /tmp/cclfcY8d.o
a.cc:(.text+0x145): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>
using namespace std;
ll c[100000005],p,ans;
typedef long long ll;
map<ll,ll> a;
int check(ll x)
{
	for(ll i=2;i*i<=x;i++)
	if(x%i==0)
	return 0;
	return 1;
}
int main()
{
	ll x,y;
	cin>>x>>y;
	for(ll i=1;i*i<=x;i++)
	if(x%i==0)
	{
		a[i]++;
		if(i!=x/i)
		a[x/i]++;
	}
	for(ll i=1;i*i<=y;i++)
	if(y%i==0)
	{
		a[i]++;
		if(i!=y/i)
		a[y/i]++;
		if(a[i]==2)
		c[++p]=i;
		if(a[y/i]==2)
		c[++p]=y/i;
	}
	sort(c+1,c+1+p);
	for(ll i=2;i<=p;i++)
	if(check(c[i])&&c[i]>1)
	ans++;
	cout<<(ans+1);
}

Compiler output:
a.cc:3:1: error: 'll' does not name a type
    3 | ll c[100000005],p,ans;
      | ^~
a.cc: In function 'int main()':
a.cc:31:17: error: 'c' was not declared in this scope
   31 |                 c[++p]=i;
      |                 ^
a.cc:31:21: error: 'p' was not declared in this scope
   31 |                 c[++p]=i;
      |                     ^
a.cc:33:17: error: 'c' was not declared in this scope
   33 |                 c[++p]=y/i;
      |                 ^
a.cc:33:21: error: 'p' was not declared in this scope
   33 |                 c[++p]=y/i;
      |                     ^
a.cc:35:14: error: 'c' was not declared in this scope
   35 |         sort(c+1,c+1+p);
      |              ^
a.cc:35:22: error: 'p' was not declared in this scope
   35 |         sort(c+1,c+1+p);
      |                      ^
a.cc:38:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   38 |         ans++;
      |         ^~~
      |         abs
a.cc:39:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |         cout<<(ans+1);
      |                ^~~
      |                abs
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);
    res.push_back(i,0);
    while (n%i == 0) {
      n /= i;
      res.back().second++;
    }
  }
  //if (n != 1) res.emplace_back(n,1);
  if (n != 1) res.push_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 'std::vector<std::pair<long long int, int> > factorize(ll)':
a.cc:13:18: error: no matching function for call to 'std::vector<std::pair<long long int, int> >::push_back(ll&, int)'
   13 |     res.push_back(i,0);
      |     ~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, int>; _Alloc = std::allocator<std::pair<long long int, int> >; value_type = std::pair<long long int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, int>; _Alloc = std::allocator<std::pair<long long int, int> >; value_type = std::pair<long long int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
a.cc:20:28: error: no matching function for call to 'std::vector<std::pair<long long int, int> >::push_back(ll&, int)'
   20 |   if (n != 1) res.push_back(n,1);
      |               ~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<long long int, int>; _Alloc = std::allocator<std::pair<long long int, int> >; value_type = std::pair<long long int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<long long int, int>; _Alloc = std::allocator<std::pair<long long int, int> >; value_type = std::pair<long long int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided
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){
    long z;

    if (*x < *y){
        change(x, y);
    }

    while(*x % *y){
        z = *x % *y;
        *x = *y;
        *y = z;
    }
}

int main(){
    long a,b;
    int t = 1;

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

    gcd(&a, &b);
   
    for(long i = 2; i <= gcd(b); i ++){
        if(b % i == 0){
            while(b % i == 0){
                b /= i;
            }

            t++;
        }
    }
    printf("%d",t);

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:32:30: error: passing argument 1 of 'gcd' makes pointer from integer without a cast [-Wint-conversion]
   32 |     for(long i = 2; i <= gcd(b); i ++){
      |                              ^
      |                              |
      |                              long int
main.c:10:16: note: expected 'long int *' but argument is of type 'long int'
   10 | void gcd(long* x, long* y){
      |          ~~~~~~^
main.c:32:26: error: too few arguments to function 'gcd'
   32 |     for(long i = 2; i <= gcd(b); i ++){
      |                          ^~~
main.c:10:6: note: declared here
   10 | void gcd(long* x, long* y){
      |      ^~~
Language: C

#include <stdio.h>

typedef ll ll;

void solve_142D();
ll GetGDC_ll(ll a, ll b); // ll な 最大公約数取得関数
int GetNumFactors(ll n); // 素因数の数を数える

ll A, B; // 入力の２数字, 制約：A, B <= 10^12 なので ll

void solve_142D()
{
  ll gdc = GetGDC_ll(A, B);
  int numFactors = GetNumFactors(gdc);
  printf("%d\n", numFactors + 1);
}

ll GetGDC_ll(ll a, ll b)
// ll な 最大公約数取得関数
{
  ll swap_tmp;
  if (a < b){ // 下の計算のために a > b にしておく
    swap_tmp = a; a = b; b = swap_tmp;
  }

  // ユークリッドの互除法により GDC を求める
  ll remainder = a % b;
  while (remainder != 0L){
    a = b; b = remainder; remainder = a % b;
  }
  return b;
}

int GetNumFactors(ll n)
// 素因数の数を数える
// 戻り値：素因数の数
// 内容や何乗かといった情報は返さない
{
  if (n == 1) return 0; // GDC が 1 の場合は 0 を返して終了

  int numFactors = 0;
  if (n % 2 == 0){ // 偶数の場合は numFactors を 1 にして 2 で割れるだけ割る
    numFactors = 1;
    while (1){
      n /= 2;
      if (n % 2 != 0) break;
    }
  }

  for (ll divisor = 3; divisor * divisor <= n; divisor += 2){
    if (n % divisor == 0){ // divisor で割れる場合は numFactors を +1 して divisor で割れるだけ割る
      ++numFactor;
      while (1){
        n /= divisor;
        if (n % divisor != 0) break;
      }
    }
  }

  return numFactor;
}

int main()
{
  scanf("%lld %lld", &A, &B);

  solve_142D();

  return 0;
}


Compiler output:
main.c:3:9: error: unknown type name 'll'
    3 | typedef ll ll;
      |         ^~
main.c: In function 'GetNumFactors':
main.c:52:9: error: 'numFactor' undeclared (first use in this function); did you mean 'numFactors'?
   52 |       ++numFactor;
      |         ^~~~~~~~~
      |         numFactors
main.c:52:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

/*ll gcd(ll x,ll y){
    if (y==0)
        return x;
    return gcd(y, x % y);
}*/

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 'int main()':
a.cc:34:17: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::pair<long long int, int>; _Alloc = std::allocator<std::pair<long long int, int> >; size_type = long unsigned int]' (did you forget the '()' ?)
   34 |     int ans = f.size + 1;
      |               ~~^~~~
      |                     ()
Language: C++

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

void solve_142D();

int GetGDC_ll(ll a, ll b); // 引数が long long な 最大公約数取得関数
int GetNumFactors(int n); // 素因数の数を数える

ll A, B; // 入力の２数字, 制約：A, B <= 10^12 なので long long

typedef long long int;

void solve_142D()
{
  int gdc = GetGDC_ll(A, B);
  int numFactors = GetNumFactors(gdc);
  printf("%d\n", numFactors + 1);
}

int GetGDC_ll(ll a, ll b)
// 引数が long long な 最大公約数取得関数
// 制約：a, b <= 10^12 なので GDC <= 10^6（で合ってるかな？）；戻り値は int
{
  ll swap_tmp;
  if (a < b){ // 下の計算のために a > b にしておく
    swap_tmp = a; a = b; b = swap_tmp;
  }

  // ユークリッドの互除法により GDC を求める
  ll remainder = a % b;
  while (remainder != 0L){
    a = b; b = remainder; remainder = a % b;
  }
  return (int)b;
}

int GetNumFactors(int n)
// 素因数の数を数える
// 戻り値：素因数の数
// 内容や何乗かといった情報は返さない
{
  if (n == 1) return 0; // GDC が 1 の場合は 0 を返して終了

  int numFactor = 0;
  if (n % 2 == 0){ // 偶数の場合は numFactor を 1 にして 2 で割れるだけ割る
    numFactor = 1;
    while (1){
      n /= 2;
      if (n % 2 != 0) break;
    }
  }

  for (int divisor = 3; divisor <= n; divisor += 2){
    if (n % divisor == 0){ // divisor で割れる場合は numFactor を +1 して divisor で割れるだけ割る
      ++numFactor;
      while (1){
        n /= divisor;
        if (n % divisor != 0) break;
      }
    }
  }

  return numFactor;
}

int main()
{
  scanf("%lld %lld", &A, &B);

  solve_142D();

  return 0;
}


Compiler output:
a.cc:13:19: error: declaration does not declare anything [-fpermissive]
   13 | typedef long long int;
      |                   ^~~
Language: C++

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

void solve_142D();

int GetGDC_ll(ll a, ll b); // 引数が long long な 最大公約数取得関数
int GetNumFactors(int n); // 素因数の数を数える

ll A, B; // 入力の２数字, 制約：A, B <= 10^12 なので long long

typedef int long long;

void solve_142D()
{
  int gdc = GetGDC_ll(A, B);
  int numFactors = GetNumFactors(gdc);
  printf("%d\n", numFactors + 1);
}

int GetGDC_ll(ll a, ll b)
// 引数が long long な 最大公約数取得関数
// 制約：a, b <= 10^12 なので GDC <= 10^6（で合ってるかな？）；戻り値は int
{
  ll swap_tmp;
  if (a < b){ // 下の計算のために a > b にしておく
    swap_tmp = a; a = b; b = swap_tmp;
  }

  // ユークリッドの互除法により GDC を求める
  ll remainder = a % b;
  while (remainder != 0L){
    a = b; b = remainder; remainder = a % b;
  }
  return (int)b;
}

int GetNumFactors(int n)
// 素因数の数を数える
// 戻り値：素因数の数
// 内容や何乗かといった情報は返さない
{
  if (n == 1) return 0; // GDC が 1 の場合は 0 を返して終了

  int numFactor = 0;
  if (n % 2 == 0){ // 偶数の場合は numFactor を 1 にして 2 で割れるだけ割る
    numFactor = 1;
    while (1){
      n /= 2;
      if (n % 2 != 0) break;
    }
  }

  for (int divisor = 3; divisor <= n; divisor += 2){
    if (n % divisor == 0){ // divisor で割れる場合は numFactor を +1 して divisor で割れるだけ割る
      ++numFactor;
      while (1){
        n /= divisor;
        if (n % divisor != 0) break;
      }
    }
  }

  return numFactor;
}

int main()
{
  scanf("%lld %lld", &A, &B);

  solve_142D();

  return 0;
}


Compiler output:
a.cc:13:18: error: declaration does not declare anything [-fpermissive]
   13 | typedef int long long;
      |                  ^~~~
Language: C++

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


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

int main(void)
{
    ll A, B;
    cin >> A >> B;
    if(x < y)
    {
        swap(A, B);
    }
    ll C = gcd(A, B);
    ll n = C;
    //cout << C << endl;
    int count = 0;
    for(ll i = 2; i + i <= n; i++)
    {
        if(C % i == 0)
        {
            count++;
        }
        
        while(C % i == 0)
        {
            C /= i;
        }
        //cout << i << " " << C << endl;

    }
    cout << count + 1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'x' was not declared in this scope
   20 |     if(x < y)
      |        ^
a.cc:20:12: error: 'y' was not declared in this scope
   20 |     if(x < y)
      |            ^
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
#include<array>
//#include<bits/stdc++.h>

using namespace std;
typedef long long ll;


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

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 pf(ll a/*, int* c*/){
	int j=1;
	ll b=a;
	double d = sqrt(a);
	//c[0] = 1;
	for(ll i=2;i*i<=a;i++){
		if(b%i != 0){
			continue;
		}else if(b%i == 0){
			//cout << i << " ";
			//c[j]= i;
			j++;
			while(b%i == 0){
				b = b/i;
			}
		}
		
	}
	//cout << "\n";
	return j;
}


int main()
{
	ll A, B, C;
	cin >> A >> B;
	C = gcd(A,B);
	//cout << C << "\n";
	//int c[C];
	//count = pf(C,/*c*/);
	auto f = factorize(C); 
	int count = f.size()+1;
	cout << count << endl;

	return 0;
}

Compiler output:
a.cc:20:1: error: 'vector' does not name a type
   20 | vector< pair<ll,int> > factorize(ll n){
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:65:18: error: 'factorize' was not declared in this scope
   65 |         auto f = factorize(C);
      |                  ^~~~~~~~~
Language: C++

#include<stdio.h>
#include<iostream>
#include<cmath>
//#include<bits/stdc++.h>

using namespace std;
typedef long long ll;


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

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 pf(ll a/*, int* c*/){
	int j=1;
	ll b=a;
	double d = sqrt(a);
	//c[0] = 1;
	for(ll i=2;i*i<=a;i++){
		if(b%i != 0){
			continue;
		}else if(b%i == 0){
			//cout << i << " ";
			//c[j]= i;
			j++;
			while(b%i == 0){
				b = b/i;
			}
		}
		
	}
	//cout << "\n";
	return j;
}


int main()
{
	ll A, B, C;
	cin >> A >> B;
	C = gcd(A,B);
	//cout << C << "\n";
	//int c[C];
	//count = pf(C,/*c*/);
	auto f = factorize(C); 
	int count = f.size()+1;
	cout << count << endl;

	return 0;
}

Compiler output:
a.cc:19:1: error: 'vector' does not name a type
   19 | vector< pair<ll,int> > factorize(ll n){
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:64:18: error: 'factorize' was not declared in this scope
   64 |         auto f = factorize(C);
      |                  ^~~~~~~~~
Language: C++

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


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

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 pf(ll a/*, int* c*/){
	int j=1;
	ll b=a;
	double d = sqrt(a);
	//c[0] = 1;
	for(ll i=2;i*i<=a;i++){
		if(b%i != 0){
			continue;
		}else if(b%i == 0){
			//cout << i << " ";
			//c[j]= i;
			j++;
			while(b%i == 0){
				b = b/i;
			}
		}
		
	}
	//cout << "\n";
	return j;
}


int main()
{
	ll A, B, C;
	int  count = 0;
	cin >> A >> B;
	C = gcd(A,B);
	//cout << C << "\n";
	//int c[C];
	//count = pf(C,/*c*/);
	auto f = factorize(C); 
	int count = f.size()+1;
	cout << count << end1;

	return 0;
}

Compiler output:
a.cc:17:1: error: 'vector' does not name a type
   17 | vector<pair<ll, int>> factorize(ll n){
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:63:18: error: 'factorize' was not declared in this scope
   63 |         auto f = factorize(C);
      |                  ^~~~~~~~~
a.cc:64:13: error: redeclaration of 'int count'
   64 |         int count = f.size()+1;
      |             ^~~~~
a.cc:57:14: note: 'int count' previously declared here
   57 |         int  count = 0;
      |              ^~~~~
a.cc:65:26: error: 'end1' was not declared in this scope
   65 |         cout << count << end1;
      |                          ^~~~