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

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

int main()
{
  long a[i]={0};
  int N;
  for(int i=1;i<=N;i++){
    cin>>a[i];
    a[i]*=1000000;
    a[i]+=i;
  }
  sort(A,A+N);
  for(int i=1;i<=N;i++) cout<<a[i]%1000000<<' ';
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:10: error: 'i' was not declared in this scope
    6 |   long a[i]={0};
      |          ^
a.cc:9:10: error: 'a' was not declared in this scope
    9 |     cin>>a[i];
      |          ^
a.cc:13:8: error: 'A' was not declared in this scope
   13 |   sort(A,A+N);
      |        ^
a.cc:14:31: error: 'a' was not declared in this scope
   14 |   for(int i=1;i<=N;i++) cout<<a[i]%1000000<<' ';
      |                               ^
Language: C++

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

int main(){

  int N;
  cin >> N;
  std::vector<int> seito(N);
  std::vector<int> junban(N);
  for(int i=0;i<N;++i) cin >> seito[i];

  for(int i=0;i<N;++i){
    junban[seito[i]-1] = i+1
  }

  for(int i=0;i<N-1;++i){
    cout << junban[i] << " ";
  }
  cout << junban[N-1] << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: expected ';' before '}' token
   16 |     junban[seito[i]-1] = i+1
      |                             ^
      |                             ;
   17 |   }
      |   ~
Language: C++

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

int main(){

  int N;
  cin >> N;
  std::vector<int> seito(N);
  std::vector<int> junban(N);
  for(int i=0;i<N;++i) cin >> seito[i];

  for(int i=0;i<N;++i){
    junban[seito[i]-1] = i+1
  }

  for(int i=0;i<N-1;++i){
    cout << junban[i] << " ";
  }
  cout << junban[N-1] << endl;
  
    // for(int i=0;i<N;++i){
    // for(int j=0;j<N;++j){
    //   if(seito[j]==i+1){
    //     cout << j+1;
    //     if(i!=N-1) cout << " ";
    //   }
    // }
    // }
    // 
    // cout << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:29: error: expected ';' before '}' token
   16 |     junban[seito[i]-1] = i+1
      |                             ^
      |                             ;
   17 |   }
      |   ~
Language: C++

using namespace std;
long n;
 
int main() {
    cin >> n;
    long a;
    vector<long> junban(n);
    for(long i = 0; i < n; i++){
        cin >> a;
        junban[a-1] += i+1;
    }
    for(long j = 0; j < n; j++){
        cout << junban[j] << " ";
    }
    cout << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:7:5: error: 'vector' was not declared in this scope
    7 |     vector<long> junban(n);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:7:12: error: expected primary-expression before 'long'
    7 |     vector<long> junban(n);
      |            ^~~~
a.cc:10:9: error: 'junban' was not declared in this scope
   10 |         junban[a-1] += i+1;
      |         ^~~~~~
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << junban[j] << " ";
      |         ^~~~
a.cc:13:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:13:17: error: 'junban' was not declared in this scope
   13 |         cout << junban[j] << " ";
      |                 ^~~~~~
a.cc:15:5: error: 'cout' was not declared in this scope
   15 |     cout << endl;
      |     ^~~~
a.cc:15:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:13: error: 'endl' was not declared in this scope
   15 |     cout << endl;
      |             ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
int cmp_char(const void *a, const void *b){return *(char*)a - *(char*)b;} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b){return strcmp(*(const char **)a, *(const char **)b);} /* aaa,aab.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)

int st[100001];

int acs(const void *a, const void *b)
{
  return st[*(int*)a] - st[*(int*)b];
}

int main(void) {
  int n;
  scanf("%d", &n);

  int i;
  for (i = 0; i< n; i++)
    scanf("%d", &st[i]);

  int idx[100001];
  for (i = 0; i < n; i++)
    idx[i] = i;

  qsort(idx, n, sizeof(int), acs);
  for (i = 0; i< n; i++)
    pritnf("%d ", idx[i]);
  printf("\n");
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:34:5: error: implicit declaration of function 'pritnf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   34 |     pritnf("%d ", idx[i]);
      |     ^~~~~~
      |     printf
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
using namespace std;
struct people{
    int id,time;
    operator<(const people &rhs)const{
        return time < rhs.time;
    }
};
vector<people>v;
int main()
{
    int n,tmp;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>tmp;
        v.push_back({i,tmp});
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++){
        if(i==0)
            cout<<v[i].id;
        else
            cout<<' '<<v[i].id;
    }
    cout<<endl;
    return 0;
}


Compiler output:
a.cc:8:5: error: ISO C++ forbids declaration of 'operator<' with no type [-fpermissive]
    8 |     operator<(const people &rhs)const{
      |     ^~~~~~~~
Language: C++

import numpy as np

def solve(n, A):
    print(' '.join(list(map(lambda x: str(x+1), np.argsort(A)))))

n = int(input())
A = list(map(int, input().split()))

solve(n, A)

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import numpy as np
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

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

#define ll long long
#define in ({ll x=0;int o=0,c=getchar();for(;!isdigit(c);c=getchar()) o=c=='-';for(;isdigit(c);c=getchar()) x=x*10+c-'0';o?-x:x;})
#define inchar ({char c=getchar();while(c==' '||c=='\n') c=getchar();c;})
#define instring ({string s;char c=getchar();while(c==' '||c=='\n') c=getchar();while(c!=' '&&c!='\n') s+=c,c=getchar();s;})

#define FOR(i,a,b) for(auto i=a;i<=b;i++)
#define ROF(i,a,b) for(auto i=b;a<=i;i--)
#define rr(x) " "<<#x<<'='<<x<<" "

#define bitnum(x) __builtin_popcountll(x)
#define bitl(x) (64-__builtin_clzll(x))
#define bit(x,i) ((x>>(i-1))&1ll)
#define on(x,i) (x|(1ll<<(i-1)))
#define off(x,i) (x&~(1ll<<(i-1)))

#define mt make_tuple
#define pi pair<int,int>
#define x first
#define y second

#define VEC(i,a) for(auto&i:a)
#define pb push_back
#define allv(a) a.begin(),a.end()
#define endv(a) (int)a.size()-1

#define ifnot(x) if(!(x))
#define middle(a,b) (a+(b-(a))/2)
#define bp(x) ((x)*(x))
#define pw2(x) (1ll<<x)

#define Min(a,b) ({bool o=false;if(a>b) {a=b;o=true;};o;})
#define Max(a,b) ({bool o=false;if(a<b) {a=b;o=true;};o;})
////////////////////////////////////////// HUX
const int N=1e5+5;
int n;
pi a[N];a
main()
{
    n=in;
    FOR(i,1,n) a[i]={in,i};
    sort(a+1,a+n+1);
    FOR(i,1,n) cout<<a[i].y<<" ";
}


Compiler output:
a.cc:45:9: error: 'a' does not name a type
   45 | pi a[N];a
      |         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N; cin >> N;
  vector<pair<int, int>> m(N);
  for(int i=0;i<N;i++){
    cin >> m[i].first();
    m[i].second=i+1;
  }
  sort(m.begin(),m.end());
  for(int i=0;i<N;i++){
    cout << m[i].second << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expression cannot be used as a function
    7 |     cin >> m[i].first();
      |            ~~~~~~~~~~^~
Language: C++

#include <iostream>
#include <vector>

using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < n; ++i)
int main() {
	int n;
	cin >> n;
	vector<pair<int, int>> v(n);
	REP(i, n) {
		int a;
		cin >> a;
		v[i] = {a, i};
	}
	sort(v.begin(), v.end());
	REP(i, n) {
		cout << v[i].second + 1 << " ";
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   16 |         sort(v.begin(), v.end());
      |         ^~~~
      |         short
Language: C++

#include <bits/stdc++.h>

#define ff first
#define ss second
#define mp make_pair

using namespace std;

typedef long long ll;

vector<pair<int,int> v;

int main() {
    int n,a;

    scanf("%d", &n);

    for(int i = 1; i <= n; i++) {
    	scanf("%d", &a);
    	v.push_back(mp(a,i));
    }

    sort(v.begin(), v.end());

    for(int i = 0; i < n; i++) {
    	printf("%d%c", v[i].ss, " \n"[i==n-1]);
    }
}


Compiler output:
a.cc:11:22: error: template argument 1 is invalid
   11 | vector<pair<int,int> v;
      |                      ^
a.cc:11:22: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:20:9: error: 'v' was not declared in this scope
   20 |         v.push_back(mp(a,i));
      |         ^
a.cc:23:10: error: 'v' was not declared in this scope
   23 |     sort(v.begin(), v.end());
      |          ^
Language: C++

N = int(input())
A = [int(i) for i in input().split()]
AA = [(0,0) for i in range(N)]

for i in range(N):
  AA[i] = (A[i], i+1)
  
AA.sort()

for i in range(N-1):
  print(AA[i][1], end = " ")
  
print(AA[N-1][1])

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

  int N; cin>>N;
  vector<int> A(N); for (auto& a : A) cin>>a;
  vector<int> order(N);
  iota(order.begin(), order.end(), 0);
  sort(order.begin(), order.end(), [](int l, int r) {return A[l] < A[r]});
  for (auto o : order) {
    cout << o+1 << endl;
  }

  return 0;
}


Compiler output:
a.cc: In lambda function:
a.cc:12:61: error: 'A' is not captured
   12 |   sort(order.begin(), order.end(), [](int l, int r) {return A[l] < A[r]});
      |                                                             ^
a.cc:12:37: note: the lambda has no capture-default
   12 |   sort(order.begin(), order.end(), [](int l, int r) {return A[l] < A[r]});
      |                                     ^
a.cc:9:15: note: 'std::vector<int> A' declared here
    9 |   vector<int> A(N); for (auto& a : A) cin>>a;
      |               ^
a.cc:12:68: error: 'A' is not captured
   12 |   sort(order.begin(), order.end(), [](int l, int r) {return A[l] < A[r]});
      |                                                                    ^
a.cc:12:37: note: the lambda has no capture-default
   12 |   sort(order.begin(), order.end(), [](int l, int r) {return A[l] < A[r]});
      |                                     ^
a.cc:9:15: note: 'std::vector<int> A' declared here
    9 |   vector<int> A(N); for (auto& a : A) cin>>a;
      |               ^
a.cc:12:72: error: expected ';' before '}' token
   12 |   sort(order.begin(), order.end(), [](int l, int r) {return A[l] < A[r]});
      |                                                                        ^
      |                                                                        ;
Language: C++

#include <iostream>
#include <cstring>
#include<vector>
#include <algorithm>
#include<cstdlib>
#include<set>
#include<math.h>
#include<map>
#include<iomanip>
 
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define rep(n,x) for(ll i=0;i<n;i++) cin>>x[i];
 
ll gcd(ll x, ll y)
{
	if (x % y == 0) return y;
	else return gcd(y, x % y);
}
// 1or素数だと１を返す
ll prime(ll x) 
{
	for (ll i = 2; i * i <= x; i++)
	{
		if (x % i == 0) return 0;
	}
	return 1;
}
int main()
{
	ll a, b;
	cin >> a >> b;
	ll ans = 1;
  
  
	ll c;
	if (a < b)
	{
		c = a;
		a = b;
		b = c;
	}
  
	for (ll i = 2; i  <= a; i++)
	{
		if (a % i == 0 && b % i == 0)
		{
			ans++;
			while (a % i == 0)
			{
				a /= i;
			}
		}
	}
 
	cout << ans << "\n";
 

Compiler output:
a.cc: In function 'int main()':
a.cc:57:29: error: expected '}' at end of input
   57 |         cout << ans << "\n";
      |                             ^
a.cc:31:1: note: to match this '{'
   31 | {
      | ^
Language: Java

import java.util.Scanner;

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

		while (input.hasNext()) {
			long A = input.nextLong();
			long B = input.nextLong();
			long gcdAB = gcd(A, B);

			int countPrimeFactor = 0;
			for (int i = 2; i * i <= gcdAB; ++i) {
				if (gcdAB % i == 0) {
					++countPrimeFactor;
					
					while (gcdAB % i == 0) {
						gcdAB /= i;
					}
				}
			}
			
			if (gcdAB != 1) {
				++countPrimeFactor;
			}
			
			System.out.println(countPrimeFactor + 1);
		}
	}

	private static long gcd(long a, long b) {
		return b == 0 ? a : gcd(b, a % b);
	}
}


Compiler output:
Main.java:3: error: class ABC142D is public, should be declared in a file named ABC142D.java
public class ABC142D {
       ^
1 error
Language: C++

#include <iostream>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#include <algorithm>
#include <bits/stdc++.h>
#define MOD 1000000000000000000
#define ll long long
#define mm(arr) memset(arr, 1, sizeof(arr))
#define scanArray(a,n) for(ll i = 0; i < n; i++){cin >> a[i];}
using namespace std;
void prime(int n1);
int main(){
    FAST
    ll a,b; cin >> a >> b;
    ll n1 = __gcd(a,b);
    prime(n1);
    return 0;
}
void prime(ll n1){
    map<ll,ll>found;
    ll cnt=0;
    for(ll i=2; i*i<=n1; i++){
        while(n1%i == 0){
            n1/=i;
            if(found[i]>0){
                continue;
            }
            found[i]++;
            cnt++;
        }
    }
    if(n1!=1){
        cout << cnt+2 << endl;
    }
    else{
        cout << cnt+1 << endl;
    }
}


Compiler output:
/usr/bin/ld: /tmp/cc3O43Nc.o: in function `main':
a.cc:(.text+0x80): undefined reference to `prime(int)'
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream>
#include <vector>

std::vector<long long> divisors(long long n) {
	std::vector<long long> ret(0), st(0);
	for (int i = 1; i <= n / i; i++) {
		if (n % i == 0) {
			ret.push_back(i);
			if (i < n / i) st.push_back(n / i);
		}
	}
	while (st.size()) {ret.push_back(st.back()); st.pop_back();}
	return ret;
}

int main() {
	long long a, b;
	std::cin >> a >> b;
	std::vector<long long> v = divisors(a), w = divisors(b);
	long long ans = 1;
	for (auto i : v) {
		auto itr = lower_bound(w.begin(), w.end(), i);
		if (itr != w.end() && *itr == i && is_prime(i)) ans++;
	}
	std::cout << ans << '\n';
 
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:52: error: 'is_prime' was not declared in this scope
   23 |                 if (itr != w.end() && *itr == i && is_prime(i)) ans++;
      |                                                    ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const ll N=1e9+7;
ll A[N];
vector<ll>v;
void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}
ll gcd(ll a,ll b)
{
    while(b!=0)
    {
        ll t=b;
        b=a%b;
        a=t;
    }
    return a;
}
int main()
{
    sieve();
   ll a,b,cnt=0;
   cin>>a>>b;
   ll d=gcd(max(a,b),min(a,b));
   for(ll i=0;v[i]<=sqrt(d);i++)
   {
       if(d%v[i]==0)
       {
           while(d%v[i]==0)
             {
                 d/=v[i];
             }
           cnt++;
       }
   }
   if(d!=1)
   {
       cnt++;
   }
   cout<<cnt+1<<endl;
return 0;
}


//bool is_prime(ll n){
//    if(n==1) return 1;
//for(ll i=2;i*i<=n;i++)
//    if(n%i==0) return 0;
//    return 1;
//}
//
//int main(){
//   ios::sync_with_stdio(0);
//        cin.tie(0);
//        cout.tie(0);
////        map<ll,ll> ma;
//        vector<ll>v1;
//ll a,b;
//cin>>a>>b;
//ll mx=max(a,b);
//for(ll i=1;i*i<=mx;i++){
//    if(a%i==0&&b%i==0)
//        v1.push_back(i);
//}
//ll cnt=0;
//for(ll i=0;i<v1.size();i++){
//if(is_prime(v1[i]))
//    cnt++;
////cout<<v1[i]<<" ";
//}
//
//cout<<cnt;
//
//}









Compiler output:
/tmp/ccwyL4dt.o: in function `sieve()':
a.cc:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
a.cc:(.text+0xaa): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
/tmp/ccwyL4dt.o: in function `main':
a.cc:(.text+0x19b): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
a.cc:(.text+0x1cf): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
a.cc:(.text+0x1f5): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
a.cc:(.text+0x231): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
/tmp/ccwyL4dt.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x2be): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
a.cc:(.text+0x2d7): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccwyL4dt.o
collect2: error: ld returned 1 exit status
Language: C++

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

using namespace std;
using ll = long long;

template<class T>
map<int,int> prime_factorization(T N) {
  vector<bool> sieve(N+1, true);
  map<int, int> m;
  int s = sqrt(N) + 1;
  for (int i = 2; i <= s; ++i) {
    if (!sieve[i]) {
      continue;
    }
    while (N % i == 0) {
      ++m[i];
      N /= i;
    }
    if (N == 1) break;
    for (int j = 2 * i; j < s; j += i) sieve[j] = false;
  }
  if (N != 1) ++m[N];
  return m;
}

int main() {
  ll A, B;
  cin >> A >> B;
  cout << prime_factorization(gcd(A,B)).size() + 1 << endl;
}


Compiler output:
a.cc: In instantiation of 'std::map<int, int> prime_factorization(T) [with T = long long int]':
a.cc:32:30:   required from here
   32 |   cout << prime_factorization(gcd(A,B)).size() + 1 << endl;
      |           ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
a.cc:13:15: error: 'sqrt' was not declared in this scope
   13 |   int s = sqrt(N) + 1;
      |           ~~~~^~~
Language: C++

#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define range(i,l,h) for(int i=l;i<h;i++)
#define endl '\n'
#define I INT_MAX
#define L INT_MIN
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vi vector<int>
using namespace std;
using std::ios;
constexpr int MOD=1e9+7;
constexpr int mod=998244353;
const int mxn=10000005;
vector<int> p;
bool prime[mxn];

void seive() 
{ 
  for (int p=2;p*p<=mxn;p++) 
  {      
   if(prime[p]) 
    { 
      for (int i=p*p;i<=mxn;i+=p) 
      prime[i]=false;   
    } 
  }

  for (int i=1;i<=mxn; i++) 
    if (prime[i])
    {
      if(i*i>a||i*i>b)break;
      p.pb(i);
    }
} 

int main()
{
  fastio;
  
  memset(prime, true, sizeof(prime)); 
  seive();
  ll a,b;
  cin>>a>>b;

  int ans=0;
  for(int i=0;i<p.size();i++)
  {
    if(a%(ll)p[i]==0&&b%(ll)p[i]==0)
    {
      //cout<<p[i]<<' ';
      ans++;
    }
  }
  //if(__gcd(a,b)==1)cout<<0;
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'void seive()':
a.cc:34:14: error: 'a' was not declared in this scope
   34 |       if(i*i>a||i*i>b)break;
      |              ^
a.cc:34:21: error: 'b' was not declared in this scope
   34 |       if(i*i>a||i*i>b)break;
      |                     ^
Language: C++

#include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define range(i,l,h) for(int i=l;i<h;i++)
#define endl '\n'
#define I INT_MAX
#define L INT_MIN
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vi vector<int>
using namespace std;
using std::ios;
constexpr int MOD=1e9+7;
constexpr int mod=998244353;
const int mxn=10000005;
vector<int> p;
bool prime[mxn];

void seive() 
{ 
  for (int p=2;p*p<=mxn;p++) 
  {      
   if(prime[p]) 
    { 
      for (int i=p*p;i<=mxn;i+=p) 
      prime[i]=false;   
    } 
  }

  for (int i=1;i<=mxn; i++) 
    if (prime[i])
    {
      //cout<<i<<' ';
      p.pb(i);
    }
} 

int main()
{
  fastio;
  memset(prime, true, sizeof(prime)); 
  seive();
  ll a,b;
  cin>>a>>b;

  int ans=0;
  for(int i=0;i<p.size();i++)
  {
    if(a%(ll)p[i]==0&&b%(ll)p[i]==0)
    {
      //cout<<p[i]<<' ';
      ans++;
    }
  }
  //if(__gcd(a,b)==1)cout<<0;
  else cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:57:3: error: 'else' without a previous 'if'
   57 |   else cout<<ans<<endl;
      |   ^~~~
Language: C++

/*ヽ｀、ヽ｀｀、ヽ｀ヽ｀、、ヽ ｀ヽ 、ヽ｀｀ヽヽ｀ヽ、ヽ｀
ヽ｀、ヽ｀｀、ヽ 、｀｀、 ｀、ヽ｀ 、｀ ヽ｀ヽ、ヽ ｀、ヽ｀｀、
ヽ、｀｀、｀、ヽ｀｀、 、ヽヽ｀、｀、、ヽヽ、｀｀、 、 ヽ｀、
ヽ｀｀、 ヽ｀ヽ｀、、ヽ ｀ヽ 、 ヽ｀｀｀｀ヽヽヽ｀、、ヽ｀、、ヽ*/
#include <bits/stdc++.h> 
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long   ll;
typedef long double ld;
typedef complex< ld > cd;
 
typedef pair<int, int> pi;
typedef pair<ll, ll>   pl;
typedef pair<ld, ld>   pd;
 
typedef vector< int > vi;
typedef vector< ld >  vd;
typedef vector< ll >  vl;
typedef vector< pi >  vpi;
typedef vector< pl >  vpl;
typedef vector< cd >  vcd;
 
#define l00p(i, a, b) for (int i=a; i<(b); i++)
#define loop(i, a)    for (int i=0; i<(a); i++)
#define rep1(i, a, b) for (int i = (b)-1; i >= a; i--)
#define rep(i, a)     for (int i = (a)-1; i >= 0; i--)
#define trav(a, x)    for (auto& a : x)
#define uid(a, b)     uniform_int_distribution<int>(a, b)(rng)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f  first
#define s  second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
//#define MOD 998244353
 
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const ld pii=3.14159265359; 
const int MOD = 1000000007;
const char nl = '\n';
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
map<int,int> ma,mb;
map<int,int> fac(ll n)
{
	map<int,int> f;
	while(n%2==0)
	{
		n/=2;
		f[2]++;
	}
	for(ll i=3;i<=sqrt(n);i+=2)
	{
		while(n%i==0)
		{
			n/=i;
			f[i]++;
		}
	}
	if(n>1)
	f[n]++;
	return f;
}
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); 
	ll a,b;
	cin>>a>>b;
	ma=fac(a);
	mb=fac(b);
	trav(i,ma)
	{
		ans+=min(i.s,mb[i.f]);
	}
	cout<<ans+1;
	return 0;
}
// read the question correctly (ll vs int)
// template by bqi343

Compiler output:
a.cc: In function 'int main()':
a.cc:89:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   89 |                 ans+=min(i.s,mb[i.f]);
      |                 ^~~
      |                 abs
a.cc:91:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   91 |         cout<<ans+1;
      |               ^~~
      |               abs
Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using vl = vector<ll>;
using vc = vector<char>;
using vvl = vector<vector<ll>>;
using vvc = vector<vector<char>>;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repd(i,n) for(ll i = n - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()

ll n, k, m, M = 1e9 + 7;

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

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

cin >> a >> b;

ll d = gcd(a, b);

ll num = 1;
if(d % 2 == 0) {
    num++;
    while(d % 2 == 0) d /= 2;
}
for(ll i = 3; i*i < d; i += 2) {
    if(d % i == 0) {
        num++;
        while(d % i == 0) d /= i;
    }
}

cout << num << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:8: error: 'a' was not declared in this scope
   32 | cin >> a >> b;
      |        ^
a.cc:32:13: error: 'b' was not declared in this scope
   32 | cin >> a >> b;
      |             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mod 1000000007
 
vector<ll> divi(ll n)
{
    vector<ll>p;
    p.pb(1);
    p.pb(n);
    for(ll i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            p.pb(i);
           if((n/i)!=i)
            p.pb(n/i);
        }
    }
    return p;
}
bool prime(ll i)
{
    if(i==0||i==1)
        return false;
    else if(i==2||i==3)
        return true;
    else if(i%2==0||i%3==0)
        return false;
    else
    {
        for(ll p=5;p*p<=i;p+=6)
        {
            if(i%p==0||i%(p+2)==0)
                return false;
        }
    }
    return true;
}
int main()
{
    ll a,b;
    cin>>a>>b;
 
    vector<ll>l,r;
 
    l=divi(a);
    r=divi(b);
 
    sort(l.begin(),l.end());
    sort(r.begin(),r.end());
 
    set<ll>q;
    for(auto x:l)
    {
        if(binary_search(r.begin(),r.end(),x))
            q.insert(x);
    }
    for(auto x:r)
    {
        if(binary_search(l.begin(),l.end(),x))
            q.insert(x);
    }
 
    if(q.size()==1)
        cout<<"1\n";
    else
    {
 
        vector<ll>v;
        for(auto x:q)
        {
            if(prime(x))
                v.pb(x);
        }
        int c=v.size();
        c+=1;
        for(auto x:v)
        {
            int flag=1;
            for(auto d:q)
            {
                if(d%x==0&&d>x)
                {
                  flag=0;
                    break;
                }
            }
            if(flag)
                c++;
          }
        }
        cout<<c<<"\n";
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:94:15: error: 'c' was not declared in this scope
   94 |         cout<<c<<"\n";
      |               ^
Language: C++

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;

const ll MOD = 1e9 + 7;
const int INF32 = 1<<30;
const ll INF64 = 1LL<<60;
const ld pi = 3.141592653589793;

void solve(){
     ll a,b;
     cin >> a >> b;
     map<ll,ll>mp;
     ll aa = a;ll bb = b;
     for(int i = 2;i<=max(sqrt(a),sqrt(b));i++){
        if(aa%i==0){
            mp[i]++;
            while(aa%i==0) aa /= i;
        }
        if(bb%i==0){
            mp[i]++;
            while(bb%i==0) bb /= i;
        }
     }
     ll ans = 0;
     if(aa==bb) ans++;
     for(auto it : mp){
        if(it.second == 2)
            ans++;
     }
     cout << ans+1;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}

Compiler output:
a.cc:4:9: error: 'pair' does not name a type
    4 | typedef pair<int, int> pii;
      |         ^~~~
a.cc: In function 'void solve()':
a.cc:13:6: error: 'cin' was not declared in this scope
   13 |      cin >> a >> b;
      |      ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:14:6: error: 'map' was not declared in this scope
   14 |      map<ll,ll>mp;
      |      ^~~
a.cc:1:1: note: 'std::map' is defined in header '<map>'; this is probably fixable by adding '#include <map>'
  +++ |+#include <map>
    1 | using namespace std;
a.cc:14:12: error: expected primary-expression before ',' token
   14 |      map<ll,ll>mp;
      |            ^
a.cc:14:15: error: expected primary-expression before '>' token
   14 |      map<ll,ll>mp;
      |               ^
a.cc:14:16: error: 'mp' was not declared in this scope
   14 |      map<ll,ll>mp;
      |                ^~
a.cc:16:27: error: 'sqrt' was not declared in this scope
   16 |      for(int i = 2;i<=max(sqrt(a),sqrt(b));i++){
      |                           ^~~~
a.cc:16:23: error: 'max' was not declared in this scope
   16 |      for(int i = 2;i<=max(sqrt(a),sqrt(b));i++){
      |                       ^~~
a.cc:32:6: error: 'cout' was not declared in this scope
   32 |      cout << ans+1;
      |      ^~~~
a.cc:32:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc: In function 'int main()':
a.cc:36:5: error: 'ios_base' has not been declared
   36 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
a.cc:37:5: error: 'cin' was not declared in this scope
   37 |     cin.tie(NULL);
      |     ^~~
a.cc:37:5: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:13: error: 'NULL' was not declared in this scope
   37 |     cin.tie(NULL);
      |             ^~~~
a.cc:1:1: note: 'NULL' is defined in header '<cstddef>'; this is probably fixable by adding '#include <cstddef>'
  +++ |+#include <cstddef>
    1 | using namespace std;
Language: C++

#include <iostream>
#include <time.h>
#include <algorithm>
#include <stdio.h>

typedef long long LL;

using namespace std;

const int times = 20;
LL fac[1001];
int cnt;

LL mul(LL a, LL b, LL mod)
{
	LL ans = 0;
	while (b)
	{
		if (b & 1)
		{
			ans = (ans + a) % mod;
		}
		a = (a << 1) % mod;
		b >>= 1;
	}
	return ans;
}

LL pow(LL a, LL b, LL mod)
{
	LL ans = 1;
	while (b)
	{
		if (b & 1)
		{
			ans = mul(ans, a, mod);
		}
		b >>= 1;
		a = mul(a, a, mod);
	}
	return ans;
}

bool witness(LL a, LL n)
{
	LL temp = n - 1;
	int j = 0;
	while (temp % 2 == 0)
	{ // 其实就是得到 m
		j++;
		temp /= 2;
	}
	LL x = pow(a, temp, n);
	if (x == 1 || x == n - 1)
	{ // 判断a^m
		return true;
	}
	while (j--)
	{
		x = mul(x, x, n); // 进一步判断 a^(2m)  a^(4m) ...
		if (x == n - 1)
			return true;
	}
	return false;
}

bool miller_rabin(LL n)
{
	if (n == 2)
	{ //  如果是2肯定是素数
		return true;
	}
	if (n < 2 || n % 2 == 0)
	{ //如果小于2或者是大于2的偶数肯定不是素数
		return false;
	}
	for (int i = 0; i < times; i++)
	{ //随机化检验
		LL a = rand() % (n - 1) + 1;
		if (!witness(a, n))
			return false;
	}
	return true;
}

LL gcd(LL a, LL b)
{ // 这里的gcd和一般的gcd不一样
	if (a == 0)
	{ // pollard_rho的需要
		return 1;
	}
	if (a < 0)
	{ // 可能有负数
		return gcd(-a, b);
	}
	while (b)
	{
		LL t = a % b;
		a = b;
		b = t;
	}
	return a;
}

LL pollard_rho(LL n, LL c)
{                    // 找因子
	LL i = 1, k = 2; // 用来判断是否成环
	LL xx = rand() % n, y = xx;
	while (1)
	{
		i++;
		xx = (mul(xx, xx, n) + c) % n;
		LL d = gcd(y - xx, n);
		if (1 < d && d < n)
		{ // 找到一个因数
			return d;
		}
		if (y == xx)
		{ // 出现循环，那么查找失败
			return n;
		}
		if (i == k)
		{ // 相当一个优化？
			y = xx;
			k <<= 1;
		}
	}
}

void find(LL n)
{ // 通过因数来找质因子
	if (miller_rabin(n))
	{
		fac[cnt++] = n; // 记录质因子
		return;
	}
	LL p = n;
	while (p >= n)
		p = pollard_rho(p, rand() % (n - 1) + 1); //如果转了一圈还是p那么继续
	find(p);
	find(n / p);
}

int main()
{
	srand(251);
	LL a, b;
	cin>>a>>b;
    if(a==1||b==1){
        cout<<1;
        return 0;
    }
	if (miller_rabin(a))
	{
		if (b % a == 0)
			cout << 2;
		else
			cout << 1;
		return 0;
	}
	if (miller_rabin(b))
	{
		if (a % b)
			cout << 2;
		else
			cout << 1;
		return 0;
	}
	cnt = 0;
	find(a);
	LL fa[1001];
	memcpy(fa, fac, sizeof(fac));
	sort(fa, fa + cnt);
	int ss = cnt;
	cnt = 0;
	find(b);
	sort(fac, fac + cnt);
	int ans = 0;
	for (int i = 0, st = 0; i < ss; i++) {
		if (i && fa[i] == fa[i - 1])continue;
		for (int j = 0; j < cnt; j++) {
			if (j && fac[j] == fac[j - 1])continue;
			if (fac[j] == fa[i])ans++;
		}
	}
	cout << ans+1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:172:9: error: 'memcpy' was not declared in this scope
  172 |         memcpy(fa, fac, sizeof(fac));
      |         ^~~~~~
a.cc:4:1: note: 'memcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <algorithm>
  +++ |+#include <cstring>
    4 | #include <stdio.h>
Language: C++

#include<bits/stdc++.h>
#include<numeric>
#define int long long
#define ld long double
#define all(x) x.begin(),x.end()
const int maxn=1000000;
#define what_is(x) cerr << #x << " is " << x << endl;
const int MOD = 1e9 + 7;
using namespace std;
string abc="abcdefghijklmnopqrstuvwxyz";
int powmod(int a, int b, int MOD = MOD){
    if(!a and !b)    return 1ll;
    if(!a)    return a;
    int res = 1ll;
    b %= (MOD - 1ll), a %= MOD;
    while(b){
        if(b%2 == 1)    res = (res * a) % MOD;
        a = (a * a) % MOD;
        b /= 2;
    }
    return res;
}
int popcount(uint32_t n)
{
    n = n - ((n >> 1) & 0x55555555);
    n = (n & 0x33333333) + ((n >> 2) & 0x33333333);
    return ((n + (n >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
}
bool check(int n) {return (((double)sqrt(n)-floor((double)sqrt(n)))==0);}
vector<bool> sieve(maxn + 1, true);
void fillprime() {
    sieve[0] = sieve[1] = false;
    for (int i = 2; i <= maxn; ++i) {
        if (sieve[i] && (int) i * i <= maxn) {
            for (int j = i * i; j <= maxn; j += i) {
                sieve[j] = false;
            }
        }
    }
}
const int nn=1e5+5;
int result[100005];
void solve() {
  
  
  int x,y;
  cin>>x>>y;
  int l=__gcd(x,y);
  int cnt=1;
  for(int i=2;i*i<=l;++i)
  {
      if(l%i==0){
          while(l%i==0) l/=i;
          cnt++;
      }
  }
  if(cnt>1) cnt++;
  ccout<<cnt<<"\n";
    
}
int32_t main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    fillprime();
    //int t;cin>>t;while(t--)
    solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:58:3: error: 'ccout' was not declared in this scope
   58 |   ccout<<cnt<<"\n";
      |   ^~~~~
Language: C++

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

typedef long long ll;
typedef long double ld;
typedef vector<vector<int>> Graph;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
#define pi 3.14159265359
#define inf 2147483647
#define INF 9223372036854775807
#define mod 1000000007
#define mod2 998244353

ll gcd(ll n, ll m) {
    if(n < m) swap(n, m);
    if(n % m == 0) return m;
    return gcd(m, n % m);
}

int main() {
    ll A, B; cin >> A >> B;
    ll G = gcd(A, B);
    ll g = G;
    ll ans = 1, i = 2;
    bool judge = true;
    while(G >= i) {
        if(G % i == 0) {
            if(judge) {
                judge = false;
                ans++;
                G /= i;
            }
            else G /= i;
        }
        else {
            judge = true;
            i++;
            if(i * i >= g)
        }
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: expected primary-expression before '}' token
   40 |         }
      |         ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef vector<int> V;
typedef pair<int,int> P;
typedef vector<vector<int>> Graph;

int main() {
    ll a,b;
    cin >> a >> b;
    map<ll,ll> fa,ck;
    ll n=a,m=b;
    for(ll i=2;i<=sqrt(a);i++){
        while(n%i==0){
            n /= i;
            fa[i]++;
        }
    }
    fa[1]++
    fa[n]++;
    for(ll i=2;i<=sqrt(b);i++){
        while(m%i==0){
            m /= i;
            ck[i]++;
        }
    }
    ck[1]++;
    ck[m]++;
    ll ans=0;
    for(auto i:fa){
        if(ck[i.first]!=0) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:12: error: expected ';' before 'fa'
   21 |     fa[1]++
      |            ^
      |            ;
   22 |     fa[n]++;
      |     ~~
Language: C++

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

int main() {
  long long A,B;
  cin >> A >> B;
  int j = 0;
  int i = 2;
  
  vector<int>a(39,0);
  while (A != 1 ){
    if (A % i == 0){
      for (int k = 0; k < 39; k++) {
        if (A % i == 0){
          A = A/i;
        }
        else {
          a.at(j) = i;
          j++;
          break;
        }
      }
    }
    else {
      i++;
    }
  }
  
  j = 0;
  i = 2;
  vector<int>b(39,0);
  while (B != 1 && ){
    if (B % i == 0){
      for (int k = 0; k < 39; k++) {
        if (B % i == 0){
          B = B/i;
        }
        else {
          b.at(j) = i;
          j++;
          break;
        }
      }
    }
    else {
      i++;
    }
  }
  
  int count = 1;
//  if (A == B){
  //  count++;
 // }
  
  for (int k = 0; k < 39; k++) {
    for (int l = 0; l < 39; l++) {
      if (a.at(k) > 1 && a.at(k) == b.at(l)){
        count++;
      }
    }
  }
  cout << count << endl;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:32:20: error: expected primary-expression before ')' token
   32 |   while (B != 1 && ){
      |                    ^
Language: C

#include <stdio.h>
#define ll long long
ll detc(ll x,ll y) {
    while(y) {
        ll t=x%y;
        x=y;
        y=t;
    }
    return x;
}

int main()
{
    ll a,b;
    scanf("%lli%lli",&a,&b);
    ll num = detc(a,b);
    int count=1;
    if (num == 1) {
        printf("%i",count);
        return 0;
    }
    for (ll i=2;i<=num;i++) {
        if (num%i==0) {
            count++;
            while(num%i==0) {
                num/=i;
            }
        }
    }
    printf("%i",count);
    return 0;

Compiler output:
main.c: In function 'main':
main.c:31:5: error: expected declaration or statement at end of input
   31 |     return 0;
      |     ^~~~~~
Language: C++


#include <bits/stdc++.h>

#define PI 3.14159265359
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define descSort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
ll GCD(ll x,ll y){
    if(x%y==0)return y;
    return GCD(y,x%y);
}
ll LCM(int a, int b){
    return a*b/GCD(a,b);
}

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

    ll gcd=gcd(a,b);

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

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



Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: 'gcd' cannot be used as a function
   23 |     ll gcd=gcd(a,b);
      |            ~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,s,n) for(int i=s;i<n;i++)
#define per(i,s,n) for(int i=n-1;i>=s;i--)
#define fi first
#define se second
#define all(c) c.begin(),c.end()
typedef long long int ll;
typedef pair<int, int> P;
typedef long double ld;
void Ans(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}

const ll INF=1001001001;
const ll mod=1000000007;

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

int main(){
  ll a,b;
  cin>>a>>b;
  ll g=gcd(a,b);
  if(g==1){
    cout<<g<<endl;
    return;
  }
  
  ll c=1;
  for(ll i=2;i*i<g;i++){
    if(g%i==0) c++;
    while(g%i==0){
      g/=i;
    }
  }
  
  if(g!=1) c++;
  
  cout<<c<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:5: error: return-statement with no value, in function returning 'int' [-fpermissive]
   29 |     return;
      |     ^~~~~~
Language: C++

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

int main(){
  long long A,B;
  cin >> A >> B;
  map<long long,int> cd;
  vector<long long> v(1,1);
  cd[1]=1;
  for(long long loop=2;loop<=(int)sqrt(A);loop+=2){
    if(!(A%loop)){
      cd[loop]=0;
      A/=loop;
      while(!(A%loop)) A/=loop;
    }
    if(loop==2) loop--;
  }
  for(long long loop=2;loop<=(int)sqrt(B);loop+=2){
    if(!(B%loop)){
      if(cd.count(loop)){
        cd[loop]=1;
      }
      B/=loop;
      while(!(B%loop))
        B/=loop;
    }
    if(loop==2) loop--;
  }
  long long ans=0;
  for(loop=0;loop<v.size();loop++){
    if(cd[v[loop]])
      ans++;
  }
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:7: error: 'loop' was not declared in this scope
   30 |   for(loop=0;loop<v.size();loop++){
      |       ^~~~
Language: C++

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

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define SIZE(x) ((ll)(x).size()) 
#define MAX(x) *max_element(ALL(x)) 
#define MIN(x) *min_element(ALL(x)) 
#define ALL(x) (x).begin(),(x).end() 

#define INF 1000000000000 
#define MOD 1000000007 
#define MAXR 100000 

#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 

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

bool is_prime(int n){
    int a = sqrt(n);
    if(n == 1 || n == 2 || n == 3) return true;
    else{
        bool frag = true;
        FOR(i, 2, (int)sqrt(n)+1){
            if(n % i == 0) frag = false;
        }
        return frag;
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll a, b;
    int j=0;
    vector<int> p;
    cin >> a >> b;
    if(a >= b) ll g = gcd(a, b);
    else ll g = gcd(b, a);
    p.PB(1);
    while(g % 2 == 0){p.PB(2); g /= 2;}
    int i = 3;
    while(g > 1){
      while(g%i==0){p.PB(i); g /= i;}
      i += 2;
    }
    set<int> ans;
    REP(i, p.size()) ans.insert(p[i]);
    cout << ans.size() << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:11: error: 'g' was not declared in this scope
   55 |     while(g % 2 == 0){p.PB(2); g /= 2;}
      |           ^
a.cc:57:11: error: 'g' was not declared in this scope
   57 |     while(g > 1){
      |           ^
Language: C++

#include#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll a,b;
	cin>>a>>b;
	// ll x=min(a,b),y=max(a,b);
	ll g=__gcd(a,b);
	// cout<<g<<endl;
	ll cnt=1;
	ll n=g;
	if(n%2==0)
	{
		// cout<<2<<endl;
		cnt++;
		while(n%2==0)
			n/=2;
	}
	// cout<<n2<<endl;
	for(ll i=3;i*i<=g;i+=2)
	{
		// cout<<i<<endl;
		if(n%i==0)
		{
			// cout<<i<<endl;
			cnt++;
			while(n%i==0)
				n/=i;
		}
	}
	if(n>2)
		cnt++;
	cout<<cnt;
}

Compiler output:
a.cc:1:9: error: #include expects "FILENAME" or <FILENAME>
    1 | #include#include<bits/stdc++.h>
      |         ^
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin>>a>>b;
      |         ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include#include<bits/stdc++.h>
a.cc:9:14: error: '__gcd' was not declared in this scope
    9 |         ll g=__gcd(a,b);
      |              ^~~~~
a.cc:34:9: error: 'cout' was not declared in this scope
   34 |         cout<<cnt;
      |         ^~~~
a.cc:34:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

using namespace std;
bool au[1000005],bu[1000005];
long long a,b;

int main()
{
    cin >> a >> b;
    long long sa = sqrt(a),sb = sqrt(b);
    vector<int> va1,vb1;
    vector<long long> va2,vb2;
    va2.push_back(a);vb2.push_back(b);
    for(int i=2;i<=sa;++i)
    {
        if(au[i]) continue;
        if(a%i==0)va1.push_back(i);
        for(int j=i;j<=sa;j+=i)
        {
            au[j] = true;
            if(a%j==0) va2.push_back(a/j);
        }

    }

    for(int i=2;i<=sb;++i)
    {
        if(bu[i]) continue;
        if(b%i==0)vb1.push_back(i);
        for(int j=i;j<=sb;j+=i)
        {
            bu[j] = true;
            if(b%j==0) vb2.push_back(b/j);
        }

    }1
    vector<int> ans;
    for(int i=0,j=0;i<va1.size()&&j<vb1.size();)
    {
        if(va1[i]<vb1[j])++i;
        else if(va1[i]>vb1[j])++j;
        else {ans.push_back(va1[i]);++i;++j;}
    }

    vector<long long> a2;
    sort(va2.begin(),va2.end());
    sort(vb2.begin(),vb2.end());

    for(int i=0,j=0;i<va2.size()&&j<vb2.size();)
    {
        if(va2[i]<vb2[j])++i;
        else if(va2[i]>vb2[j])++j;
        else {a2.push_back(va2[i]);++i;++j;}
    }

    int cnt = 1;
    for(int i=0;i<a2.size();++i){
        bool canI = true;
        for(int j=0;j<ans.size();++j){
            if(a2[i]%ans[j]==0){
                canI = false;break;
            }
        }
        if(canI) ++cnt;
    }
    cnt+=ans.size();
    cout << cnt << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:7: error: expected ';' before 'vector'
   37 |     }1
      |       ^
      |       ;
   38 |     vector<int> ans;
      |     ~~~~~~
a.cc:43:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |         else {ans.push_back(va1[i]);++i;++j;}
      |               ^~~
      |               abs
a.cc:60:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 |         for(int j=0;j<ans.size();++j){
      |                       ^~~
      |                       abs
a.cc:67:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   67 |     cnt+=ans.size();
      |          ^~~
      |          abs
Language: C++

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

// bitset<(ll)1e6 + 100> isPrime;
// Not required
// isPrime.set();
map<ll, int> primeFact; // stores the powers of respective factors.

inline void solve(ll gg){
//	isPrime[0] = isPrime[1] = 0;
  	while (gg % 2 == 0)
    	gg >>= 1, primeFact[2]++;  	
  	for (int i = 3; i * i <= gg; i += 2){
    	while ( gg % i == 0)
          gg /= i, primeFact[i]++;
    }
  	if (n > 2)
      primeFact[n]++;
}
int main()
{
  ll a, b;
  cin >> a >> b;
  ll gg = __gcd(a, b);
  solve(gg);
  cout << primeFact.size() + 1 << endl;
  return 0; 
}


Compiler output:
a.cc: In function 'void solve(ll)':
a.cc:19:13: error: 'n' was not declared in this scope; did you mean 'yn'?
   19 |         if (n > 2)
      |             ^
      |             yn
Language: C++

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

// bitset<(ll)1e6 + 100> isPrime;
// Not required
isPrime.set();
map<ll, int> primeFact; // stores the powers of respective factors.

inline void solve(ll gg){
//	isPrime[0] = isPrime[1] = 0;
  	while (gg % 2 == 0)
    	gg >>= 1, primeFact[2]++;  	
  	for (int i = 3; i * i <= gg; i += 2){
    	while ( gg % i == 0)
          gg /= i, primeFact[i]++;
    }
}
int main()
{
  ll a, b;
  cin >> a >> b;
  ll gg = __gcd(a, b);
  solve(gg);
  cout << primeFact.size() + 1 << endl;
  return 0; 
}


Compiler output:
a.cc:8:1: error: 'isPrime' does not name a type
    8 | isPrime.set();
      | ^~~~~~~
Language: C++

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

// bitset<(ll)1e6 + 100> isPrime;
// Not required
isPrime.set();
map<ll, int> primeFact; // stores the powers of respective factors.

inline void solve(ll gg){
	isPrime[0] = isPrime[1] = 0;
  	while (gg % 2 == 0)
    	gg >>= 1, primeFact[2]++;  	
  	for (int i = 3; i * i <= gg; i += 2){
    	while ( gg % i == 0)
          gg /= i, primeFact[i]++;
    }
}
int main()
{
  ll a, b;
  cin >> a >> b;
  ll gg = __gcd(a, b);
  solve(gg);
  cout << primeFact.size() + 1 << endl;
  return 0; 
}


Compiler output:
a.cc:8:1: error: 'isPrime' does not name a type
    8 | isPrime.set();
      | ^~~~~~~
a.cc: In function 'void solve(ll)':
a.cc:12:9: error: 'isPrime' was not declared in this scope
   12 |         isPrime[0] = isPrime[1] = 0;
      |         ^~~~~~~