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

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

vector<long long> MakePrimeList(long long N) {
	vector<int> IsPrime(N + 1, 1);
	for (int i = 2; i <= (int)sqrt(N) + 1; i++) {
		if (IsPrime[i]==1) {
			int buf = i * 2;
			while (buf < N) {
				IsPrime[buf] = 0;
				buf += i;
			}
		}
	}
	vector<long long> PrimeList;
	for (long long i = 2; i <= N; i++) if (IsPrime[i]==1) PrimeList.push_back(i);
	return PrimeList;
}

int main() {
	long long A, B;
	cin >> A >> B;
	vector<long long> Ps = MakePrimeList(max(A, B));
	int ans = 1;
	for (long long p : Ps) if (A % p == 0 && B % p == 0) ans++;
	cout << ans << endl;
}


Compiler output:
a.cc: In function 'std::vector<long long int> MakePrimeList(long long int)':
a.cc:8:35: error: 'sqrt' was not declared in this scope
    8 |         for (int i = 2; i <= (int)sqrt(N) + 1; i++) {
      |                                   ^~~~
Language: C++

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

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

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

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

    // 素数である
    return true;
}


int main() {
  long long A,B;
  cin >> A >> B;
  
  long long G = gcd(A,B);
  vector<long long> X(0);
  
    long long Ans = 1;

  for(int i = 1; i <= G; i++){
    if(IsPrime(i)) Ans ++;
  }
  
  long long Ans = 0;
  

  cout << Ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:13: error: redeclaration of 'long long int Ans'
   47 |   long long Ans = 0;
      |             ^~~
a.cc:41:15: note: 'long long int Ans' previously declared here
   41 |     long long Ans = 1;
      |               ^~~
Language: C++

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

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


int main() {
  long long A,B;
  cin >> A >> B;
  
  long long G = gcd(A,B);
  vector<long long> X(0);

  for(int i = 1; i <= G; i++){
    if(G%i == 0) X.push_back(i);
  }

  for(int i = 1; i < X.size(); i++){
    for(int j = i + 1; j < X.size(); j++){
      if(X.at(i) !=0 && X.at(j) != 0;){
      if(X.at(j)%(X.at(i)) == 0) X.at(j) = 0;
      }
    }
  }
  
  long long Ans = 0;
  
  for(int i = 0; i < X.size();i++){
  if(X.at(i) != 0) Ans++;
  }
  
  cout << Ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:38: error: expected primary-expression before ')' token
   27 |       if(X.at(i) !=0 && X.at(j) != 0;){
      |                                      ^
Language: Java

#include<stdio.h>
long gcd(long m,long n)
{
    if(n==0)
        return m;
        printf("%ld %ld\n",n,m%n);
    return gcd(n,m%n);

}

int main()
{
    long  a,b,gCommon,i,j,k,cnt=1;
    scanf("%ld%ld",&a,&b);

    gCommon = gcd(a,b);
  

        for(i=2; gCommon>1 && gCommon>=i*i ; )
        {
            for(j=0; gCommon%i==0; j++)
                gCommon/=i;
                    if(j>0)
                        cnt++;
                    if(i==2)
                        i++;
                    else
                        i+=2;
        }

        if(gCommon>=i)
            cnt++;
        printf("%ld\n",cnt);
        return 0;
}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:6: error: class, interface, enum, or record expected
        printf("%ld %ld\n",n,m%n);
        ^
Main.java:7: error: class, interface, enum, or record expected
    return gcd(n,m%n);
    ^
Main.java:9: error: class, interface, enum, or record expected
}
^
Main.java:14: error: class, interface, enum, or record expected
    scanf("%ld%ld",&a,&b);
    ^
Main.java:16: error: class, interface, enum, or record expected
    gCommon = gcd(a,b);
    ^
Main.java:19: error: class, interface, enum, or record expected
        for(i=2; gCommon>1 && gCommon>=i*i ; )
        ^
Main.java:19: error: class, interface, enum, or record expected
        for(i=2; gCommon>1 && gCommon>=i*i ; )
                 ^
Main.java:19: error: class, interface, enum, or record expected
        for(i=2; gCommon>1 && gCommon>=i*i ; )
                                             ^
Main.java:21: error: class, interface, enum, or record expected
            for(j=0; gCommon%i==0; j++)
                     ^
Main.java:21: error: class, interface, enum, or record expected
            for(j=0; gCommon%i==0; j++)
                                   ^
Main.java:23: error: class, interface, enum, or record expected
                    if(j>0)
                    ^
Main.java:25: error: class, interface, enum, or record expected
                    if(i==2)
                    ^
Main.java:27: error: class, interface, enum, or record expected
                    else
                    ^
Main.java:29: error: class, interface, enum, or record expected
        }
        ^
Main.java:33: error: class, interface, enum, or record expected
        printf("%ld\n",cnt);
        ^
Main.java:34: error: class, interface, enum, or record expected
        return 0;
        ^
Main.java:35: error: class, interface, enum, or record expected
}
^
19 errors
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>
#include <set>

using namespace std;
using Set = multiset<ll>;
using ll = long long;

bool is_prime (ll n) {
  if (n == 1) return false;
  if (n == 2) return true;
  if (n == 3) return true;

  ll sqrtn = sqrt(n);

  for (ll i = 2; i < sqrtn + 1; i++) {
    if (n % i == 0) return false;
  }

  return true;
}

Set get_prime_factors (ll n) {
  ll sqrtn = sqrt(n);
  Set prime_factors;

  for (ll i = 1; i < sqrtn + 1; i++) {
    if (n % i != 0) continue;

    ll I = n / i;

    if (is_prime(i)) prime_factors.insert(i);
    if (is_prime(I)) prime_factors.insert(I);
  }

  return prime_factors;
}

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

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

  Set p1 = get_prime_factors(A);
  Set p2 = get_prime_factors(B);
  Set S;

  set_intersection(
    p1.begin(), p1.end(),
    p2.begin(), p2.end(),
    inserter(S, S.end())
  );

  S.insert(1);

  cout << S.size() << endl;
}


Compiler output:
a.cc:7:22: error: 'll' was not declared in this scope
    7 | using Set = multiset<ll>;
      |                      ^~
a.cc:7:24: error: template argument 1 is invalid
    7 | using Set = multiset<ll>;
      |                        ^
a.cc:7:24: error: template argument 2 is invalid
a.cc:7:24: error: template argument 3 is invalid
a.cc:24:1: error: 'Set' does not name a type
   24 | Set get_prime_factors (ll n) {
      | ^~~
a.cc: In function 'int main()':
a.cc:49:3: error: 'Set' was not declared in this scope
   49 |   Set p1 = get_prime_factors(A);
      |   ^~~
a.cc:50:6: error: expected ';' before 'p2'
   50 |   Set p2 = get_prime_factors(B);
      |      ^~~
      |      ;
a.cc:51:6: error: expected ';' before 'S'
   51 |   Set S;
      |      ^~
      |      ;
a.cc:54:5: error: 'p1' was not declared in this scope; did you mean 'y1'?
   54 |     p1.begin(), p1.end(),
      |     ^~
      |     y1
a.cc:55:5: error: 'p2' was not declared in this scope
   55 |     p2.begin(), p2.end(),
      |     ^~
a.cc:56:14: error: 'S' was not declared in this scope
   56 |     inserter(S, S.end())
      |              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll =long long;
int main(){
    ll a,b;
    cin>>a>>b;
    ll c=__gcd(a,b);
    ll d=pow(c,0.5);
    ll cnt=0 ;
    const int MAX = 1e6 + 10;
    for(ll i=2;i<min(c,MAX);i++){
        if(c%i==0) cnt++;
        while(c%i==0){
            c /=i;
        }
    }
    cout <<cnt+1;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: no matching function for call to 'min(ll&, const int&)'
   12 |     for(ll i=2;i<min(c,MAX);i++){
      |                  ~~~^~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:12:21: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   12 |     for(ll i=2;i<min(c,MAX);i++){
      |                  ~~~^~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:12:21: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   12 |     for(ll i=2;i<min(c,MAX);i++){
      |                  ~~~^~~~~~~
Language: C++

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



ll GCD(ll a,ll b){
    if(a>b){
        return GCD(b,a);
    }
    else{
    ll r=b%a;
    while(r!=0){
        b=a;
        a=r;
        r=b%a;
    }
    return a;
    }
}

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







Compiler output:
a.cc: In function 'int main()':
a.cc:31:18: error: 'g' was not declared in this scope
   31 |            while(g%i==0){
      |                  ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int64_t A, B;
  cin >> A >> B;

  auto f = [](int64_t n) {
    vector<int64_t> res;
    for (int64_t i = 2; i * i < n + 1; i++) {
      if (n % i == 0) {
        res.emplace_back(i);
        res.emplace_back(n / i);
      }
    }
    sort(res.begin(), res.end());
    res.erase(unique(res.begin(), res.end(), res.end()));
    return res;
  };

  vector<int64_t> C = f(A), D = f(B), E;
  for (auto c : C) {
    for (auto d : D) {
      if (c == d) E.emplace_back(c);
    }
  }

  sort(E.begin(), E.end());
  int cnt = 1;
  for (int i = 0; i < (int)E.size(); i++) {
    if (E[i] != -1) {
      cnt++;
      for (int j = i + 1; j < (int)E.size(); j++) {
        if (E[j] % E[i] == 0) E[j] = -1;
      }
    }
  }
  cout << cnt << '\n';
  return 0;
}


Compiler output:
In file included from /usr/include/c++/14/bits/stl_algobase.h:71,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/predefined_ops.h: In instantiation of 'constexpr bool __gnu_cxx::__ops::_Iter_comp_iter<_Compare>::operator()(_Iterator1, _Iterator2) [with _Iterator1 = __gnu_cxx::__normal_iterator<long int*, std::vector<long int> >; _Iterator2 = __gnu_cxx::__normal_iterator<long int*, std::vector<long int> >; _Compare = __gnu_cxx::__normal_iterator<long int*, std::vector<long int> >]':
/usr/include/c++/14/bits/stl_algo.h:869:20:   required from '_ForwardIterator std::__unique(_ForwardIterator, _ForwardIterator, _BinaryPredicate) [with _ForwardIterator = __gnu_cxx::__normal_iterator<long int*, vector<long int> >; _BinaryPredicate = __gnu_cxx::__ops::_Iter_comp_iter<__gnu_cxx::__normal_iterator<long int*, vector<long int> > >]'
  869 |         if (!__binary_pred(__dest, __first))
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:933:27:   required from '_FIter std::unique(_FIter, _FIter, _BinaryPredicate) [with _FIter = __gnu_cxx::__normal_iterator<long int*, vector<long int> >; _BinaryPredicate = __gnu_cxx::__normal_iterator<long int*, vector<long int> >]'
  933 |       return std::__unique(__first, __last,
      |              ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
  934 |                            __gnu_cxx::__ops::__iter_comp_iter(__binary_pred));
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:20:21:   required from here
   20 |     res.erase(unique(res.begin(), res.end(), res.end()));
      |               ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/predefined_ops.h:158:30: error: no match for call to '(__gnu_cxx::__normal_iterator<long int*, std::vector<long int> >) (long int&, long int&)'
  158 |         { return bool(_M_comp(*__it1, *__it2)); }
      |                       ~~~~~~~^~~~~~~~~~~~~~~~
Language: C++

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

typedef long long ll;

ll euclidean_gcd(ll a, ll b) {
    while (1) {
        if (a < b) swap(a, b);
        if (!b) break;
        a %= b;
    }
    return a;
}

vector< ll > divisor(ll n) {//約数算出
    vector< ll > ret;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(begin(ret), end(ret));
    return (ret);
}

bool is_prime(ll num)
{
    if(num<2)return false;
    else if(num==2)return true;
    else if(num%2==0)return false;

    ll sqrt_num=sqrt(num);
    for (ll i =3 ; i <= sqrt_num; i+=2)
    {
        if(num%i==0) return false;
    }
    return true;
}

int main()
{
    ll a, b;
    cin >> a >> b;
    ll gcd = euclidean_gcd(a, b);
    vector<ll> c_divisors = divisor(gcd);
    vector<ll> ans;
    int size = c_divisors.size();
    ans.push_back(1);
    for (int i = 1; i < size; i++)
    {
        if(is_prime(c_divisors[i])) ans.push_back(c_divisors[i]);
    }
    cout<<ans.size()<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'std::vector<long long int> divisor(ll)':
a.cc:26:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   26 |     sort(begin(ret), end(ret));
      |     ^~~~
      |     sqrt
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
typedef pair<int, int>P;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);


int g[15][15];
bool flag[1050000];
const int INF = 1001001001;
const int di[] = { -1,0,1,0 };
const int dj[] = { 0,-1,0,1 };

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

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:20:23: error: expected primary-expression before 'y'
   20 |         return gcd(ll y, ll x % y);
      |                       ^
a.cc:20:29: error: expected primary-expression before 'x'
   20 |         return gcd(ll y, ll x % y);
      |                             ^
Language: C++

#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)

using namespace std;
using ll = long long;
typedef pair<int, int> Pair;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<vector<ll>> f(ll n) {
  vector<vector<ll>> res;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i != 0) continue;
    ll cnt = 0;
    while (n % i == 0) cnt++, n /= i;
    res.push_back({i, cnt});
  }
  if (n > 1) res.push_back({n, 1});
  return res;
}

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

  ll g = gcd(a, b);
  auto s = f(g);

  cout << s.size() + 1 << endl;
  return 0;
}
#include <bits/stdc++.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)

using namespace std;
using ll = long long;
typedef pair<int, int> Pair;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<vector<ll>> f(ll n) {
  vector<vector<ll>> res;
  for (int i = 2; i * i <= n; ++i) {
    if (n % i != 0) continue;
    ll cnt = 0;
    while (n % i == 0) cnt++, n /= i;
    res.push_back({i, cnt});
  }
  if (n > 1) res.push_back({n, 1});
  return res;
}

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

  ll g = gcd(a, b);
  auto s = f(g);

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


Compiler output:
a.cc:44:4: error: redefinition of 'll gcd(ll, ll)'
   44 | ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
      |    ^~~
a.cc:10:4: note: 'll gcd(ll, ll)' previously defined here
   10 | ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
      |    ^~~
a.cc:45:4: error: redefinition of 'll lcm(ll, ll)'
   45 | ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
      |    ^~~
a.cc:11:4: note: 'll lcm(ll, ll)' previously defined here
   11 | ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
      |    ^~~
a.cc:47:20: error: redefinition of 'std::vector<std::vector<long long int> > f(ll)'
   47 | vector<vector<ll>> f(ll n) {
      |                    ^
a.cc:13:20: note: 'std::vector<std::vector<long long int> > f(ll)' previously defined here
   13 | vector<vector<ll>> f(ll n) {
      |                    ^
a.cc:59:5: error: redefinition of 'int main()'
   59 | int main() {
      |     ^~~~
a.cc:25:5: note: 'int main()' previously defined here
   25 | int main() {
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll =long long;
ll main(){
  ll a,b;
  cin>> a >> b;
  vector<int> x;
  int n = min(a,b);
  for(ll i=1; i<=n; i++){
    if(a%i==0 && b%i==0){
      x.push_back(i);
      }
    }
  
  int ans = 0;
  for(ll i : x){
    i = x.front;
    x.pop;
    for(int j=1; j<sqrt(i); i++){
      if(i%j != 0){
        continue;
        }else{
        break;
        }
      

Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | ll main(){
      | ^~
a.cc: In function 'int main()':
a.cc:17:11: error: cannot resolve overloaded function 'front' based on conversion to type 'll' {aka 'long long int'}
   17 |     i = x.front;
      |           ^~~~~
a.cc:18:7: error: 'class std::vector<int>' has no member named 'pop'
   18 |     x.pop;
      |       ^~~
a.cc:24:10: error: expected '}' at end of input
   24 |         }
      |          ^
a.cc:19:33: note: to match this '{'
   19 |     for(int j=1; j<sqrt(i); i++){
      |                                 ^
a.cc:24:10: error: expected '}' at end of input
   24 |         }
      |          ^
a.cc:16:16: note: to match this '{'
   16 |   for(ll i : x){
      |                ^
a.cc:24:10: error: expected '}' at end of input
   24 |         }
      |          ^
a.cc:4:10: note: to match this '{'
    4 | ll main(){
      |          ^
Language: C++

#include <cmath>
#include <iostream>

using namespace std;

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

int main()
{
  long a, b;
  cin >> a >> b;
  
  long g = gcd(a, b);
  
  long sg = sqrt(g);
  long ans = 1;
  if (g % 2 == 0)
    ++ans;
  for (g % 2 == 0)
    g %= 2;
  for(long i = 1; i <= sg; i += 2) {
    if (g % i == 0)
      ++ans;
    for (g % i == 0)
      g %= i;
  }
  
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: expected ';' before ')' token
   25 |   for (g % 2 == 0)
      |                  ^
      |                  ;
a.cc:27:3: error: expected primary-expression before 'for'
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ^~~
a.cc:26:12: error: expected ';' before 'for'
   26 |     g %= 2;
      |            ^
      |            ;
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ~~~       
a.cc:27:3: error: expected primary-expression before 'for'
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ^~~
a.cc:26:12: error: expected ')' before 'for'
   26 |     g %= 2;
      |            ^
      |            )
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ~~~       
a.cc:25:7: note: to match this '('
   25 |   for (g % 2 == 0)
      |       ^
a.cc:30:20: error: expected ';' before ')' token
   30 |     for (g % i == 0)
      |                    ^
      |                    ;
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
a.cc:31:14: error: expected ';' before '}' token
   31 |       g %= i;
      |              ^
      |              ;
   32 |   }
      |   ~           
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
a.cc:31:14: error: expected ')' before '}' token
   31 |       g %= i;
      |              ^
      |              )
   32 |   }
      |   ~           
a.cc:30:9: note: to match this '('
   30 |     for (g % i == 0)
      |         ^
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
Language: C++

#include <cmath>
#include <iostream>

using namespace std;

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

int main()
{
  long a, b;
  cin >> a >> b;
  
  long g = gcd(a, b);
  
  long sg = sqrt(g);
  long ans = 1;
  if (g % 2 == 0)
    ++ans;
  for (g % 2 == 0)
    g =% 2;
  for(long i = 1; i <= sg; i += 2) {
    if (g % i == 0)
      ++ans;
    for (g % i == 0)
      g =% i;
  }
  
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: expected ';' before ')' token
   25 |   for (g % 2 == 0)
      |                  ^
      |                  ;
a.cc:27:3: error: expected primary-expression before 'for'
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ^~~
a.cc:26:12: error: expected ';' before 'for'
   26 |     g =% 2;
      |            ^
      |            ;
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ~~~       
a.cc:27:3: error: expected primary-expression before 'for'
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ^~~
a.cc:26:12: error: expected ')' before 'for'
   26 |     g =% 2;
      |            ^
      |            )
   27 |   for(long i = 1; i <= sg; i += 2) {
      |   ~~~       
a.cc:25:7: note: to match this '('
   25 |   for (g % 2 == 0)
      |       ^
a.cc:30:20: error: expected ';' before ')' token
   30 |     for (g % i == 0)
      |                    ^
      |                    ;
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
a.cc:31:14: error: expected ';' before '}' token
   31 |       g =% i;
      |              ^
      |              ;
   32 |   }
      |   ~           
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
a.cc:31:14: error: expected ')' before '}' token
   31 |       g =% i;
      |              ^
      |              )
   32 |   }
      |   ~           
a.cc:30:9: note: to match this '('
   30 |     for (g % i == 0)
      |         ^
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
Language: C++

#include <iostream>
#include <numeric>
#include <vector>

using namespace std;

int main()
{
  long a, b;
  cin >> a >> b;
  
  long g = gcd(a, b);
  
  vector<long> v(1, 1);
  for(int i = 3; i <= n; i += 2) {
    if (g % i == 0) {
      bool b = True;
      for (int j = 1; j < v.size(); ++j)
        if(i % v[j] == 0) {
          b = False;
          break;
        }
      if (b == True)
        v.push_back(i);
    }
  }
  if (g % 2 == 0)
    v.push_back(2);
  
  cout << v.size();
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: 'n' was not declared in this scope
   15 |   for(int i = 3; i <= n; i += 2) {
      |                       ^
a.cc:17:16: error: 'True' was not declared in this scope
   17 |       bool b = True;
      |                ^~~~
a.cc:20:15: error: 'False' was not declared in this scope
   20 |           b = False;
      |               ^~~~~
Language: C++

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

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

vector<pair<long, int>> factorize(long n) {
    vector<pair<long, int>> res;
    for ( 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 a, b;
    cin >> a >> b;

    long g = gcd(a, b);

    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL << 60;
#define tl 1'000'000'007
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REREP(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, a, n) for (ll i = a; i < n; i++)
#define REFOR(i, n, a) for (ll i = n; i >= a; i--)
void PrimeFactorization(ll a, map<ll,int>P){
    FOR(i,2,sqrt(a)+1){
        if(a%i==0){
            map[i]++;
            a/=i;
            i--;
        }
    }
    return 0;
}

ll gcd(ll a, ll b){
    if(a%b==0) return b;
    else return gcd(b, a%b);
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false); 
    ll x,y;
    cin >> x >> y;
    //x,yの公約数＝＝x,yの最大公約数の約数
    ll p= gcd(x,y);
    map<ll,int> P;
    PrimeFactorization(p,P);
    ll num= 1;
    for(auto x:P){
        num++;
    }
    cout << num << endl;
}

Compiler output:
a.cc: In function 'void PrimeFactorization(ll, std::map<long long int, int>)':
a.cc:13:19: error: expected initializer before '++' token
   13 |             map[i]++;
      |                   ^~
a.cc:13:19: error: expected ';' before '++' token
a.cc:18:12: error: return-statement with a value, in function returning 'void' [-fpermissive]
   18 |     return 0;
      |            ^
Language: C

def primes(n):
    prime = [1]*(n+1)
    p=2
    while p*p <= n+1:
        if(prime[p]==True):
            i=p*p
            while i <= n+1:
                prime[i]=0
                i+=p
        p+=1
    return prime
    
def g(a,b):
    if(b==0):
        return a
    else:
        return g(b,a%b)
        
n = int(input())
m = int(input())
if(n<=m):
    a=n
    b=m
else:
    a=m
    b=n
if a==1:
    print(a)
else:
    gcd = g(b,a)
    l =[]
    for i in range(1,gcd):
        if(n%i==0 and m%i==0):
            l.append(i)
    p = primes(gcd)
    count=0
    for i in range(len(l)):
        if(p[l[i]]==1):
            count+=1
    print(count)        


Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def primes(n):
      | ^~~
main.c: In function 'primes':
main.c:1:14: error: expected declaration specifiers before ':' token
    1 | def primes(n):
      |              ^
main.c:1:5: error: type of 'n' defaults to 'int' [-Wimplicit-int]
    1 | def primes(n):
      |     ^~~~~~
Language: C++



#include <iostream>

using namespace std;

int d[10000];

void coprime(int a, int b) { 
      
    if ( __gcd(a, b) == 1) 
        return 1;
    else
        return 0;         
} 

int copa(vector <int> a,int curr,int total){
    if(d[n]!=-1){
        return d[total];
    }
    if(curr>=1 && total>1){
    for(int i=0;i<=curr;i++){
        for(int j=0;j<=curr;j++){
            if(__gcd(a[i],a[j])!=1){
                d[total]=-1;
                return d[total];                
            }
        }
    }
        d[total]=max(copa(a,curr-1,total-1),copa(a,curr-1,total));
    }
    
}


int main()
{   
    int a,b,n,j=0;
    cin>>a>>b;
    n=__gcd(a,b);
    vector<int> arr[n];
    for(int i=1;i<=n;i++){
        if(a%i && b%i){
            arr[j]=i;
            j++;
        }
    }
    

    return 0;
}


Compiler output:
a.cc: In function 'void coprime(int, int)':
a.cc:11:10: error: '__gcd' was not declared in this scope
   11 |     if ( __gcd(a, b) == 1)
      |          ^~~~~
a.cc:12:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   12 |         return 1;
      |                ^
a.cc:14:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
   14 |         return 0;
      |                ^
a.cc: At global scope:
a.cc:17:10: error: 'vector' was not declared in this scope
   17 | int copa(vector <int> a,int curr,int total){
      |          ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <iostream>
  +++ |+#include <vector>
    4 | 
a.cc:17:18: error: expected primary-expression before 'int'
   17 | int copa(vector <int> a,int curr,int total){
      |                  ^~~
a.cc:17:25: error: expected primary-expression before 'int'
   17 | int copa(vector <int> a,int curr,int total){
      |                         ^~~
a.cc:17:34: error: expected primary-expression before 'int'
   17 | int copa(vector <int> a,int curr,int total){
      |                                  ^~~
a.cc:17:43: error: expression list treated as compound expression in initializer [-fpermissive]
   17 | int copa(vector <int> a,int curr,int total){
      |                                           ^
a.cc: In function 'int main()':
a.cc:40:7: error: '__gcd' was not declared in this scope
   40 |     n=__gcd(a,b);
      |       ^~~~~
a.cc:41:5: error: 'vector' was not declared in this scope
   41 |     vector<int> arr[n];
      |     ^~~~~~
a.cc:41:5: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:41:12: error: expected primary-expression before 'int'
   41 |     vector<int> arr[n];
      |            ^~~
a.cc:44:13: error: 'arr' was not declared in this scope
   44 |             arr[j]=i;
      |             ^~~
Language: C

def primes(n):
    prime = [1]*(n+1)
    p=2
    while p*p <= n+1:
        if(prime[p]==True):
            i=p*p
            while i <= n+1:
                prime[i]=0
                i+=p
        p+=1
    return prime
    
def g(a,b):
    if(b==0):
        return a
    else:
        return g(b,a%b)
        
n = int(input())
m = int(input())
if(n<=m):
    a=n
    b=m
else:
    a=m
    b=n
if a==1;
    print(a)
else:
    gcd = g(b,a)
    l =[]
    for i in range(1,gcd):
        if(n%i==0 and m%i==0):
            l.append(i)
    p = primes(gcd)
    count=0
    for i in range(len(l)):
        if(p[l[i]]==1):
            count+=1
    print(count)        


Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def primes(n):
      | ^~~
main.c: In function 'primes':
main.c:1:14: error: expected declaration specifiers before ':' token
    1 | def primes(n):
      |              ^
main.c:28:5: error: expected declaration specifiers before 'print'
   28 |     print(a)
      |     ^~~~~
main.c:1:5: error: type of 'n' defaults to 'int' [-Wimplicit-int]
    1 | def primes(n):
      |     ^~~~~~
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();
   long ans = 0;
   long N ;
   if(A>B) N = B;
   else N = A;
   
   boolean flg - false;
   for(int k = 1;k<=Math.sqrt(N);k++)
   {
     flg = true;
     if(A%k==0&&B%k==0) 
     {
       for(int i = 1;i<=Math.sqrt(k);i++)
       {
         if(k%i==0) 
         {
           flg = false;
           break;
         }
       }
       if(flg) ans++;
     }
   }
   else System.out.println(ans);
 }
}

Compiler output:
Main.java:12: error: ';' expected
   boolean flg - false;
              ^
Main.java:29: error: 'else' without 'if'
   else System.out.println(ans);
   ^
2 errors
Language: C++

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

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

    }
    if(g!=0) ans++;
    cout << asn << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:13: error: lvalue required as left operand of assignment
   15 |         if(g%i=0){
      |            ~^~
a.cc:22:13: error: 'asn' was not declared in this scope; did you mean 'ans'?
   22 |     cout << asn << endl;
      |             ^~~
      |             ans
Language: C++

/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


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


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll i=2:i<=sqrt(n);i++){
    if(n%i!=0) continue;
    ll tmp=0;
    while(n%i==0){
      n/=i;
      tmp++;
    }
    ans.push_back(make_pair(i,tmp));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll a,b;
  cin>>a>>b;
  ll tmp=GCD(a,b);
  vector<pint> v=prime_factorize(tmp);
  cout<<v.size()+1<<endl;
}



Compiler output:
a.cc: In function 'std::vector<std::pair<long long int, long long int> > prime_factorize(ll)':
a.cc:124:11: error: initializer in range-based 'for' loop
  124 |   for(ll i=2:i<=sqrt(n);i++){
      |           ^
a.cc:124:24: error: expected ')' before ';' token
  124 |   for(ll i=2:i<=sqrt(n);i++){
      |      ~                 ^
      |                        )
a.cc:124:25: error: 'i' was not declared in this scope
  124 |   for(ll i=2:i<=sqrt(n);i++){
      |                         ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <list>
#include <stack>

using namespace std;

#define ll long long

int main()
{
	ll x, y;
	cin >> x >> y;
	ll small = x > y ? y : x;
	small = sqrt(small) + 2;
	vector<bool> t(small + 1, true);
	ll result = 1;

	for (ll i = 2; i <= small; i++)
	{
		if (!t[i])
			continue;
		if (x % i != 0 || y % i != 0)
			continue;
		result++;
		for (ll j = i; j <= small; j += i)
			t[j] = false;
	}

	printf("%lld", result);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'sqrt' was not declared in this scope
   20 |         small = sqrt(small) + 2;
      |                 ^~~~
Language: C++

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

int main() {
	long long int n1,n2,cnt=1; cin>>n1>>n2;
	int a=__gcd(n1,n2); 
	for(int i=2;i<n*n;i++) {
		if(n%i==0) {
			ans++;
			while(n%i==0) n/=i;
		}
	}
	
	if(n>1) cnt++;
	cout<<endl<<cnt<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: 'n' was not declared in this scope
    7 |         for(int i=2;i<n*n;i++) {
      |                       ^
a.cc:9:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |                         ans++;
      |                         ^~~
      |                         abs
a.cc:14:12: error: 'n' was not declared in this scope
   14 |         if(n>1) cnt++;
      |            ^
Language: C++

#include<bits_stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<n;i++)
int dfs(ll i,vector<bitset<99> > bs,bitset<99> a,ll sum){
    bitset<99> c,d;
    if(i==bs.size()-1){
        return sum;
    }
    c=a^bs.at(i);
    d=a|bs.at(i);
    if(c!=d){
        return dfs(i+1,bs,a,sum);
    }
    return max(dfs(i+1,bs,a,sum),dfs(i+1,bs,c,sum+1));
}

int main(){
    ll a, b, ans=0;
    cin >> a >> b;
    if(a>b)swap(a,b);
    vector<ll> vec(0),codiv(0);
    rep(i,sqrt(a)-1){
        if(a%(i+1)==0){
            vec.push_back(i+1);
            if((i+1)*(i+1)!=a)vec.push_back(a/(i+1));
        }
    }
    sort(vec.begin(),vec.end());
    rep(i,vec.size()){
        if(((b%vec.at(i))==0)&&(vec.at(i)>1))codiv.push_back(vec.at(i));
    }
    ll n=codiv.size();
    vector<bitset<99> > bs(n);
    rep(i,n){
        rep(j,i+1){
            if(codiv.at(i)%codiv.at(j)==0){
                bs.at(i).set(j);
            }
        }
    }
    bitset<99> bit;
    cout << ((n>0)?dfs(0,bs,bit,1):1) << endl;
}
    


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

#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

static const int INTINF = (2147483647);
static const ll LLINF = (9223372036854775807);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;

namespace Printer{
    template<class T>
    void print(T x){
        cout << x << endl;
    }

    template<class T>
    void print(T x, T y){
        cout << x << "," << y << endl;
    }

    template<class T>
    void print(vector<T> v){
        rep(i, v.size()){
            if(i) cout << " ";
            cout<< v[i];
        }
        cout << endl;
    }

    template<class T>
    void print(vector<vector<T> > vv){
        rep(i, vv.size()){
            rep(j, vv[i].size()){
                if(j) cout << " ";
                cout << vv[i][j];
            }
            cout << endl;
        }
    }

    void print(pair<int, int> p){
        cout << "(" << p.first << ", " << p.second << ")" << endl;
    }
};
using namespace Printer;

//--global--//

vector<bool> sieve(long long max){ // 0 <= x <= max までの素数を調べ、返す。
    vector<bool> isPrime;
    
    if(max+1 > isPrime.size()){     // resizeで要素数が減らないように
        isPrime.resize(max+1,true); // isPrimeに必要な要素数を確保
    } 
    isPrime[0] = false; // 0は素数ではない
    isPrime[1] = false; // 1は素数ではない

    for(size_t i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる (i*iで実現している)
        if(isPrime[i]) // iが素数ならば
            for(size_t j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                isPrime[i*j] = false;      // 素数ではない
    
    return isPrime;
}

//----------//
// 最大公約数を求める
long long GCD(long long x, long long y) {
    return y ? GCD(y, x%y) : x;
}

int main() {
    long long A, B;
    cin >> A >> B;
    long long G = GCD(A, B);
    auto pf = prime_factorize(G);
    cout << pf.size() + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:81:15: error: 'prime_factorize' was not declared in this scope
   81 |     auto pf = prime_factorize(G);
      |               ^~~~~~~~~~~~~~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:47:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   47 |     while (num%i == 0) { // 素数で割り切れなくなるまで割っていく
      |            ^~~
      |            enum
Language: C++

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





Compiler output:
a.cc: In function 'int main()':
a.cc:35:15: error: 'i' was not declared in this scope
   35 |       while(K%i==0)
      |               ^
Language: C++

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





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

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





Compiler output:
a.cc: In function 'int main()':
a.cc:34:10: error: 'i' was not declared in this scope
   34 |     if(K%i==0){
      |          ^
a.cc:49:5: error: 'else' without a previous 'if'
   49 |     else
      |     ^~~~
a.cc: At global scope:
a.cc:52:3: error: expected unqualified-id before 'if'
   52 |   if(K>1)
      |   ^~
a.cc:54:3: error: expected declaration before '}' token
   54 |   }
      |   ^
a.cc:55:3: error: 'cout' does not name a type
   55 |   cout<<ans<<endl;
      |   ^~~~
a.cc:56:3: error: expected declaration before '}' token
   56 |   }
      |   ^