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

#include <iostream>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

#define _overload3(_1,_2,_3,name,...) name
#define _all1(a) (a).begin(),(a).end()
#define _all2(a,n) (a),(a)+n
#define all(...) _overload3(__VA_ARGS__,_all1,_all2,)(__VA_ARGS__)
#define _rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define rrep(i,n) for(int i=(n);i>=0;--i)
#define iter(it,v) for(auto it=v.begin();it!=v.end();++it)
#define in(v) cin>>v;
#define out(v) cout<<v<<"\n"
const int MOD = 1e9+7;
const int INF = numeric_limits<int>::max();
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template<class T>ostream& operator<<(ostream& os, vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<vec[i]<<(i+1==vec.size()?"":", ");os<<"}";return os;}
template<class T1,class T2>ostream& operator<<(ostream& out,const pair<T1,T2>& rhs){out<<"("<<rhs.first<<", "<<rhs.second<<")";return out;}

template<typename T>T gcd(T a, T b){return b?gcd(b,a%b):a;}

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

  ll g = gcd(A, B);
  int ans = 0;
  rep(i, 2, g+1) {
    if (g % i == 0) {
      ++ans;
      g /= i;
    }
    if (g == 1)
      break;
  }
  out(ans+1);
  return 0;
}


Compiler output:
a.cc:6:12: error: 'vector' does not name a type
    6 | using vi = vector<int>;
      |            ^~~~~~
a.cc:7:13: error: 'vector' does not name a type
    7 | using vvi = vector<vi>;
      |             ^~~~~~
a.cc:22:17: error: 'numeric_limits' was not declared in this scope
   22 | const int INF = numeric_limits<int>::max();
      |                 ^~~~~~~~~~~~~~
a.cc:22:32: error: expected primary-expression before 'int'
   22 | const int INF = numeric_limits<int>::max();
      |                                ^~~
a.cc:25:51: error: 'vector' has not been declared
   25 | template<class T>ostream& operator<<(ostream& os, vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<vec[i]<<(i+1==vec.size()?"":", ");os<<"}";return os;}
      |                                                   ^~~~~~
a.cc:25:57: error: expected ',' or '...' before '<' token
   25 | template<class T>ostream& operator<<(ostream& os, vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<vec[i]<<(i+1==vec.size()?"":", ");os<<"}";return os;}
      |                                                         ^
a.cc: In function 'std::ostream& operator<<(std::ostream&, int)':
a.cc:25:89: error: 'vec' was not declared in this scope
   25 | template<class T>ostream& operator<<(ostream& os, vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<vec[i]<<(i+1==vec.size()?"":", ");os<<"}";return os;}
      |                                                                                         ^~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    ll r = a%b;
    while(r!=0){
        a=b;
        b=r;
        r=a%b;
    }
    return b;
}

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

    while(sqrt(num)+ >= g){
        if(g%num==0){
            if(num != pre)ans++;
            pre = num;
        }
        num++;
    }
    cout << ans+1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: expected primary-expression before '>=' token
   27 |     while(sqrt(num)+ >= g){
      |                      ^~
Language: C++

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

int main () {
    int A, B, lower, higher, cnt = 1, last = 0, last_gyaku = 0;
    int yaku[10000000];
    int yakugyaku[10000000];
    cin >> A >> B;
    if (A > B) {lower = B; higher = A;}
    else       {lower = A; higher = B;}

    for (int i = 1; i < sqrt(lower); i++) {
        if (lower % i == 0) {
            if (higher % i == 0) {
                yaku[last] = i;
                last++;
                if (higher % (lower / i) == 0) {
                    yakugyaku[last_gyaku] = (lower / i);
                    last_gyaku++;
                }
            }
        }
    }

    for (int i = 1; i < last + last_gyaku; i++) {
        bool flag = true;
        for (int j = 1; j < i; j++) {
            if (i < last) {
                if (yaku[i] % yaku[j] == 0) {
                    flag = false;
                    break;
                }
            } else {
                if (j < last) {
                    if (yakugyaku[i] % yaku[j] == 0) {
                        flag = false;
                        break;
                    }
                } else {
                    if (yakugyaku[i] % yakugyaku[j] == 0) {
                        flag = false;
                        break;
                    }
                }
            }
        }
        if (flag == true) {
            cnt++;
        }
    }

    cout << cnt << endl;
    return 0;
}

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

#include<bits/stdc++.h>

using namespace std;

#define max 1000005

int main()
{
	bool a[max+1];
	memset(a,true,sizeof(a));
	 int t=0;
	 
	 for(int i=2;i*i<=max;i++)
	 
	 {
	 	
	 	
	 	
	 if(a[i])
	 {
	 	
	 	for(int j=i*i;j<=max;j+=i)
	 	{
	 		a[j]=false;
	 		
	 		
	 		
		 }
	 	
	 	
	 	
	 	
	 }
	  }
	  
	  int m,b;
	  cin>>m>>b;
	  int min;
	  
	  if(m<b)
	  min=m;
	  
	  else
	  min=b;
	  int ans=1;
	  
	  for(int i=2;i*i<=m;i++)
	  {
	  	if(a[i]&&(a%i==0)&&(b%i==0))
	  	ans++;
	  	
	  	
	  	
	  }
	  cout<<ans;
	  
	 	
	 //	int k=1;
	 	
	 		
	 /*	 while(t<n)
	 	 {
	 	 	 k++;
	 	    if(a[k])
			 t++;
			 
			 	
	 	 	
	 	 	
		  }
		  
		  
		  return k;*/

	
return 0;	
}




Compiler output:
a.cc: In function 'int main()':
a.cc:49:28: error: invalid operands of types 'bool [1000006]' and 'int' to binary 'operator%'
   49 |                 if(a[i]&&(a%i==0)&&(b%i==0))
      |                           ~^~
      |                           | |
      |                           | int
      |                           bool [1000006]
Language: C++

//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

	long long ans = 1;

	vector<long long> x(n + 1);
	long long num = n;

	for (int i = 2; i <= n; i++) {
		while (num%i == 0) {
			x.at(i)++;
			num /= i;
		}
	}

	for (int i = 2; i <= n; i++)
	{
    if(x.at(i) >= 1) ans++;
	}
	cout << ans << endl;
  // printf("%d\n", cnt);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'gcd' was not declared in this scope
   17 |   long long c = gcd(a,b);
      |                 ^~~
a.cc:21:29: error: 'n' was not declared in this scope
   21 |         vector<long long> x(n + 1);
      |                             ^
Language: C++

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

int main() {
	long a,b;
  cin>>a>>b;
  
  long hcf = __gcd(a,b);
  
  vector <long>arr1;
  vector <long>arr2;
  
  for(int i=1;i<=sqrt(hcf);i++)
  {
    if(hcf%i==0 && hcf/i!=i)
    {
      arr1.push_back(i);
      arr2.push_back(hcf/i);
  	}
    
    else if(hcf/i==i)
    {
      arr1.push_back(i);
    }
  }
  
  for(int i=0;i<arr2.size();i++)
  {
    arr1.push_back(arr2[i]);
  }
  
  int n=arr1.size();
  vector <long> res;
  res.push_back(arr1[0]);
  for(int i=1;i,n;i++)
  {
    if(arr[i]!=1)
    {
      res.push_back(i);
      for(int j=i;j<n;j++)
      {
        while(arr1[j]%i==0)
        {
          arr[j]/=i;
        }
      }
      	
    }
  }
  
  cout<<res.size()<<endl;
   
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:8: error: 'arr' was not declared in this scope; did you mean 'arr2'?
   38 |     if(arr[i]!=1)
      |        ^~~
      |        arr2
Language: C++

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

int warerudakewaru(long long x, long long y, int z) {
  if (x % y == 0) {
    z++;
    x /= y;
    warerudakewaru(x, y, z);
  }
  return z;
}

int main() {
  long long A, B, C = 1, D, E;
  cin >> A >> B;
  int ans = 0;
  E = min(A, B);
  for (long long i = 1; i <= E; i++) {
    if (min(A, B) < i) {
      break;
    }
    else if(A % i == 0 && B % i == 0) {
      A /= pow(i, warerudakewaru(A, i, 0));
      B /= pow(i, warerudakewaru(B, i, 0));
      C *= pow(i, min(warerudakewaru(A, i, 0), warerudakewaru(B, i, 0));
    }
  }
  if (C % 2 == 0) {
    ans++;
    D = C / 2;
  }
  else {
    D = C / 2 + 1;
  }
  for (int i = 0; i < D; i++) {
    if (C < (i * 2 + 1)) {
      break;
    }
     else if (C % (i * 2 + 1) == 0) {
      ans += warerudakewaru(C, (i * 2 + 1), 0);
      C /= pow((i * 2 + 1), warerudakewaru(C, (i * 2 + 1), 0));
    }
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:72: error: expected ')' before ';' token
   25 |       C *= pow(i, min(warerudakewaru(A, i, 0), warerudakewaru(B, i, 0));
      |               ~                                                        ^
      |                                                                        )
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using ul = unsigned long;

 
const ll INF = 1e9;
const ll MOD = 1e9+7;
const ll LINF = 1e18;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


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

bool is_prime[ 100000000005 ];
vector<ll> P;
void Eratosthenes( const ll N )
{
    for( ll i = 0; i*i <= N; i++ )
    {
        is_prime[ i ] = true;
    }    
    for( ll i = 2; i*i <= N; i++ )
    {
        if( is_prime[ i ] )
        {
            for( ll j = 2 * i; j*j <= N; j += i )
            {
                is_prime[ j ] = false;
            }
            P.emplace_back( i );
        }
    }
}

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

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

    return true;
}

int main(){
  ll a,b; cin>>a>>b;
  Eratosthenes(100000000005);
  ll ans=1;
  for(auto e:P){
    if(a%e==0 && b%e==0)ans++;
  }
  
  cout<<ans<<endl;
}

Compiler output:
/tmp/ccMkRv6J.o: in function `Eratosthenes(long long)':
a.cc:(.text+0x10e): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/ccMkRv6J.o
/tmp/ccMkRv6J.o: in function `main':
a.cc:(.text+0x21d): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/ccMkRv6J.o
/tmp/ccMkRv6J.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2dc): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/ccMkRv6J.o
a.cc:(.text+0x2f5): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/ccMkRv6J.o
collect2: error: ld returned 1 exit status
Language: C++

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

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

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

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

  // 素数である
  return true;
}

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

  long J = gcd(A,B);

  long len = 0;
    for (long i = 2; i <= J; i++) {
    if (Isprime(J)){
      len++;
      break;
    }
      if (J % i == 0) {
        len++;
        J /= i;
        while (J % i == 0) {
          J /= i;
        }
      }
    }

  cout << len+1 << endl;

  return 0;
}

Compiler output:
a.cc:14:1: error: expected unqualified-id before 'public'
   14 | public
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:46:9: error: 'Isprime' was not declared in this scope
   46 |     if (Isprime(J)){
      |         ^~~~~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,a) for(int i=0;i<int(a);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
using ll = long long;
using itn = int;
using namespace std;
using Graph = vector<vector<int>>;
static const long double GRATIO=(long double)(1+sqrt(5))/2;
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;
}
int main(){
    ll A,B;
    cin>>A>>B;
    vector<ll> Aprime(1000010,0),Bprime(1000010,0); 
    vector<ll> prime_list;
    vector<ll> table(1000010,0);
    for(ll i=2; i<1e9; i++){
        if(table[i]==0){
            prime_list.push_back(i);
            for(ll j=i; j<1e6; j+=i){
                table[j]++;
            }
        }
    }
    auto l=prime_list.begin();
    while(l!=prime_list.end()){
        if(A%(*l)==0) Aprime[(*l)]++;
        l++;
    }
    l=prime_list.begin();
    while(l!=prime_list.end()){
        if(B%(*l)==0) Bprime[(*l)]++;
        l++;
    }
    Aprime[1]++;
    Bprime[1]++;
    ll ans=0;
    rep(i,1000010){
        if(Aprime[i]&&Bprime[i]) ans++;
    }
    if(ans==1 && A!=1 %% B!=1) ans++;
    cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:49:24: error: expected primary-expression before '%' token
   49 |     if(ans==1 && A!=1 %% B!=1) ans++;
      |                        ^
Language: C++

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

vector<int> getPrime(int n) {
    vector<bool> v(n+1, true);
    v[0] = false;
    v[1] = false;
    for (int i = 2; i < sqrt(n) + 1; i++) {
        if (v[i] == false)
            continue;

        for (int j = i + i; j < n + 1; j += i)
            v[j] = false;
    }

    vector<int> prime;
    for (int i = 2; i < n + 1; i++)
        if (v[i])
            prime.push_back(i);

    return prime;
}

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

    long long sn = min(A, B);
    long long ln = max(A, B);
    vector<long long> divisor;
    for (int i = 1; i < sqrt(sn) + 1; i++) {
        if (sn%i != 0)
            continue;

        if (ln%i == 0)
            divisor.push_back(i);

        long long n = sn / i;
        if (ln%n == 0)
            divisor.push_back(n);
    }

    sort(divisor.begin(), divisor.end());
    divisor.erase(unique(divisor.begin(), divisor.end()), divisor.end());

    vector<int> prime = getPrime(divisor.back());
    prime.push_back(1);
    sort(prime.begin(), prime.end());

    //for (int i = 0; i < (int)divisor.size(); i++)
    //    cout << divisor[i] << endl;

    int ans = 0;
    for (int i = 0; i < (int)divisor.size(); i++) {
        int x = *lower_bound(prime.begin(), prime.end(), divisor[i]);
        if (x == divisor[i])
            ans++;
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'std::vector<int> getPrime(int)':
a.cc:12:25: error: 'sqrt' was not declared in this scope
   12 |     for (int i = 2; i < sqrt(n) + 1; i++) {
      |                         ^~~~
a.cc: In function 'int main()':
a.cc:36:25: error: 'sqrt' was not declared in this scope
   36 |     for (int i = 1; i < sqrt(sn) + 1; i++) {
      |                         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
//エラトステネスの篩
bool is_prime[1000000000000 + 1];
vector<ll> P;
void Eratosthenes(ll N) {
    for(ll i = 0; i <= N; i++) {
        is_prime[i] = true; //初期化
    }
    for(ll i = 2; i <= N; i++) {
        if(is_prime[i]) {
            for(ll j = 2 * i; j <= N; j += i) {
                is_prime[j] = false;
            }
            P.emplace_back(i);
        }
    }
}
int main() {
    // ifstream in("data1.txt");
    // cin.rdbuf(in.rdbuf());
    ll A, B;
    cin >> A >> B;
    ll x = gcd(A, B);
    ll ans = 1;

    Eratosthenes(x);

    for(const auto &x : P) {

        if(x == 0) {
            continue;
        }

        if(A % x == 0 && B % x == 0) {
            ans++;
        }
    }

    cout << ans << endl;
}


Compiler output:
/tmp/cc12WCSj.o: in function `Eratosthenes(long long)':
a.cc:(.text+0xc5): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/cc12WCSj.o
/tmp/cc12WCSj.o: in function `main':
a.cc:(.text+0x149): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/cc12WCSj.o
/tmp/cc12WCSj.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x226): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/cc12WCSj.o
a.cc:(.text+0x23f): relocation truncated to fit: R_X86_64_PC32 against symbol `P' defined in .bss section in /tmp/cc12WCSj.o
collect2: error: ld returned 1 exit status
Language: C++

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

int Gcd(int a,int b) {
    int gcd;
    // a>b zentei//
    gcd = a%b;
    if (gcd==0) {
        return b;
    }
    else{
    return Gcd(b,gcd);
    }
}

main () {
    int n,m;
    int lcm;

    cin >> n >> m;
    if (n<m) {
        s = n*m/Gcd(m,n);
    }
    else {
        s = n*m/Gcd(n,m);
    }

    //soinsuubunkai//

    int ans=1;

    for ( int i=2; i <=100000000000000000000; i++) {
        if (s%i ==0) {
            ans++;
            while (s%i==0) {
                s /= i;
            }
        }
        if (s==1) {
            break;
        }

    }

    cout << ans << endl;
}

Compiler output:
a.cc:32:24: warning: integer constant is too large for its type
   32 |     for ( int i=2; i <=100000000000000000000; i++) {
      |                        ^~~~~~~~~~~~~~~~~~~~~
a.cc:16:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   16 | main () {
      | ^~~~
a.cc: In function 'int main()':
a.cc:22:9: error: 's' was not declared in this scope
   22 |         s = n*m/Gcd(m,n);
      |         ^
a.cc:25:9: error: 's' was not declared in this scope
   25 |         s = n*m/Gcd(n,m);
      |         ^
a.cc:33:13: error: 's' was not declared in this scope
   33 |         if (s%i ==0) {
      |             ^
a.cc:39:13: error: 's' was not declared in this scope
   39 |         if (s==1) {
      |             ^
Language: C++

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

int main() {
  int a, b, t, i,j, count =0;
  cin >> a >> b;
  if(a<b){
    a=t;
    a=b;
    b=t;
  }
  while(a%b){
    a = b;
    b = a%b;
  }
  for(i=1;i<=b/2+b%2;i++)
	{
		yakusuu=0;
		for(j=1;j<=i;j++)
		{
			if(i%j==0) yakusuu++;
		}

		if(yakusuu==2) {
          if((b%i)!){
            count++;
          }
        }
	}
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'yakusuu' was not declared in this scope
   18 |                 yakusuu=0;
      |                 ^~~~~~~
a.cc:25:19: error: expected ')' before '!' token
   25 |           if((b%i)!){
      |             ~     ^
      |                   )
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <utility>
#include <functional>
#include <queue>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>      // std::setprecision
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/multiset_of.hpp>
#include <boost/multi_array.hpp>
#include <boost/math/common_factor.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/pending/disjoint_sets.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/strong_components.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/numeric/ublas/vector.hpp>

#define REP(i, N) for(int i=0; i<(N); i++)
#define REC(f, ...) const auto f = [&](const auto f, __VA_ARGS__)
using namespace std;
using namespace boost::math;
using namespace boost::numeric;
namespace bst = boost;
template<class T> void fill(T& v) { for (auto& i : v) cin >> i; }

int main() {
  long long A, B, r = 0;

  cin >> A >> B;
  vector<long long> hoge;
  for (long long i = 1; i * i <= A; i++) {
    if (B % i == 0) {
      hoge.push_back(i);
      hoge.push_back(A/i);
    }
  }
  
  bst::sort(A);
  
  REP(i, hoge.size())
    for(int j : bst::irange(i+1, (int)hoge.size())) {
      if (hoge[i] >= 0 && hoge[j] >= 0 && hoge[j] % hoge[i]) {
        hoge[j] = -1;
        r--;
      }
    }

  cout << hoge.size() + r << endl;

  return 0;
}


Compiler output:
a.cc:13:10: fatal error: boost/optional.hpp: No such file or directory
   13 | #include <boost/optional.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

int main()
{
  long long int A,B;
  long long int count=0;
  cin>>A>>B;
  vector<long long int>first(min(A,B));
  if(A==1||B==1)count=1;
  else
  {
      for(long long int i=2;i<(min(A,B)+1);i++)
    {
      if((A%i==0)&&(B%i==00))
      {
        int Judge=0;
        for(long longint j=2;j<i;j++)
        {
          if(i%j==0)
          {
            Judge=1;
            break;
          }    
        }
        if(Judge==0)count++;
      }
    }
    count++;
  }
  cout<<count<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: expected ';' before 'j'
   21 |         for(long longint j=2;j<i;j++)
      |                         ^~
      |                         ;
a.cc:21:26: error: 'j' was not declared in this scope
   21 |         for(long longint j=2;j<i;j++)
      |                          ^
a.cc:21:33: error: expected ')' before ';' token
   21 |         for(long longint j=2;j<i;j++)
      |            ~                    ^
      |                                 )
a.cc:21:34: error: 'j' was not declared in this scope
   21 |         for(long longint j=2;j<i;j++)
      |                                  ^
Language: Java

import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    long a = sc.nextLong();
    long b = sc.nextLong();
    //a,bの最大公約数を素因数分解して出てきた素数の個数+1が答え
    long c = gcd(a,b);
//    System.out.println(c);
    long answer = 0;
//    System.out.println(c);
    answer = 1;
    long tmp =0;
    for(long prime :primes(c)){
      if(tmp!=prime){
        if(isPrime(prime)){
//        System.out.println(prime);
        answer = answer +1;
        }
      }
      tmp=prime;
    }
    
    System.out.println(answer);
  }
  
    //最大公約数・最小公倍数（セットで使う）
    static long gcd (long a, long b) {return b>0?gcd(b,a%b):a;}
  
//素因数分解
  static List<Long> primes(long c){ 
    List<Long> primenums= new ArrayList<Long>();
            long x = c;
            long y = x;
//       System.out.println(Math.floor(Math.sqrt(x))+2);
          for (double i = 2; i<= Math.floor(Math.sqrt(x))*2; i++) {
//            System.out.println(i);
//            boolean divflg=false;
            if ((y % i) == 0 ) {
//               if(!divflg){
                primenums.add(i);
//               }
//                divflg=true;
            }
            
        }
    Collections.sort(primenums);
    return primenums;
  }
//素数判定
static boolean isPrime (long n) {
if (n==2) return true;
if (n<2 || n%2==0) return false;
double d = Math.sqrt(n);
for (int i=3; i<=d; i+=2) if(n%i==0){return false;}
 return true;
}
  
}

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

//A.cpp
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <queue>
#include <math.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

	long long ans = 1;

	vector<long long> x(n + 1);
	long long num = n; // 素因数分解する変数num

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

	for (int i = 2; i <= n; i++)
	{
    if(x.at(i) >= 1) ans++;
	}
	cout << ans << endl;
  printf("%d\n", cnt);
  return 0;
}


Compiler output:
a.cc:26:35: error: extended character 　 is not valid in an identifier
   26 |                         x.at(i)++;　//割った個数を配列に足す
      |                                   ^
a.cc: In function 'int main()':
a.cc:17:17: error: 'gcd' was not declared in this scope
   17 |   long long c = gcd(a,b);
      |                 ^~~
a.cc:21:29: error: 'n' was not declared in this scope
   21 |         vector<long long> x(n + 1);
      |                             ^
a.cc:26:35: error: '\U00003000' was not declared in this scope
   26 |                         x.at(i)++;　//割った個数を配列に足す
      |                                   ^~
a.cc:36:18: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |   printf("%d\n", cnt);
      |                  ^~~
      |                  int
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; i >=0; --i)

#define _REP(i,m,n) for(int i =m; i <n; ++i)

#define INF 2e9

using namespace std;
unsigned e_gcd(unsigned a, unsigned b){
    if(a < b) return e_gcd(b,a);
    unsigned r;
    while((r = a%b)){
        a = b;
        b = r;
    }
    return b;
}

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

    int num = e_gcd(a,b);
    vector<long long> g(num +1);
    int cnt = 0;

    _REP(i,1,num){
        if(num%i == 0){
            if(lcm(i) == 1) g[cnt] = i;
            cnt++;
        }
    }

  //  REP(i,cnt)cout << g[i] << " ";
  //  cout << endl;
  long long ans = 0;

  REP(i,cnt)REP(j,cnt){
      if(i == j)continue;
      if(e_gcd(g[i], g[j]) == 1)ans++;
  }

    cout << ans/2 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: no matching function for call to 'lcm(int&)'
   32 |             if(lcm(i) == 1) g[cnt] = i;
      |                ~~~^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/numeric:188:5: note: candidate: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::lcm(_Mn, _Nn)'
  188 |     lcm(_Mn __m, _Nn __n) noexcept
      |     ^~~
/usr/include/c++/14/numeric:188:5: note:   candidate expects 2 arguments, 1 provided
Language: C++

from math import gcd 
count = 0
CommonD = []
A, B = map(int, input().split())
for i in range(1,min(A,B)+1):
    if A % i == 0 and B % i == 0:
        CommonD.append(i)

for i in range(len(CommonD)-1):
    flag = "green"
    for j in range(i+1,len(CommonF)):
        print(CommonF[i], CommonF[j])
        if gcd(CommonF[i], CommonF[j]) != 1:
            flag = "red"
    if flag == "green":
        count += 1 
print(count)

Compiler output:
a.cc:1:1: error: 'from' does not name a type
    1 | from math import gcd
      | ^~~~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: lvalue required as left operand of assignment
   19 |     while(b % 2 = 0) b /= 2;
      |           ~~^~~
Language: C++

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

int A , B;

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

bool check(ll n){
  for(int i = 2; i * i <= n; ++i){
    if(n % i == 0)return false;
  }
  return true;
}

int main(){
  cin >> A >> B;
  ll n = gcd(A , B);
  vector<bool> vis((int)sqrt(n) + 5 , false);
  vector<ll> p;
  p.push_back(1);
  for(int i = 2; i <= sqrt(n) + 1; ++i){
    if(!vis[i]){
      p.push_back(i);
      for(int j = i; j <= sqrt(n) + 1; j += i){
        vis[j] = true;
      }
    }
  }
  vector<ll> f;
  f.push_back(1);
  for(int i = 1; i < p.size(); ++i){
    bool yes = false;
    while(n % p[i] == 0){
      n /= p[i];
      yes = true;
    }
    if(yes)f.push_back(p[i]);
  }
  if(check(n) && f.find(n) == f.end())f.push_back(n);
  cout << f.size() << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:20: error: 'class std::vector<long long int>' has no member named 'find'
   48 |   if(check(n) && f.find(n) == f.end())f.push_back(n);
      |                    ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <math.h>
#include <map>

long long euclid(long long a, long long b){
  long long red = a % b;
  if (red == 0){
    return b;
  } else {
    a = std::max(red, b);
    b = std::min(red, b);
    return euclid(a,b);
  }
}

bool is_prime(long long a){
  bool ans = false;
  if (a==1){
    return ans;
  }
  for (long long i=2; i<=sqrt(a); i++){
    if (a%i==0){
      ans = false;
    }
  }
  return ans;
}

int main(){
  long long A, B;
  scanf("%lld %lld",&A, &B);
  long long c = euclid(std::max(A,B),std::min(A,B));
  if (is_prime(c)){
    printf("2\n");
    return 0;
  }
  //printf("c=%d\n",c);
  long long ans=1; //1は回答の前提としておく
  long long root_c = long long(sqrt(c))+1;
  //printf("root_c+1=%lld\n",root_c+1);
  for (long long i=2; i<=std::min(c,root_c); i++){
      printf("i=%lld\n",i);
      if (c%i==0){
       ans++;
       c = c/i;
       while(c%i==0){
        c = c/i;
       }
      }
  }
  printf("%lld\n",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:22: error: expected primary-expression before 'long'
   40 |   long long root_c = long long(sqrt(c))+1;
      |                      ^~~~
Language: C++

#include <iostream>
#include <algorithm>
//#include <numeric>
//#include <cmath>
#include <vector>
//#include <string>
typedef long long LL;
using namespace std;

LL gcd(LL a, LL b){
    LL tmp; 
    if(a<b){
        tmp = a;
        a = b;
        b = tmp;
    }
    tmp = a%b;
    while(tmp!=0){
        a = b;
        b = tmp;
        tmp = a%b;
    }

    return b;
}

LL isqrt(LL n){
    LL x = n;
    LL y = (x+1)/2;
    while(y < x){
        x = y;
        y = (x + n/x)/2;
    }
    return x;
}

LL div(LL n, LL k){
    if(n%2==0){
        return 2;
    }
    if(n%3==0){
        return 3;
    }
    LL i = 6;
    while(i<k){
        if(n%(i-1)==0){
            return i-1;
        }
        if(n%(i+1)==0){
            return i+1;
        }
        i += 2;
    }
    return 1;
}

int main(){
    LL a, b;
    LL num_gcd;
    LL tmp_gcd;
    LL tmp_isqrt;
    LL tmp_div;
    int ans = 0;
    vector<LL> list_div;
    cin >> a >> b;
    num_gcd = gcd(a, b);
    tmp_gcd = num_gcd;
    tmp_isqrt = isqrt(tmp_gcd);
    while(true){
        tmp_div = div(tmp_gcd, tmp_isqrt);
        list_div.push_back(tmp_div);
        //cout << tmp_gcd << " " << tmp_div << endl;
        if(tmp_div==1){
            break;
        }
        tmp_gcd = tmp_gcd / tmp_div;
    }

    sort(list_div.begin(), list_div.end());
    list_div.erase(unique(list_div.begin(), list_div.end()), list_div.end());
    cout << list_div.size() << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:22: error: call of overloaded 'div(LL&, LL&)' is ambiguous
   70 |         tmp_div = div(tmp_gcd, tmp_isqrt);
      |                   ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: candidate: 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc:37:4: note: candidate: 'LL div(LL, LL)'
   37 | LL div(LL n, LL k){
      |    ^~~
/usr/include/c++/14/cstdlib:219:3: note: candidate: 'lldiv_t __gnu_cxx::div(long long int, long long int)'
  219 |   div(long long __n, long long __d)
      |   ^~~
/usr/include/c++/14/cstdlib:181:3: note: candidate: 'ldiv_t std::div(long int, long int)'
  181 |   div(long __i, long __j) _GLIBCXX_NOTHROW { return ldiv(__i, __j); }
      |   ^~~
Language: C++

#include <iostream>
#include <string.h>
#include <algorithm>
typedef long long ll;
using namespace std;

ll gcd(ll a,ll b){
    /* 自然数 a > b を確認・入替 */
    ll r,tmp;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  /* ユークリッドの互除法 */
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}

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

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

    // 素数である
    return true;
}

int main()
{
    ll a,b,m,c,ans=1,i=3;
    cin >> a >> b;
    m = c =  gcd(a,b);
    if(m%2==0){
        ans++;
    }
    while(i*i<=m){
        if(m%i==0 && IsPrime(i)){
            ans++;
        }
        i+=2;
    }
    cout << ans;
}

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

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


int gcd(int a,int b) {
  if (a >= b && a%b == 0) {
    return b;
  }else if (b > a && b%a == 0) {
    return a;
  }else if (b>a && b%a != 0) {
    return gcd(a,b%a);
  }else{
    return gcd(b,a%b);
  }
}


int main() {
  int A,B;
  cin >> A >> B;
  int C;
  C = gcd(A,B);
  int a=0;
  int D = C;
  if (C == 1) {
    cout << C << endl;
  }else{
    for (int i=2; i<C; ++i) {
      if (D % i == 0) {
      ++a;
      while (D % i == 0) {
        D /= i;
      }
      if (D == 1) {
        break;
      }
    }
    int b = a+1;
    cout << b << endl;
  }
}
  
  
  
  
  
  
  
  

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

#include<stdio.h>
int main (){
  int a,b:
  int min;
  scanf("%d%d",&a,&b);
  if(a<b){
    min=a;
  }
  else{min=b;}
  for (int i=0,i<min;i++){
    if (a%i==0||b%i=0){
      for (int j=2;j<i;j++)
        if(i%j==0){
          break;
        }
      else{
        count=count+1;
      }
    }
  }
  printf("%d\n",count);
}
      
    
      

Compiler output:
main.c: In function 'main':
main.c:3:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before ':' token
    3 |   int a,b:
      |          ^
main.c:5:20: error: 'b' undeclared (first use in this function)
    5 |   scanf("%d%d",&a,&b);
      |                    ^
main.c:5:20: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:5: error: 'min' undeclared (first use in this function); did you mean 'main'?
    7 |     min=a;
      |     ^~~
      |     main
main.c:10:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   10 |   for (int i=0,i<min;i++){
      |                 ^
main.c:10:25: error: expected ';' before ')' token
   10 |   for (int i=0,i<min;i++){
      |                         ^
      |                         ;
main.c:17:9: error: 'count' undeclared (first use in this function)
   17 |         count=count+1;
      |         ^~~~~
Language: C++

#include <iostream>
#include <string>
using namespace std;
int gcd(int a, int b);
bool is_prime(const unsigned n);

int main() {
    int a, b, c, i, cnt, buf, *gcd_c;
    cnt = 0;
    buf = 0;
    scanf("%d %d", &a, &b);

    c = a;
    if (a > b){
        c = b;        
    }
    gcd_c = new int[c];
    for (i = 1; i <= c; i++){
        if (a % i == 0 && b % i == 0){
            gcd_c[i] = i;
        }
        //cout << gcd_c[i] << " ";
    }
    for (i = 1; i <= gcd(a, b); i++){
        if(gcd_c[i] == 0){
            continue;
        }
        if(gcd_c[i] == 1 || is_prime(gcd_c[i])){
            cnt++;
        }

    }
    cout << cnt << endl;

}

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

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

int64_t GCD(int64_t a, int64_t b) {
  int64_t r, tmp;
  if(a < b) {
    tmp = a;
    a = b;
    b = tmp;
  }
  r = a % b;
  while(r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
  
int64_t primeN(int64_t n) {
  int64_t count = 0;
  vector<bool> prime(n + 1, true);
  if(n >= 0) prime.at(0) = false;
  if(n >= 1) prime.at(1) = false;
  for(int i = 2; i * i <= n; i++) {
    if(!prime.at(i)) continue;
    for(int j = i + i; j <= n; j += i) {
      prime.at(j) = false;
    }
  }
  for(int i = 1; i < n + 1; i++) {
    if(n % i == 0 && prime.at(i)) {
      count++;
    }
  }
  return count;
}

int64_t main() {
  int64_t A, B, gcd;
  cin >> A >> B;
  gcd = GCD(A, B);
  cout << primeN(gcd) + 1 << endl;
}

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

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

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

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

	// 素数である
	return true;
}

void prime(int n, queue<int> &q) {

	rep2(i, 2, n) {
		if (IsPrime(i)) q.push(i);
	}
}
int main()
{
	int a, b;
	cin >> a >> b;

	int n = min(a, b);
	queue<int> q;

	prime(n, q);

	int count = 1;

	int N = q.size();
	vector<int> p(N);
	rep(i, N) {
		int a = q.front(); q.pop();
		p.at(i) = a;
	}
	rep(i, N) {
		if (a% p.at(i) == 0 && b% p.at(i) == 0&&p.at(i)<n) ++count;
	}
	cout << count << endl;
}

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

#include <stdio.h>

int main(void)
{

  int a, b, r, tmp;

  scanf("%d%d", &a,&b);
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }

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


  printf("%d\n", b);

  return 0;
}


Compiler output:
a.cc:15:2: error: extended character 　 is not valid in an identifier
   15 |  　r = a % b;
      |  ^
a.cc: In function 'int main()':
a.cc:15:2: error: '\U00003000r' was not declared in this scope
   15 |  　r = a % b;
      |  ^~~
Language: C++

#include <stdio.h>
 
int main(void)
{
 
  int a, b, r, tmp;
 
  scanf("%d", &a);
  scanf("%d", &b);
 
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
 　r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
 
  
  printf("%d\n", b);
 
  return 0;
}


Compiler output:
a.cc:17:2: error: extended character 　 is not valid in an identifier
   17 |  　r = a % b;
      |  ^
a.cc: In function 'int main()':
a.cc:17:2: error: '\U00003000r' was not declared in this scope
   17 |  　r = a % b;
      |  ^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:33:30: error: expected primary-expression before 'long'
   33 |     for(long long i = 2; i < long long(sqrt(a)) + 3; i++)
      |                              ^~~~
a.cc:33:29: error: expected ';' before 'long'
   33 |     for(long long i = 2; i < long long(sqrt(a)) + 3; i++)
      |                             ^~~~~
      |                             ;
a.cc:33:30: error: expected primary-expression before 'long'
   33 |     for(long long i = 2; i < long long(sqrt(a)) + 3; i++)
      |                              ^~~~
a.cc:33:29: error: expected ')' before 'long'
   33 |     for(long long i = 2; i < long long(sqrt(a)) + 3; i++)
      |        ~                    ^~~~~
      |                             )
a.cc:33:30: error: expected primary-expression before 'long'
   33 |     for(long long i = 2; i < long long(sqrt(a)) + 3; i++)
      |                              ^~~~
a.cc:33:54: error: 'i' was not declared in this scope
   33 |     for(long long i = 2; i < long long(sqrt(a)) + 3; i++)
      |                                                      ^
Language: C++

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

using namespace std;

int main() {
	long long a, b;
	long long N, M, K;
	vector<long> sosu;
	bool flag = false;
	
	cin >> a >> b;
	N = a < b ? a : b;

	sosu.push_back(1);

	for (long i = 2; i <= sqrt(N); i++) {
		for (long j = 1; j < sosu.size(); j++) {
			if (i % sosu[j] == 0) {
				flag = true;
				break;
			}
		}
		if (flag) {
			flag = false;
		}
		else {
			if (a % i == 0 && b % i == 0) {
				sosu.push_back(i);
			}
		}
	}

	cout << sosu.size();
}

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

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

ll kouyaku(ll a, ll b){
    ll m = min(a,b),ans;
    VLL k;
    for(ll i=1; i<=m ; ++i){
        if(a%i == 0 && b%i == 0){
            if(prime(i))ans++;
        }
    }
    return ans;
}

bool prime(ll num){
    
    if(num == 2 || num == 1)return true;
    if(num % 2 == 0)return false;
    for(ll i=3; i<=sqrt((double)num); i+=2 ){
        if(num % i == 0)return false;
    }
    return true;
}
/*ll countprime(VLL a,ll size){
    ll ans = 0;
    for(ll i=0; i<size; ++i){
        if(prime(a[i]))ans++;
    }
    return ans;
}*/


int main(){
    ll a,b,ans;
    cin >> a >> b;
    ans=kouyaku(a,b);
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'll kouyaku(ll, ll)':
a.cc:12:16: error: 'prime' was not declared in this scope
   12 |             if(prime(i))ans++;
      |                ^~~~~
Language: C++

// #include <iostream>
// #include <string>
// #include <math.h>
// #include <map>
// #include <vector>
// #include <tuple>
// #include <algorithm>
// #include <queue>
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define vi vector<int>
#define vlli vector<lli>
#define pii pair<int, int>
#define plli pair <lli, lli>
#define F(i,n) for(lli (i)=0;(i)<(n);(i)++)
#define FR(i,n) for(lli (i)=(n)-1;(i)>=0;(i)--)
#define FSG(i,a,b) for(lli (i)=(a);(i)<(b);(i)++)
#define FSGR(i,a,b) for(lli (i)=(b)-1;(i)>=(a);(i)--)
#define VAL(n) cout << n << endl;
#define VALD(n) cout << #n << ": " << n << endl;
bool IsPrime(long long num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    long long sqrtNum = sqrt(num);
    for (long long 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 minv = min(A, B);
  long long maxv = max(A, B);
  long long cnt = 1;
  if(minv != 1 && maxv % minv == 0 %% IsPrime(minv)){
    cnt++;
  }
  long long tmp = 0;
  if(minv %2 == 0){
    if(maxv % 2 == 0){
      cnt ++;
    }
    tmp = minv / 2;
    if(tmp != 2 && maxv % tmp == 0 && IsPrime(tmp)){
      cnt++;
    }
  }
  long long a = 3;
  while(minv >= a*a){
    if(minv%a == 0){
      if(maxv % a == 0 && IsPrime(a)){
        cnt++;
      }
      tmp = minv / a;
      if(tmp != a && maxv % tmp == 0 && IsPrime(tmp)){
        cnt++;
      }
    }
    a+=2;
  }
  cout << cnt << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:45:37: error: expected primary-expression before '%' token
   45 |   if(minv != 1 && maxv % minv == 0 %% IsPrime(minv)){
      |                                     ^