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

#include<bits/stdc++.h>

using namespace std;

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

bool is_prime[100000000000];
vector<ll> pp;
void sieve(ll n){
    ll p = 0;
    for(int i = 0; i <= n; i++)is_prime[i] = true;
    for(int i = 2; i <= n; i++){
        if(is_prime[i]){
            pp.push_back(i);
            for(int j = 2*i; j<=n; j+=i)is_prime[j] = false;
        }
    }
    return;
}
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;
    sieve(g);

    while(g!=1){
        if(g%pp[num]==0){
            g/=pp[num];
            if(num != pre)ans++;
            pre = num;
        }else{
            num++;
        }
    }
    cout << ans+1 << endl;
    return 0;
}

Compiler output:
/tmp/ccywcbew.o: in function `sieve(long long)':
a.cc:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `pp' defined in .bss section in /tmp/ccywcbew.o
/tmp/ccywcbew.o: in function `main':
a.cc:(.text+0x19d): relocation truncated to fit: R_X86_64_PC32 against symbol `pp' defined in .bss section in /tmp/ccywcbew.o
a.cc:(.text+0x1cf): relocation truncated to fit: R_X86_64_PC32 against symbol `pp' defined in .bss section in /tmp/ccywcbew.o
/tmp/ccywcbew.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x24a): relocation truncated to fit: R_X86_64_PC32 against symbol `pp' defined in .bss section in /tmp/ccywcbew.o
a.cc:(.text+0x263): relocation truncated to fit: R_X86_64_PC32 against symbol `pp' defined in .bss section in /tmp/ccywcbew.o
collect2: error: ld returned 1 exit status
Language: C++

/**
 * @Author:      G_bg
 * @DateTime:    2019-09-28 20:22:27
 * @Description: 
 */
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const double PI = 3.1415926535898;
const double E = 2.718281828459;
const int INF = 0x7fffffff;
const int mod = 1e9+7;
const int maxn = 1e5+10;
LL gcd(LL a,LL b){
    return b == 0?a:gcd(b,a%b);
}
int prime[100000],index[100000],m;
void decompose(LL n){
    for(int i = 2;i*i <= n;i++){
        if(n%i == 0){//i一定是素数
            prime[++m] = i,index[m] = 0;
            while(n%i == 0) n /= i,index[m]++;
        }
    }
    if(n > 1) prime[++m] = n,index[m] = 1;//n是质数
}
int main(int argc, const char *argv[]) {
    ios::sync_with_stdio(0);cin.tie(0);
    LL a,b;cin >> a >> b;
    LL g = gcd(a,b);
    decompose(g);
    cout << m+1 << endl;
    return 0;
}

Compiler output:
a.cc:17:31: error: 'int index [100000]' redeclared as different kind of entity
   17 | int prime[100000],index[100000],m;
      |                               ^
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:6:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'void decompose(LL)':
a.cc:21:33: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   21 |             prime[++m] = i,index[m] = 0;
      |                                 ^
a.cc:22:41: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   22 |             while(n%i == 0) n /= i,index[m]++;
      |                                         ^
a.cc:25:35: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   25 |     if(n > 1) prime[++m] = n,index[m] = 1;//n是质数
      |                                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long int
#define mp make_pair
#define pb push_back
#define F first
#define S second
const int N=1000005;
#define M 1000000007
#define double long double
#define init(arr,val) memset(arr,val,sizeof(arr))
#define BINF 1000000000001
const int LG = 22;

// Utility function to do modular exponentiation. 
// It returns (x^y) % p 
int power(int x, int y, int p) 
{ 
    int res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or 
                // equal to p 
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
  
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
  
// This function is called for all k trials. It returns 
// false if n is composite and returns false if n is 
// probably prime. 
// d is an odd number such that  d*2<sup>r</sup> = n-1 
// for some r >= 1 
bool miillerTest(int d, int n) 
{ 
    // Pick a random number in [2..n-2] 
    // Corner cases make sure that n > 4 
    int a = 2 + rand() % (n - 4); 
  
    // Compute a^d % n 
    int x = power(a, d, n); 
  
    if (x == 1  || x == n-1) 
       return true; 
  
    // Keep squaring x while one of the following doesn't 
    // happen 
    // (i)   d does not reach n-1 
    // (ii)  (x^2) % n is not 1 
    // (iii) (x^2) % n is not n-1 
    while (d != n-1) 
    { 
        x = (x * x) % n; 
        d *= 2; 
  
        if (x == 1)      return false; 
        if (x == n-1)    return true; 
    } 
  
    // Return composite 
    return false; 
} 
  
// It returns false if n is composite and returns true if n 
// is probably prime.  k is an input parameter that determines 
// accuracy level. Higher value of k indicates more accuracy. 
bool isPrime(int n, int k) 
{ 
    // Corner cases 
    if (n <= 1 || n == 4)  return false; 
    if (n <= 3) return true; 
  
    // Find r such that n = 2^d * r + 1 for some r >= 1 
    int d = n - 1; 
    while (d % 2 == 0) 
        d /= 2; 
  
    // Iterate given nber of 'k' times 
    for (int i = 0; i < k; i++) 
         if (!miillerTest(d, n)) 
              return false; 
  
    return true; 
} 


#undef int 
int main() {
#define int long long int
ios_base::sync_with_stdio(false); 
cin.tie(0); 
cout.tie(0);
    

    int k = 4;
    int a,b;
    cin >> a >> b;
    int c = __gcd(a,b);
    int ans = 0;
    for(int i = 1; i * i <= c; i++){
        if(c % i == 0) s.insert(i), s.insert(c / i);
    }

    for(auto i : s){
        if( i == 1 ) ans++;
        else if(isPrime(i, k)) ans++;
    }
cout << ans;

    

return 0;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:107:24: error: 's' was not declared in this scope
  107 |         if(c % i == 0) s.insert(i), s.insert(c / i);
      |                        ^
a.cc:110:18: error: 's' was not declared in this scope
  110 |     for(auto i : s){
      |                  ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdint>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <boost/range/irange.hpp>

using namespace std;
using boost::irange;

template<class T>
T read()
{
    T value;
    std::cin >> value;
    return value;
}
 
template<class F>
void times_do(size_t n, F func)
{
    for(size_t i = 0; i < n; ++i) func();
}
 
template<class T>
vector<T> reads(size_t n)
{
    vector<T> a;
    a.reserve(n);
    times_do(n, [&](){
        a.push_back(read<T>());
    });
    return a;
}

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

int main()
{
    const auto a = read<int64_t>();
    const auto b = read<int64_t>();
    const auto afs = prime_factor(a);
    const auto bfs = prime_factor(b);
    int count = 1;
    for(auto [f, c] : afs)
    {
        auto ibf = bfs.find(f);
        if(ibf != bfs.end())
        {
            count++;
        }
    }
    cout << count << '\n';
    return 0;
}


Compiler output:
a.cc:10:10: fatal error: boost/range/irange.hpp: No such file or directory
   10 | #include <boost/range/irange.hpp>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: Java

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class D {
	static Set<Long> getDivisors(long A){
		Set<Long> ret = new HashSet<Long>();
		ret.add(1L);
		long Amax = A;
		for(long i = 2 ; i * i <= Amax ; ++i){
			if(A % i == 0){			
				ret.add(i);
				while(A % i == 0){
					A = A / i;
				}
			}
		}
		ret.add(A);
		return ret;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long A = sc.nextLong();
		long B = sc.nextLong();
		Set<Long> AS = getDivisors(A);		
		Set<Long> common = new HashSet<Long>();
		for(long a : AS){
			if(B % a == 0){
				common.add(a);
			}
		}
//		System.out.println(common);
		System.out.println(common.size());
		// 1 , 2 , 3, 5 , 11
	}
}


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


#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

// rep(i, 100) { cout << i << endl; } => 0 1 2 ... 99
#define rep(i, n) for(int i = 0, i##_len = (n); i < (int)n; i++)

// std::sort(all(v));
#define all(x) (x).begin(), (x).end()

// long long int
using ll = long long;

// utility to cast return value of size function to int
#define SZ(x) ((int)(x).size())

// VS defines "_DEBUG" macro when debug configuration.
#if _DEBUG
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define dump(x)
#define debug(x)
#endif

// update max
template<class T>bool chmax(T & prov, const T & cur)
{
	if (cur > prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

// update min
template<class T>bool chmin(T & prov, const T & cur)
{
	if (cur < prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

ll gcd(ll lhs, ll rhs)
{
	return rhs == 0 ? lhs : gcd(rhs, lhs % rhs);
}

ll lcm(ll lhs, ll rhs)
{
	ll t = gcd(lhs, rhs);
	return (lhs / t) * (rhs / t) * t;
}

bool is_prim(ll v)
{
	if (v == 2) { return true; }
	if (v % 2 == 0) { return false; }
	ll end = sqrt(v);
	for (ll i = 3; i <= end; i+=2)
	{
		if (v % i == 0)
		{
			return false;
		}
	}
	return true;
}

int main()
{
	ll A, B;
	cin >> A >> B;
	ll x = gcd(B, A);
	vector<ll> u;

	ll end = sqrt(x);
	for (ll i = 1; i <= x; i++)
	{
		if (x % i == 0)
		{
			u.push_back(i);
			u.push_back(x / i);
		}
	}

	sort(all(u));

	int ans = 0;
	ll old = -1;
	for (int i = 0; i < u.size(); i++)
	{
		if (u[i] != old && is_prim(u[i]))
		{
			ans++;
		}

		old = u[i];
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'bool is_prim(ll)':
a.cc:71:18: error: 'sqrt' was not declared in this scope
   71 |         ll end = sqrt(v);
      |                  ^~~~
a.cc: In function 'int main()':
a.cc:89:18: error: 'sqrt' was not declared in this scope
   89 |         ll end = sqrt(x);
      |                  ^~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#define ll long long
using namespace std;

inline void read(int &a)
{
    a=0;int c=getchar();
    while(c>'9'||c<'0') c=getchar();
    while(c>='0'&&c<='9') a=(a<<3)+(a<<1)+c-48,c=getchar();
}

const int N=2e8+5,M=1e5+5;
ll n,m,prime[N],not_pr[N],cnt,ans;
ll a,b;
inline void get_prime()
{
    not_pr[1]=1;
    for(int i=2;i<=n;i++)
    {
        if(!not_pr[i]) prime[++cnt]=i;
        for(int j=1;j<=cnt&&i*prime[j]<=n;j++)
        {
            not_pr[i*prime[j]]=1;
            if(i%prime[j]==0) break;
        }
    }
}

int main()
{
    n=100000000;
    get_prime();
    cin>>a>>b;
    prime[0]=1;
    for(int i=0;i<=cnt;i++)
    {
        if(a%prime[i]==0&&b%prime[i]==0) ans++;
    }
    cout<<ans;
}

Compiler output:
/tmp/ccO7WSlV.o: in function `main':
a.cc:(.text+0x1b): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0x37): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0x5d): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0x8d): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0xbd): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0xc8): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0xd9): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text+0xe9): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccO7WSlV.o
/tmp/ccO7WSlV.o: in function `get_prime()':
a.cc:(.text._Z9get_primev[_Z9get_primev]+0x40): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text._Z9get_primev[_Z9get_primev]+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `cnt' defined in .bss section in /tmp/ccO7WSlV.o
a.cc:(.text._Z9get_primev[_Z9get_primev]+0x52): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset

using namespace std;

int main() {

	long a,b,r,count=1;

	cin >> a >> b ;

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

	//bが最大公約数

	r = b;

	if (b % 2 == 0) {
		while (b % 2 == 0)b = b / 2;
		count++;
	}

	for (int i = 3; i <= (sqrt(r) + 1); i = i + 2) {
		if (b % i == 0) {
			while (b % i == 0)b = b / i;
			count++;
		}
	}
	cout << count << endl;

	return 0;
}


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

#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#include<deque>
#include<queue>
#include<set>

//マクロ
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=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 FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)

#define All(a) (a).begin(),(a).end()

//定数
#define INF 1e9
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数
int prime[50000] = { 0 };
int idx;

//使用する関数
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 (a > b) { a = b; return 1; }
	return 0;
}
void getPrime(ll num) {
	if (num < 2) {
		idx = -1;
		return;
	}
	prime[0] = 2;
	if (num < 3) {
		idx = 0;
		return;
	}
	idx = 1;
	prime[0] = 2;
	prime[1] = 3;
	int i, j;
	int flag;
	for (i = prime[idx] + 2; (ll)i * i<= num; i += 2) {
		flag = 1;
		for (j = 0; prime[j] <= (int)sqrt((double)i); j++) {
			if (i%prime[j] == 0) {
				flag = 0;
				break;
			}
		}
		if (flag)prime[++idx] = i;
	}
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b;
	cin >> a >> b;

	getPrime(max(a, b));

	ll ans = 1;
	REP(i, idx+1) {
		if (a%prime[i] == 0 && b%prime[i] == 0)ans++;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'void getPrime(ll)':
a.cc:61:46: error: 'sqrt' was not declared in this scope
   61 |                 for (j = 0; prime[j] <= (int)sqrt((double)i); j++) {
      |                                              ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
typedef pair<ll,ll> P;
#define M 1000000007
int main(){
  vector<bool> v(1000010,true);
  v[0]=v[1]=false;
  for(int i=4;i<1000010;i+=2)v[i]=false;
  for(int i=3;i<1000010;i+=2){
    if(v[i]){
      for(int j=i*3;j<1000010;j+=i)v[j]=false;
    }
  }
  ll a,b,c=1;cin>>a>>b;
  for(int i=2;i<1000010;i++){
    if(v[i]){
      if(a%i==0&&b%i==0)c++;
    }
  }
  if(max(a,b)%min(a,b)==0&&min(a,b)>=1000010){
    bool f=true;
    for(int i=2;i<1000010;i++){
      if(v[i]){
        if(min(a,b)%i==0){f=false;break;
      }
    }
    if(f)c++;
  }
  cout<<c;
}

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

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (3e9)

using namespace std;
typedef long long int ll;

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

bool is_prime[1000000000000];
template<typename T>
vector<T> enum_Prime(T n){
    vector<T> ret;
    for(int i=2;i<=n;i++) is_prime[i] = true;
    for(int i=2;i<=n;i++){
        if(is_prime[i]){
            if(n%i==0) ret.push_back(i);
            for(int j=2*i;j<=n;j+=i) is_prime[j] = false;
        }
    }
    return ret;
}

ll A, B;
int main(void){
    cin >> A >> B;
    ll C = gcd(A, B);
    vector<ll> V = enum_Prime(C);
    cout << 1 + V.size() << endl;
    return 0;
}



Compiler output:
/tmp/ccXF3MHs.o: in function `main':
a.cc:(.text+0xc): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/ccXF3MHs.o
a.cc:(.text+0x28): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccXF3MHs.o
a.cc:(.text+0x3a): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccXF3MHs.o
a.cc:(.text+0x41): relocation truncated to fit: R_X86_64_PC32 against symbol `A' defined in .bss section in /tmp/ccXF3MHs.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include <algorithm>
#include<deque>
#include<queue>
#include<set>

//マクロ
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
#define REPS(i,n) for(int i=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 FOR(i,s,e) for(int i=(int)(s); i<(int)(e); ++i)
#define RFOR(i,s,e) for(int i=(int)(e)-1; i>=(int)(s); --i)

#define All(a) (a).begin(),(a).end()

//定数
#define INF 1e9
#define MOD (int)(1e9+7)

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

//とりあえず書いておく変数
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

//今回の変数
int prime[50000] = { 0 };
int idx;

//使用する関数
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 (a > b) { a = b; return 1; }
	return 0;
}
void getPrime(ll num) {
	if (num < 2) {
		idx = -1;
		return;
	}
	prime[0] = 2;
	if (num < 3) {
		idx = 0;
		return;
	}
	idx = 1;
	prime[0] = 2;
	prime[1] = 3;
	int i, j;
	int flag;
	for (i = prime[idx] + 2; (ll)i * i<= num; i += 2) {
		flag = 1;
		for (j = 0; prime[j] <= (int)sqrt(i); j++) {
			if (i%prime[j] == 0) {
				flag = 0;
				break;
			}
		}
		if (flag)prime[++idx] = i;
	}
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b;
	cin >> a >> b;

	getPrime(max(a, b));

	ll ans = 1;
	REP(i, idx+1) {
		if (a%prime[i] == 0 && b%prime[i] == 0)ans++;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'void getPrime(ll)':
a.cc:61:46: error: 'sqrt' was not declared in this scope
   61 |                 for (j = 0; prime[j] <= (int)sqrt(i); j++) {
      |                                              ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	i64 a, b; scanf("%lld%lld", &a, &b);

	bool prime = true;
	for(i64 i = 2; i * i <= g; i++) {
		if(g % i) continue;
		prime = false;
		break;
	}
	if(prime) {
		printf("2\n");
		return 0;
	}

	int ans = 1;
	i64 g = std::__gcd(a, b), p = 2;
	while(g > 1) {
		if(g % p) {
			p++;
			continue;
		} else {
			ans++;
		}
		
		while(!(g % p)) {
			g /= p;
		}
	}
	printf("%d\n", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:33: error: 'g' was not declared in this scope
   20 |         for(i64 i = 2; i * i <= g; i++) {
      |                                 ^
Language: C++

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

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

bool isprime(long long ll val) {
    if (val <= 1)return false;
    for (long long ll i = 2; i*i <= val; i++) {
        if (val%i == 0LL)return false;
    }
    return true;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);
 
    ll a,b;
    cin>>a>>b;
    ll g = gcd(a,b);
    if(isprime(a) || isprime(b) || a==1 || b==1){
        cout << 1 << endl;
        return 0;
    }
    ll ans = 1;
    for(ll i=1;i*i<=g;i++){
        if(g%i==0){
            if(isprime(i)) ans++;
            if(i*i!=g && isprime(g/i)) ans++;
        }
    }
    cout << ans << endl;



}

Compiler output:
a.cc:10:27: error: expected ',' or '...' before 'val'
   10 | bool isprime(long long ll val) {
      |                           ^~~
a.cc: In function 'bool isprime(long long int)':
a.cc:11:9: error: 'val' was not declared in this scope
   11 |     if (val <= 1)return false;
      |         ^~~
a.cc:12:22: error: expected ';' before 'i'
   12 |     for (long long ll i = 2; i*i <= val; i++) {
      |                      ^~
      |                      ;
a.cc:12:23: error: 'i' was not declared in this scope
   12 |     for (long long ll i = 2; i*i <= val; i++) {
      |                       ^
a.cc:12:37: error: 'val' was not declared in this scope
   12 |     for (long long ll i = 2; i*i <= val; i++) {
      |                                     ^~~
a.cc:12:40: error: expected ')' before ';' token
   12 |     for (long long ll i = 2; i*i <= val; i++) {
      |         ~                              ^
      |                                        )
a.cc:12:42: error: 'i' was not declared in this scope
   12 |     for (long long ll i = 2; i*i <= val; i++) {
      |                                          ^
Language: C++

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

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
typedef long long int ll;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T>
bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false;}
template<typename T>
bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false;}
// clang-format on

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

#include <set>

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n, m;
    cin >> n >> m;
    ll g = gcd(n, m);
    ll t = g;
    for (ll i = 2; i * i <= g; i++) {
        while (t % i == 0) {
            t /= i;
        }
    }
    if (t != 1) {
        fact.insert(t);
    }
    cout << fact.size() + 1 << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: 'fact' was not declared in this scope
   47 |         fact.insert(t);
      |         ^~~~
a.cc:49:13: error: 'fact' was not declared in this scope
   49 |     cout << fact.size() + 1 << endl;
      |             ^~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#include<queue>
#define ll long long
#define itn int
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

ll N,M,K,A,B,C,ans=0,cnt=0;
string S,T;
vector<int> P,Q;
vector<pair<int,int>> PP;
bool CAN=false;


int main(){
  cin>>A>>B;
  
  ll gcd(ll a,ll b){
		if (a%b==0){
			return(b);
    	}
		else{
			return(gcd(b,a%b));
    	}
  }
  
  for(ll i=1; i*i<=gcd(A,B); ++i){
    if(gcd(A,B)%i==0) ans++;
  }
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:20: error: a function-definition is not allowed here before '{' token
   31 |   ll gcd(ll a,ll b){
      |                    ^
Language: C++

#include <bits/stdc++.h>
#define endl '\n'
#define fast_in ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define mp  make_pair
#define pb  push_back
#define  sz(x)   (int)x.size()
#define  all(x)  x.begin(), x.end()
#define	 allr(x)  x.rbegin(), x.rend()
#define  bit(x)  __builtin_popcountll(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair <int,int> pii;
const int inf = (int) 1e9+99999, mod = (int)1e9+7;
const ll linf = (ll) 2e18+99999;
int mul (int x, int y) { return ((ll)x * y) % mod; } 
int sub (int x, int y) { x -= y; if (x < 0) return x + mod; return x; } 
int add (int x, int y) { x += y; if (x >= mod) return x - mod; return x; }
 
const int maxn = (int) 3e5;


#define int ll

int cost[maxn], k[maxn], c[1001][50];
int d[5001][2];

void solve () {
	int n, m; cin >> n >> m;
	for (int i = 1; i <= m; i ++) {
		cin >> cost[i] >> k[i];
		for (int j = 1; j <= k[i]; j ++) {
			cin >> c[i][j];	
			c[i][j] --;
		}
	}


	for (int mask = 0; mask < (1 << n); mask ++)
		d[mask][0] = d[mask][1] = linf; 
	d[0][0] = 0;

	for (int i = 1; i <= m; i ++) {
		for (int mask = 0; mask < (1 << n); mask ++) {
			d[mask2][1] = min (d[mask2][1], d[mask][0]);		
			int mask2 = mask;
			for (int j = 1; j <= k[i]; j ++) mask2 |= (1 << c[i][j]);
			d[mask2][1] = min (d[mask2][1], d[mask][0] + cost[i]);		
		}
		for (int mask2 = 0; mask2 < (1 << n); mask2 ++) {
			d[mask2][0] = d[mask2][1]; 
			d[mask2][1] = inf;
		}
	}

	if (d[(1 << n)-1][0] == linf) d[(1 << n)-1][0] = -1;
	cout << d[(1 << n)-1][0];
}

main () { fast_in;
    int t = 1; //cin >> t;
    while (t --) {
    	solve ();    
    }
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:46:27: error: 'mask2' was not declared in this scope; did you mean 'mask'?
   46 |                         d[mask2][1] = min (d[mask2][1], d[mask][0]);
      |                           ^~~~~
      |                           mask
a.cc: At global scope:
a.cc:61:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   61 | main () { fast_in;
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;
#define sz(a) int(a.size())
#define ll  long long int
#define mod (long long)(1e9+7)
#define endl '\n'
#define ENGZ ios::sync_with_stdio(0);ios_base::sync_with_stdio(0);cin.tie(0) , cout.tie(0) ;
#define pi (acos(-1))
#define F first
#define S second

ll fp(ll n , ll p )
{
    if(p==0)
        return 1;
    if(p==1)
        return n ;
    ll res = fp(n,p/2);
    res=((res)*(res)) ;
    if(p%2)
        res=(res*n) ;
    return res ;
}

ll n , m , a,  b , c , cnt = 0 , cost = 0;
map<ll,ll> mp;
int main()
{
    ENGZ;
    cin>>n >>m ;
    mp[0] = 0 ;
    for(int i=0 ; i<m ; i++)
    {
        cin>>a >>b ;
        cnt = 0 ;
        for(int i=0 ; i<b ; i++)
        {
            cin>>c ;
            cnt+= fp(2,c-1); // to change digit of mask ..
        }
        for(auto i:mp)
        {
            ll mask = i.F | cnt;
            if(mp.count(mask))mp[mask] = min(mp[mask],i.S + a);
            else mp[mask] = i.S + a;
        }
    }
    ll a5er_box = fp(2,n) -1;
    for(auto i:mp)cerr<<i.F <<" " <<i.S <<endl ;
    cerr<<"---------------------------" <<endl ;
    if(mp.count(a5er_box))cout<<mp[a5er_box].S <<endl;
    else cout<<-1 <<endl ;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: request for member 'second' in 'mp.std::map<long long int, long long int>::operator[](a5er_box)', which is of non-class type 'std::map<long long int, long long int>::mapped_type' {aka 'long long int'}
   11 | #define S second
      |           ^~~~~~
a.cc:52:46: note: in expansion of macro 'S'
   52 |     if(mp.count(a5er_box))cout<<mp[a5er_box].S <<endl;
      |                                              ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
const int mod = 1e9 + 7, A = 1e3 + 2;
int n, price[A], masks[A];
ll dp[A][8888];
ll solve(int ind, int mask) {
    if (ind == m)
        return (mask == (1 << n) - 1 ? 0 : 1e18);
    if (~dp[ind][mask])
        return dp[ind][mask];
    ll val = solve(ind + 1, mask);
    val = min(val, solve(ind + 1, mask |= masks[ind]) + price[ind]);
    return dp[ind][mask] = val;
}
int main() {
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int x, y;
        cin >> price[i] >> x;
        while(x--)
            cin >> y, masks[i] |=(1 << (y - 1));
    }
    memset(dp, -1, sizeof dp);
    ll ans = solve(0, 0);
    cout << (ans >= 1e18 ? -1 : ans);
    return 0;
}

Compiler output:
a.cc: In function 'long long int solve(int, int)':
a.cc:11:16: error: 'm' was not declared in this scope; did you mean 'tm'?
   11 |     if (ind == m)
      |                ^
      |                tm
Language: Java


import java.util.Scanner;

public class Bitdp1 {

    static int inf = 1000000000;

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        int m = Integer.parseInt(scan.next());
        int[] a = new int[m];
        int[][] c = new int[m][];
        for (int i = 0; i < m; i++) {
            a[i] = Integer.parseInt(scan.next());
            int b = Integer.parseInt(scan.next());
            c[i] = new int[b];
            for (int j = 0; j < b; j++) {
                c[i][j] = Integer.parseInt(scan.next());
            }
        }
        scan.close();

        int[][] dp = new int[m + 1][1 << n];
        for (int i = 0; i <= m; i++) {
            for (int j = 0; j < (1 << n); j++) {
                dp[i][j] = inf;
            }
        }
        dp[0][0] = 0;

        for (int i = 0; i < m; i++) {
            for (int j = 0; j < (1 << n); j++) {
                if (dp[i][j] == inf) {
                    continue;
                }

                // 選ばない
                dp[i + 1][j] = Math.min(dp[i + 1][j], dp[i][j]);

                // 選ぶ
                int after = j;
                for (int k : c[i]) {
                    after |= (1 << (k - 1));
                }
                dp[i + 1][after] = Math.min(dp[i + 1][after], dp[i][j] + a[i]);
            }
        }

        if (dp[m][(1 << n) - 1] != inf) {
            System.out.println(dp[m][(1 << n) - 1]);
        } else {
            System.out.println(-1);
        }
    }

}


Compiler output:
Main.java:4: error: class Bitdp1 is public, should be declared in a file named Bitdp1.java
public class Bitdp1 {
       ^
1 error
Language: Java

import java.util.*;
import java.util.function.BiConsumer;

public class MinCostProblem {

    public static void main(String args[]) {
        Scanner scanner = new Scanner(System.in);
        int noofboxes = scanner.nextInt();
        int noofkeys = scanner.nextInt();
        int keycost[] = new int[noofkeys];
        Map<Integer, List<Integer>> costvsboxesmap = new TreeMap<>();
        for (int i=0; i<noofkeys; i++) {
//            System.out.println("Getting key - "+ i);
            keycost[i] = scanner.nextInt();
            int boxnos = scanner.nextInt();
            List<Integer> boxlist = new ArrayList<>();
            for (int j=0; j<boxnos; j++) {
//                System.out.println("Getting box nos - "+ j);
                boxlist.add(scanner.nextInt());
                costvsboxesmap.put(keycost[i], boxlist);
            }
        }

        int costcompute = 0; Set<Integer> boxesset = new HashSet<>();
        Iterator<Map.Entry<Integer, List<Integer>>> costboxiterator = costvsboxesmap.entrySet().iterator();
        Map.Entry<Integer, List<Integer>> entry = null;

        while(costboxiterator.hasNext()) {
            entry = costboxiterator.next();
            Integer cost = entry.getKey();
            List<Integer> boxes = entry.getValue();

            if (boxesset.addAll(boxes)) {
                costcompute += cost;
            }
        }

        if (boxesset.size() != noofboxes) {
            costcompute = -1;
        }

        System.out.println(costcompute);
    }
}


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

#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int main(){
	cout << fixed << setprecision(10);
	int n,m;
	cin >> n >> m;
	vector<pair<int,int>> key;
	rep(i,m){
		int a,b;
		cin >> a >> b;
		int s = 0;
		rep(j,b){
			int c;
			cin >> c;
			--c;
			s |= 1<<c ; // or
		}
		key.push_back({s,a});
	}
	vector<int> dp(1<<n, inf);
	dp[0] = 0;
	rep(s,1<<n){
		rep(j,m){
			int t = s | key[s].first;
			int cost = dp[s] + key[i].second;
			dp[t] = min(dp[t],cost);
		}
	}
	int ans = dp.back();
	if(ans == INF) ans = -1;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:48: error: 'i' was not declared in this scope
   34 |                         int cost = dp[s] + key[i].second;
      |                                                ^
Language: C++

#include <bits/stdc++.h
#define int long long

using namespace std;
int n,m,check[13][(1<<14)],res=-1;
const int INF = 1e9 + 7;

struct key
{
    int a,b;
    vector <int> c;
};

struct key sth[1009];

int uwu(int i,int nani)
{
    if (check[i][nani]!=-1) return check[i][nani];
    if (i>m)
    {
        for (int j=0; j<n; ++j)
        {
            int cur_bit=((nani & (1 << j)) > 0);
            if (cur_bit!=1) return INF;
        }
        return 0;
    }
    //not pick
    int tmp=min(INF,uwu(i+1,nani));
    //pick
    int temp=nani;
    for (auto j:sth[i].c)
        nani|=(1<<(j-1));
    tmp=min(tmp,uwu(i+1,nani)+sth[i].a);
    return check[i][temp]=tmp;
}

int main()
{
    cin >> n >> m;
    memset(check,-1,sizeof(check));
    for (int i=1; i<=m; ++i)
    {
        cin >> sth[i].a >> sth[i].b;
        int tmp;
        for (int j=0; j<sth[i].b; ++j)
        {
            cin >> tmp;
            sth[i].c.push_back(tmp);
        }
    }
    res=uwu(1,0);
    if (res>=INF) cout << -1;
    else cout << res;
    return 0;
}


Compiler output:
a.cc:1:24: error: missing terminating > character
    1 | #include <bits/stdc++.h
      |                        ^
cc1plus: error: '::main' must return 'int'
Language: C++

#include <bits/stdc++.h>
#pragma once
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
#define endn "\n"
typedef pair<int,int> P;
const int MOD = 1000000007;
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 


////////////////////////////////////////////////////////////////////

long long int n,m,a[1100], b[1100];bool c[1100][20]={};
long long int dp[10000],t[20];
signed main(){
  cin>>n>>m;
  rep(i,10000)dp[i] = INF;
  rep(i,20)t[i] = INF;
  dp[0] = 0;
  rep(i,m){
    cin>>a[i]>>b[i];
    rep(j,b[i]){
      int cc;cin>>cc;cc--;
      c[i][cc] = true;
      chmin(t[i], a[i]);
    }
  }
  rep(bit,1<<n){
    rep(i,m){
      int bb = bit;
      rep(j,n){
        if(c[i][j]){
          bb |= (1<<j);
        }
      }
      chmin(dp[bb], dp[bit] + a[i]);
    }
  }
  cout << (dp[(1<<n)-1] == INF ? -1 : dp[(1<<n)-1]) << endl;
}


Compiler output:
a.cc:2:9: warning: #pragma once in main file
    2 | #pragma once
      |         ^~~~
a.cc:8:13: error: 'long long long' is too long for GCC
    8 | #define int long long
      |             ^~~~
a.cc:23:11: note: in expansion of macro 'int'
   23 | long long int n,m,a[1100], b[1100];bool c[1100][20]={};
      |           ^~~
a.cc:8:18: error: 'long long long' is too long for GCC
    8 | #define int long long
      |                  ^~~~
a.cc:23:11: note: in expansion of macro 'int'
   23 | long long int n,m,a[1100], b[1100];bool c[1100][20]={};
      |           ^~~
a.cc:8:13: error: 'long long long' is too long for GCC
    8 | #define int long long
      |             ^~~~
a.cc:24:11: note: in expansion of macro 'int'
   24 | long long int dp[10000],t[20];
      |           ^~~
a.cc:8:18: error: 'long long long' is too long for GCC
    8 | #define int long long
      |                  ^~~~
a.cc:24:11: note: in expansion of macro 'int'
   24 | long long int dp[10000],t[20];
      |           ^~~
Language: C++

#include <iostream>
#include<map>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<ctime>
using namespace std;
#define ll long long
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define mset(s,_) memset(s,_,sizeof s)
int dp[1 << 13];
map<int, int>mp;
int main() {
	int n, m;
	cin >> n >> m;
	mset(dp, 0x3f);
	mset(dp, 0x3f);
	dp[0] = 0;
	rep(i, 1, m) {
		int w, k;
		cin >> w >> k;
		int tmp = 0;
		rep(i, 1, k) {
			int c;
			cin >> c;
			tmp |= 1 << c - 1;
		}
		if (mp[tmp]) mp[tmp] = min(w, mp[tmp]);
		else mp[tmp] = w;
	}
	for (int i = 0; i < 1 << n; i++) {
		for (auto v : mp) {
			dp[i | v.first] = min(dp[i] + v.second, dp[i | v.first]);
		}
	}
	if (dp[(1 << n) - 1] == 0x3f3f3f3f) cout << -1 << '\n';
	else cout << dp[(1 << n )- 1] << '\n';
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: error: 'memset' was not declared in this scope
   12 | #define mset(s,_) memset(s,_,sizeof s)
      |                   ^~~~~~
a.cc:18:9: note: in expansion of macro 'mset'
   18 |         mset(dp, 0x3f);
      |         ^~~~
a.cc:8:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include<ctime>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define s
(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
template<class T> inline bool chmax(T& a, T b) { 
if (a < b) { a = b; return true; } return false; 
}
template<class T> inline bool chmin(T& a, T b) {
 if (a > b) { a = b; return true; } return false; 
 }
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll n,m;
  cin>>n>>m;
  vector<pll> p(m);
  rep(i,m){
    ll a,b;
    cin>>a>>b;
    p[i].F=a;
    rep(j,b){
      ll c;
      cin>>c;
      p[i].S|=(1<<c-1);
    }
  }
  vll dp((1<<n)-1,INF);
  dp[0]=0;
  rep(i,(1<<n)){
    rep(j,m){
      ll nx=i|p[j].S;
      dp[nx]=min(dp[nx],dp[i]+p[j].F);
    }
  }
  if(dp[(1<<n)-1]==INF){
COUT(-1);
  }
  else COUT(dp[(1<<n)-1]);
}

Compiler output:
a.cc:29:9: error: expected constructor, destructor, or type conversion before '(' token
   29 | (x) (ll)(x).size()
      |         ^
Language: C++

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

using namespace std;

int n,m,dp[5050],a[1010],b[1010],c[1010]={0};


  int main() {
    
    cin >> n >> m;
    
    for (int i = 0; i < m; ++i) {
        cin >> a[i] >> b[i];
      
        for (int j = 0; j < b[i]; ++j){
            int d; 
          cin >> d; 
          --d;
            c[i] += (1<<d);
        }
      
    dp[0] = 0;
      
      for(int i=0;i<(1<<n);i++){
        dp[i] = 1e9;
      }
      
    for(int i=0;i<m;i++){
      for(int j=0;j<(1<<n);j++){
        
        dp[c[i]|j]= min(dp[c[i]|j],dp[j]+a[i]);
    }
    }
      
    cout<<(dp[(1<<n)-1]<1e9? dp[(1<<n)-1]:-1)<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:10:14: note: to match this '{'
   10 |   int main() {
      |              ^
Language: Java

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[][] array = new int[m][13];
        
        for (int i = 0; i < m; i++) {
            array[i][0] = sc.nextInt();
            
            int k = sc.nextInt();
            for (int j = 0; j < k; j++) {
                array[i][sc.nextInt()] = 1;
            }
        }
        Arrays.sort(array, (a, b) -> Integer.compare(a[0], b[0]));
        
        long cost = 0;
        boolean[] ok = new boolean[13];
        for (int i = 1; i <= 12; i++) {
            if (ok[i]) continue;
            
            for (int j = 0; j < m; j++) {
                if (array[j][i] == 1) {
                    cost += array[j][0];
                    for (int l = 1; l <= 12; l++) {
                        if (array[j][l] == 1) {
                            ok[l] = true;
                        }
                    }
                    break;
                }
            }
        }
        
        for (int i = 1; i <= 12; i++) {
            if (!ok) {
                System.out.println(-1);
                return;
            }
        }
        
        System.out.println(cost);
    }
}


Compiler output:
Main.java:40: error: bad operand type boolean[] for unary operator '!'
            if (!ok) {
                ^
1 error
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define ve vector
#define pq priority_queue
#define vi vector<int>
#define vl vector<long long>
#define vii vector<vector<int>>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll mod = 1000000007;



int main()
{
    int n,m;
    cin >> n >> m;
    ve<pair<int,int>> key;
    rep(i,m){
        int a,b;
        cin >> a >> b;
        int cost = 0;
        rep(j,b){
            int c;
            cin >> c;
            c--;
            cost |= (1<<c);
        }
        key.push_back(a,cost);
    }
    
    const int INF = 1000000000;
    
    ve<int> dp(1<<n,INF);
    dp[0] = 0;
    
    for (int i = 0; i < (1<<n); i++) {
        for (int j = 0; j < m; j++) {
            int tt = i | key[j].se;
            dp[tt] = min(dp[tt], dp[i]+key[j].fi);
        }
    }
    
    if(dp[(1<<n)-1] == INF) out(-1);
    else out(dp[(1<<n)-1]);



    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:22: error: no matching function for call to 'std::vector<std::pair<int, int> >::push_back(int&, int&)'
   37 |         key.push_back(a,cost);
      |         ~~~~~~~~~~~~~^~~~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1283:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1283 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1283:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_vector.h:1300:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = std::pair<int, int>; _Alloc = std::allocator<std::pair<int, int> >; value_type = std::pair<int, int>]'
 1300 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1300:7: note:   candidate expects 1 argument, 2 provided