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

#include <bits/stdc++.h>
using namespace std;
string Plus(string n,string m){
	while(n.size()!=m.size()){
		if(n.size()>m.size()){
			m="0"+m;
		}else{
			n="0"+n;
		}
	}
	int g=0;
	for(int i=n.size()-1;i>=0;i--){
		n[i]=n[i]+m[i]-'0'*2+g;
		g=n[i]/10;
		n[i]%=10;
		n[i]+=48;
	}
	if(g!=0){
		n=char(g+48)+n;
	}
	return n;
}
string Minus(string n,string m){
	while(n.size()!=m.size()){
		if(n.size()>m.size()){
			m="0"+m;
		}else{
			n="0"+n;
		}
	}
	int g=0;
	for(int i=n.size()-1;i>=0;i--){
		n[i]=n[i]-m[i]+g+10;
		g=n[i]/10;
		g--;
		n[i]%=10;
		n[i]+=48;
	}
	int x=0;
	while(n[x]=='0'){
		x++;
	}
	return n.substr(x);
}

long long h[1000005]={0};
string Multiply(string x,string y){
	memset(h,0,sizeof(h));
	for(int i=x.size()-1;i>=0;i--){
		for(int j=y.size()-1;j>=0;j--){
			h[i+j]+=(int)((x[i]-'0')*(y[j]-'0'));
		}
	}
	int g=0;
	for(int i=x.size()+y.size()-2;i>=0;i--){
		int k=h[i]+g;
		h[i]=(h[i]+g)%10;
		g=k/10;
		h[i]+=48;
	}
	string ss="";
	for(int i=0;i<x.size()+y.size()-1;i++){
		ss+=h[i];
	}
	for(int i=0;i<s.size()+y.size()-1;i++){
		ss+=h[i];
	}
	if(g){
		ss=char(g+'0')+ss;
	}
	int j=0;
	while(ss[j]==48&&j<ss.size()-1){
		j++;
	}
	while(ss[j]==48&&j<ss.size()-1)
	return ss.substr(j);
}
bool com(string s1,string s2){
	return (s1.size()>s2.size()||(s1.size()==s2.size()&&s1>=s2));
}
string divi(string s1,string s2){
	string s3="";
	string ans="";
	int f=1;
	for(int i=0;i<s1.size();i++){
		s3+=s1[i];
		if(f==0){
			if(!com(s3,s2)){
				ans+="0";
			}
		}
		if(com(s3,s2)){
			f=0;
			ans+="0";
			while(com(s3,s2)){
				s3=Minus(s3,s2);
				ans[ans.size()-1]++;
			}
		}
	}
	return ans;
}
int main(){
	string a,x;
	cin>>a>>x;
	cout<<Multiply(a,x)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'std::string Multiply(std::string, std::string)':
a.cc:65:23: error: 's' was not declared in this scope
   65 |         for(int i=0;i<s.size()+y.size()-1;i++){
      |                       ^
a.cc:77:1: warning: control reaches end of non-void function [-Wreturn-type]
   77 | }
      | ^
Language: C++

#include <iostream>
using namespace std:
 int main() {
   int n;
   cin >> n;
   int a[n];
   for (int i=0;i<n;i++) {
     cin >> a[i];
   }
   {
     int a1 = a[0];
     bool b = 0;
     for (int i=0;i<n;i++) {
       if (a[i]!=a1) {
         b = 1;
         break;
       }
     }
     if (b==0) return 0;
   }
   
   bool b[1000001];
   for (int i=0;i<n;i++) {
     for (int j=2*a[i];j<=1000001;j++a[i]) b[j]=1;
   }
   int ans = 0;
   for (int i=0;i<n;i++) {
     if (b[a[i]]=0) ans++;
   }
   cout << ans;
   return 0;
 }
     


Compiler output:
a.cc:2:20: error: expected ';' before ':' token
    2 | using namespace std:
      |                    ^
      |                    ;
a.cc:2:20: error: expected unqualified-id before ':' token
Language: C++

#include <iostream>
using namespase std:
 int main() {
   int n;
   cin >> n;
   int a[n];
   for (int i=0;i<n;i++) {
     cin >> a[i];
   }
   {
     int a1 = a[0];
     bool b = 0;
     for (int i=0;i<n;i++) {
       if (a[i]!=a1) {
         b = 1;
         break;
       }
     }
     if (b==0) return 0;
   }
   
   bool b[1000001];
   for (int i=0;i<n;i++) {
     for (int j=2*a[i];j<=1000001;j++a[i]) b[j]=1;
   }
   int ans = 0;
   for (int i=0;i<n;i++) {
     if (b[a[i]]=0) ans++;
   }
   cout << ans;
   return 0;
 }
     


Compiler output:
a.cc:2:7: error: expected nested-name-specifier before 'namespase'
    2 | using namespase std:
      |       ^~~~~~~~~
Language: C++

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

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n), div(1000010), cnt(1000010);
    for(int i=0; i<n; i++) {
        cin >> a[i];
        cnt[a[i]]++;
    }
    for(int i=1; i<=1000000; i++) {
        for(int j=i; j<=1000000; j+=i) {
            div[j] += num[i];
        }
    }
    int ans = 0;
    for(int i=0; i<n; i++) {
        if(div[a[i]] == 1) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:23: error: 'num' was not declared in this scope; did you mean 'enum'?
   15 |             div[j] += num[i];
      |                       ^~~
      |                       enum
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
 
 
int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++){
    cin>>v[i];
  }
  sort(v.begin(),v.end());
  vector<int> vals(v[n-1]+1,0);
  for(int i=0;i<n;i++){
    if(i!=0 && i!=n-1){
      if(v[i]!=v[i+1] && v[i]!=v[i-1]){
     for(int j=v[i];j<=v[n-1];j+=v[i]){
      vals[j]++;
     }
     }else{
      vals[i]=10;
     }
    }
    }else if(i==0){
      if(v[i]!=v[i+1]){
        for(int j=v[i];j<=v[n-1];j+=v[i]){
        vals[j]++;
        }
      }else{
      vals[i]=10;
     }
    }else{
       if(v[i]!=v[i-1]){
        for(int j=v[i];j<=v[n-1];j+=v[i]){
        vals[j]++;
        }
      }else{
      vals[i]=10;
     }
    }
  }
  int ans=0;
  for(int i=0;i<v.size();i++){
    if(vals[v[i]]==1){
      ans++;
    }
  }
  cout<<ans<<endl;

  


  }
 
 
 
 

 

Compiler output:
a.cc: In function 'int main()':
a.cc:27:6: error: 'else' without a previous 'if'
   27 |     }else if(i==0){
      |      ^~~~
a.cc:27:14: error: 'i' was not declared in this scope
   27 |     }else if(i==0){
      |              ^
a.cc: At global scope:
a.cc:46:3: error: expected unqualified-id before 'for'
   46 |   for(int i=0;i<v.size();i++){
      |   ^~~
a.cc:46:15: error: 'i' does not name a type
   46 |   for(int i=0;i<v.size();i++){
      |               ^
a.cc:46:26: error: 'i' does not name a type
   46 |   for(int i=0;i<v.size();i++){
      |                          ^
a.cc:51:3: error: 'cout' does not name a type
   51 |   cout<<ans<<endl;
      |   ^~~~
a.cc:56:3: error: expected declaration before '}' token
   56 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
 
 
int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++){
    cin>>v[i];
  }
  sort(v.begin(),v.end());
  vector<int> vals(v[n-1]+1,0);
  for(int i=0;i<n;i++){
    if(i!=0 && i!=n-1){
      if(v[i]!=v[i+1] && v[i]!=v[i-1]){
     for(int j=v[i];j<=v[n-1];j+=v[i]){
      vals[j]++;
     }else{
      vals[i]=10;
     }
    }
    }else if(i==0){
      if(v[i]!=v[i+1]){
        for(int j=v[i];j<=v[n-1];j+=v[i]){
        vals[j]++;
        }
      }else{
      vals[i]=10;
     }
    }else{
       if(v[i]!=v[i-1]){
        for(int j=v[i];j<=v[n-1];j+=v[i]){
        vals[j]++;
        }
      }else{
      vals[i]=10;
     }
    }
  }
  int ans=0;
  for(int i=0;i<v.size();i++){
    if(vals[v[i]]==1){
      ans++;
    }
  }
  cout<<ans<<endl;

  


  }
 
 
 
 

 

Compiler output:
a.cc: In function 'int main()':
a.cc:22:7: error: expected '}' before 'else'
   22 |      }else{
      |       ^~~~
a.cc:19:39: note: to match this '{'
   19 |       if(v[i]!=v[i+1] && v[i]!=v[i-1]){
      |                                       ^
a.cc:26:6: error: 'else' without a previous 'if'
   26 |     }else if(i==0){
      |      ^~~~
a.cc:26:14: error: 'i' was not declared in this scope
   26 |     }else if(i==0){
      |              ^
a.cc: At global scope:
a.cc:45:3: error: expected unqualified-id before 'for'
   45 |   for(int i=0;i<v.size();i++){
      |   ^~~
a.cc:45:15: error: 'i' does not name a type
   45 |   for(int i=0;i<v.size();i++){
      |               ^
a.cc:45:26: error: 'i' does not name a type
   45 |   for(int i=0;i<v.size();i++){
      |                          ^
a.cc:50:3: error: 'cout' does not name a type
   50 |   cout<<ans<<endl;
      |   ^~~~
a.cc:55:3: error: expected declaration before '}' token
   55 |   }
      |   ^
Language: C++

#include <iostream>
#include <algorithm>

using namespace std;


int main() {
    int n, flag, count=0;
    cin >> n;
    int a[n];
    for (int i= 0;i<n;i++) {
        cin >> a[i];
    }
    sort(a,a+n)
    for(int i=0;i<n;i++) {
        flag=1;
        for(int j=0;j<=i;j++) {
            if (j==i) continue;
            if (a[i]%a[j]==0||a[i]==a[j]) {flag=0;break;}
        }
        if (flag==1) count++;
    }
    cout << count;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:16: error: expected ';' before 'for'
   14 |     sort(a,a+n)
      |                ^
      |                ;
   15 |     for(int i=0;i<n;i++) {
      |     ~~~         
a.cc:15:17: error: 'i' was not declared in this scope
   15 |     for(int i=0;i<n;i++) {
      |                 ^
Language: C++

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

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

    int n, M = 1e6 + 1, ans = 0;
    cin >> n;
    int o[M] = {};

    while (n--) {
        int x;
        cin >> x;
        o[x]++;
    }
    for (int i = 1; i < M; i++)
        if (o[i])
            for (int j = i + i; j < M; j += i)
                o[j] = 0;
    for (int x : o)
        ans += (x == 1);
    cout << ans << '\n';
}#include <bits/stdc++.h>
using namespace std;

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

    int n, M = 1e6 + 1, ans = 0;
    cin >> n;
    int o[M] = {};

    while (n--) {
        int x;
        cin >> x;
        o[x]++;
    }
    for (int i = 1; i < M; i++)
        if (o[i])
            for (int j = i + i; j < M; j += i)
                o[j] = 0;
    for (int x : o)
        ans += (x == 1);
    cout << ans << '\n';
}

Compiler output:
a.cc:24:2: error: stray '#' in program
   24 | }#include <bits/stdc++.h>
      |  ^
a.cc:24:3: error: 'include' does not name a type
   24 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:27:5: error: redefinition of 'int main()'
   27 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

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

int main(){
	int t;
 	cin >> t;
  	vector<int> v;
 	while(t>0){
		int n;
      	cin >> n;
      	v.push_back(n);
      	t--;
    }
  	int cnt = 0;
  	for(int i=0;i<t;i++){
      	for(int j=0;j<n;j++){
        	if(i==j){
          		if(v[i]%v[j]!=0)cnt++;
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'n' was not declared in this scope
   16 |         for(int j=0;j<n;j++){
      |                       ^
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
  	cin >> a.at(i);
  }
  sort(a.begin(),a.end());
  int count;
  count=0;
  for(int j=0;j<n;j++){
  	for(int l=0;l<n;l++){
      if(l==j){continue;}
      if(a.at(j)%a.at(l)==0){break;}
      if(a[j]<a[l]){l=n-1;}
      if(l==n-1){count++}
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: expected ';' before '}' token
   19 |       if(l==n-1){count++}
      |                         ^
      |                         ;
Language: C++

// SeeAlso: 

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100000
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define debug(x) cout<<#x<<": "<<x<<endl
#define debig_vec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) rep(i, h) { rep(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> inline void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> inline void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
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; }

const long long INF = 1LL<<60;

int main() {
    ll n;
    cin >> n;
    vector<ll> a;
    rep(i, n) {
        ll t;
        cin >> t;
        a.push_back(t);
    }
    sort(a.begin(), a.end());
    vector<bool> checked(1000000, true);

    if (a[0]==1) {
        if (n>1&&a[1]==1) {
            print(0);
        } else {
            print(1);
        }
        return 0;
    }

    ll ans = 0;
    rep(i, n) {
        if (i>0 && a[i-1]==a[i]) continue;

        ll target = a[i];
        if (checked[target] && !(i<N-1 && a[i]==a[i+1])) {
            ans++;
        }
        while(target<=1000000) {
            checked[target] = false;
            target += a[i];
        }
    }

    print(ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:65:36: error: 'N' was not declared in this scope
   65 |         if (checked[target] && !(i<N-1 && a[i]==a[i+1])) {
      |                                    ^
Language: C++

// SeeAlso: 

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100000
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define debug(x) cout<<#x<<": "<<x<<endl
#define debig_vec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) rep(i, h) { rep(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> inline void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> inline void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
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; }

const long long INF = 1LL<<60;

int main() {
    ll n;
    cin >> n;
    vector<ll> a;
    rep(i, n) {
        ll t;
        cin >> t;
        a.push_back(t);
    }
    sort(a.begin(), a.end());
    vector<bool> checked(1000000, true);

    if (a[0]==1) {
        if (n>1&&a[1]==1) {
            print(0);
        } else {
            print(1);
        }
        return 0;
    }

    ll ans = 0;
    rep(i, n) {
        if (i>0 && a[i-1]==a[i]) {
            ans--;
            continue;
        }

        ll target = a[i];
        if (checked[target) {
            ans++;
        }
        while(target<=1000000) {
            checked[target] = false;
            target += a[i];
        }
    }

    print(ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:27: error: expected ']' before ')' token
   68 |         if (checked[target) {
      |                           ^
      |                           ]
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,i,j,flag=0,cnt=0;
  cin >>n;
  int ar[n];
  
  for(i=0;i<n;i++)
    cin >> ar[i];
  
  for(i=0;i<n;i++)
  {
    for(j=i+1;j<n;j++)
    {
      if(ar[i]%ar[j]
         flag=0;
    }
         if(flag==1)
         cnt++;
  }
         cout << cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:21: error: expected ';' before 'flag'
   16 |       if(ar[i]%ar[j]
      |                     ^
      |                     ;
   17 |          flag=0;
      |          ~~~~        
a.cc:18:5: error: expected primary-expression before '}' token
   18 |     }
      |     ^
a.cc:17:17: error: expected ')' before '}' token
   17 |          flag=0;
      |                 ^
      |                 )
   18 |     }
      |     ~            
a.cc:16:9: note: to match this '('
   16 |       if(ar[i]%ar[j]
      |         ^
a.cc:18:5: error: expected primary-expression before '}' token
   18 |     }
      |     ^
Language: C++

//D - Not Divisible


#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define f first
#define s second
#define rep(i, n) for (int i = 0; i < (n); ++i)


using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	int n;
	cin>>n;
	vi A(n);
	rep(i,n) cin>>A[i];
	sort(A.begin(), A.end());

	vi cnt(M);
	for(int x:A){
		if (cnt[x] != 0)
		{
			cnt[x]++;
			continue;

		}
		for (int i = x; i < M; i+=x)
		{
			cnt[i]++;
		}
	}
	int ans =0;
	for(int x :A){
		if(cnt[x] ==1){
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:16: error: 'M' was not declared in this scope
   39 |         vi cnt(M);
      |                ^
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,a[200000],i,j,countr=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a,a+n);
    if(n>1)
    {
        if(a[1]==a[0])
        {
            countr=0;
        }
        else
        {
            countr=1;
        }
    }
    else
    {
        countr=1;
    }
    for(i=1;i<n;i++)
    {
        int flag=1;
        if(a[i+1]!=a[i])
        {
            for(j=0;j<i;j++)
            {
                if(a[i]%a[j]==0)
                {
                    flag=0;
                    break;
                }
            }
        }
        else
        {
            flag=0;
        }
        if(flag==1)
        {
            countr++;
        }
    }
    printf("%d",countr);
}


Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C++

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

using namespace std;

int main(){
  int N;
  cin >> N;
  vector <int> A(N);
  for(int i=0; i<N; i++){
    cin >> A[i];
  }
  
  int count(0);
  
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      if(A[i]%A[j] == 0) count++;
    }
  }
  count -= N;
  
  cout << count << endl;
  return 0 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:11: error: expected ';' before '}' token
   25 |   return 0
      |           ^
      |           ;
   26 | }
      | ~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
  	sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
  int count1,count2;
  count2=0;
  for(int j=0;j<n;j++){
    count1=0;
  	for(int l=0;l<n;l++){
      if(l==j){continue;}
      if(a.at(j)%a.at(l)!=0){count1++;}
      if(a.at(j)%a.at(l)==0){break;}
    }
    if(count1==n-1){count2++;}
  }
  cout << count2 << endl;
}


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

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
  	reverse(sort(a.begin(),a.end()));
  int count1,count2;
  count2=0;
  for(int j=0;j<n;j++){
    count1=0;
  	for(int l=0;l<n;l++){
      if(l==j){continue;}
      if(a.at(j)%a.at(l)!=0){count1++;}
      if(a.at(j)%a.at(l)==0){break;}
    }
    if(count1==n-1){count2++;}
  }
  cout << count2 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:21: error: invalid use of void expression
    9 |         reverse(sort(a.begin(),a.end()));
      |                 ~~~~^~~~~~~~~~~~~~~~~~~
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

#define REP(i, n) for(int i = 0; i < (n); i++)
#define RREP(i, n) for(int i = (n)-1;  i >= 0; i--)
#define ALL(v) v.begin(), v.end()

int main()
{
  int N; cin >> N;
  vector<int> A(N); REP(i, N) cin >> A[i];
  vector<int> div;
  sort(ALL(A));
  int ans = 0;
  REP(i, N)
  {
    bool canDivide = false;;
    REP(j, div.size())
    {
      if(A[i] % div[j] == 0) canDivide = true;
    }
    if(!canDivide)
    {
      if(upper_bound(ALL(A), A[i]) - lower_bound(ALL(A), A[i]) == 1) ans++;
      div.push_back(A[i]);
    }
  }
  cout << ans << endl;
}  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   15 |   sort(ALL(A));
      |   ^~~~
      |   short
a.cc:26:10: error: 'upper_bound' was not declared in this scope
   26 |       if(upper_bound(ALL(A), A[i]) - lower_bound(ALL(A), A[i]) == 1) ans++;
      |          ^~~~~~~~~~~
Language: Java

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // printTestValue();
    // abc170_d();
    abc169_b();

  }

  public static void abc169_b() {
    try (Scanner sc = new Scanner(System.in)) {
      int size = Integer.parseInt(sc.next());
      long ans = 1L;
      List<Long> list = new ArrayList<Long>();

      for (int xx = 0; xx < size; xx++) {
        list.add(Long.parseLong(sc.next()));
      }
      Collections.sort(list);
      if (list.get(0) == 0L) {
        System.out.println(0);
        return;
      }
      Collections.reverse(list);
      for (int yy = 0; yy < size; yy++) {
        if (18 < String.valueOf(ans).length() - 1
          + String.valueOf(list.get(yy)).length()
          || new BigInteger(String.valueOf(ans * list.get(yy))).compareTo(
            new BigInteger(String.valueOf((long) Math.pow(10d, 18d)))) == 1) {
          System.out.println(-1);
          return;
        }
        ans *= list.get(yy);
      }
      System.out.println(ans);
    } catch (Exception e) {
      System.out.println("エラー" + e);
    }
  }

Compiler output:
Main.java:46: error: reached end of file while parsing
  }
   ^
1 error
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
  }
  int x = 0;
  int y = 1;
  int z = 0;
  while(x < N){
    if(A.at(x) % B.at(x) == 0){
      x = x + 1;
      y = x + 1;
    }
    else{
      if(y + 1 < N){
        y = y + 1;
      }
      else{
        x = x + 1;
        y = x + 1;
        z = z + 1;
      }
    }
  }
  cout << z;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'B' was not declared in this scope
   15 |     if(A.at(x) % B.at(x) == 0){
      |                  ^
Language: C++

// SeeAlso: 

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100000
#define NIL -1
#define MOD 1000000007

typedef int _loop_int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define debug(x) cout<<#x<<": "<<x<<endl
#define debig_vec(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) rep(i, h) { rep(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> inline void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> inline void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
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; }

const long long INF = 1LL<<60;

int main() {
    ll n;
    cin >> n;
    vector<ll> a;
    rep(i, n) {
        ll t;
        cin >> t;
        a.push_back(t);
    }
    sort(a.begin(), a.end());
    bool checked[n+1];
    rep(i, n+1) checked[i] = true;

    rep(i, n) {
        if (!checked[i]) continue;
        if((i+1)<n && a[i]==a[i+1]) {
            checked[i] = false;
            i++;
            checked[i] = false;
            continue;
        } else {
            ans++;
        }
        FOR(j, i+1, n) {
            if((a[j] % a[i])==0) checked[j] = false;
        }
    }

    print(ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 |             ans++;
      |             ^~~
      |             abs
a.cc:67:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   67 |     print(ans;
      |           ^~~
      |           abs
Language: Java

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

        var N = scanner.nextInt();
        var A = new int[N];
        var isP = new boolean[N];

        for(int i=0; i<N; i++) {
            A[i] = scanner.nextInt();
            isP[i] = true;
        }

        Arrays.sort(A);
        int numP = 0;
        for(int i=0; i<N-1; i++) {
            if(!isP[i]) continue;

            for(int j=i+1; j<N; j++) {
                if(!isP[j]) continue;
                if(A[i] == A[j]) isP[i] = false;
                if(A[j] % A[i] == 0) isP[j] = false;
                numP++;
            }
        }
        System.out.println(numP);
    }
}

Compiler output:
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
        Scanner scanner = new Scanner(System.in);
                              ^
  symbol:   class Scanner
  location: class Main
Main.java:14: error: cannot find symbol
        Arrays.sort(A);
        ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include<bits/stdc++.h>
 
using namespace std;
 
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define N 200005
 

int mark[N*5];

int check(int n){
	int p = sqrt(n);
	int val=1;
	if(n==1 )
		if(mark[i]>1)
			return 0;
		else
			return 1;
	if(mark[n]>1 || mark[1]>0)
		val=0;
		
	for(int i=2;i<=p;i++){
		if(n%i==0 && (mark[i]>0 || mark[n/i]>0))
			val=0;
	}

	return val;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	

	int a[N],n,i;
	cin>>n;
	for(i=1;i<=n;i++){
		cin>>a[i];
		mark[a[i]]++;
	}
	if(n==1){
		cout<<1<<endl;
		return 0;
	}
	int val,ans=0;
	for(i=1;i<=n;i++){
		val = check(a[i]);
		if(val){
			// cout<<a[i]<<endl;
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int check(int)':
a.cc:17:25: error: 'i' was not declared in this scope
   17 |                 if(mark[i]>1)
      |                         ^
Language: C++

#include <bits/stdc++.h>
int n, c, f, i, j, a[200000], vis[1000001], spf[1000001];
int main()
{
    ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
    cin >> n;
    for (i = 0; i < n; i++)
        cin >> a[i], vis[a[i]]++;
    if (vis[1])
    {
        if (vis[1] == 1)
            out(1)
        else
            out(0)
        return 0;
    }
    for (i = 2; i <= 1e6; i += 2)
        spf[i] = 2;
    for (i = 3; i < 1e6; i += 2)
        spf[i] = i;
    for (i = 3; i < 998; i += 2)
        if (spf[i] == i)
            for (j = i * i; j < 1e6; j += i)
                if (spf[j] == j)
                    spf[j] = i;
    c = n;
    for (i = 0; i < n; i++)
        if (vis[a[i]] == 1)
        {
            if (a[i] != spf[a[i]])
            {
                for (j = spf[a[i]]; j * j <= a[i]; j++)
                    if (!(a[i] % j))
                        if (vis[a[i] / j] || vis[j])
                        {
                            c--;
                            break;
                        }
            }
        }
        else c--;
    out(c)
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'ios' has not been declared
    5 |     ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
      |     ^~~
a.cc:5:34: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |     ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
      |                                  ^~~
      |                                  std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:5:49: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    5 |     ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
      |                                                 ^~~~
      |                                                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:12:13: error: 'out' was not declared in this scope
   12 |             out(1)
      |             ^~~
a.cc:42:5: error: 'out' was not declared in this scope
   42 |     out(c)
      |     ^~~
Language: C++

int n, c, f, i, j, a[200000], vis[1000001], spf[1000001];
int main()
{
    fastio
    in(n)
    for (i = 0; i < n; i++)
        cin >> a[i], vis[a[i]]++;
    if (vis[1])
    {
        if (vis[1] == 1)
            out(1)
        else
            out(0)
        return 0;
    }
    for (i = 2; i <= 1e6; i += 2)
        spf[i] = 2;
    for (i = 3; i < 1e6; i += 2)
        spf[i] = i;
    for (i = 3; i < 998; i += 2)
        if (spf[i] == i)
            for (j = i * i; j < 1e6; j += i)
                if (spf[j] == j)
                    spf[j] = i;
    c = n;
    for (i = 0; i < n; i++)
        if (vis[a[i]] == 1)
        {
            if (a[i] != spf[a[i]])
            {
                for (j = spf[a[i]]; j * j <= a[i]; j++)
                    if (!(a[i] % j))
                        if (vis[a[i] / j] || vis[j])
                        {
                            c--;
                            break;
                        }
            }
        }
        else c--;
    out(c)
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'fastio' was not declared in this scope
    4 |     fastio
      |     ^~~~~~
a.cc:6:27: error: expected ';' before ')' token
    6 |     for (i = 0; i < n; i++)
      |                           ^
      |                           ;
a.cc:11:13: error: 'out' was not declared in this scope
   11 |             out(1)
      |             ^~~
a.cc:41:5: error: 'out' was not declared in this scope
   41 |     out(c)
      |     ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdlib>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int* arr=(int*)malloc(n*sizeof(int));
    for(int i=0;i<n;i++)
    cin>>(*(arr+i));
    sort(arr,arr+n);
    int count=0;
    for(int i=0;i<n;i++)
    {
        int flag=0;
        for(int j=0;j<i;j++)
        {
            if(((*(arr+i))%(*(arr+j)))==0)
            {
                flag=1;
                break;
            }
        }
        if((flag==0)&&((*(arr+i))!=(*(arr+i+1))+))
        count++;
    }
    cout<<count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:49: error: expected primary-expression before ')' token
   25 |         if((flag==0)&&((*(arr+i))!=(*(arr+i+1))+))
      |                                                 ^
Language: C++

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

int main()
{
 long long int n;
 cin>>n;
 vector<long long int>arr(n);
 for(int i=0;i<n;i++)
cin>>arr[i];
vector<long long nt> hash(1000000,0);

for(long long int i=0;i<n;i++)
hash[arr[i]]++;

for(long long int i=0;i<n;i++)
{
    if(hash[arr[i]]==1)
    {
        for(long long int j=2;arr[i]*j<1000000;j++)
        {
            hash[arr[i]*j]=1;
        }
    }
}

int count=0;
for(int i=0;i<n;i++)
{
    if(hash[arr[i]]==1)
    count++;
}

cout<<count<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: template argument 1 is invalid
   11 | vector<long long nt> hash(1000000,0);
      |                    ^
a.cc:11:20: error: template argument 2 is invalid
a.cc:11:36: error: expression list treated as compound expression in initializer [-fpermissive]
   11 | vector<long long nt> hash(1000000,0);
      |                                    ^
a.cc:14:5: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript
   14 | hash[arr[i]]++;
      |     ^
a.cc:18:12: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript
   18 |     if(hash[arr[i]]==1)
      |            ^
a.cc:22:17: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript
   22 |             hash[arr[i]*j]=1;
      |                 ^
a.cc:30:12: error: invalid types 'int[__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type {aka long long int}]' for array subscript
   30 |     if(hash[arr[i]]==1)
      |            ^
Language: C++

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

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int n;
    cin >> n;
    map<int, int> cnt;
    for (int i = 0; i < n; ++i) {
        int x;
        cin >> x;
        ++cnt[x];
    }
    int ans = n;
    for (auto [x, k] : cnt) {
        for (int i = 2; i * i <= x; ++i) {
            if (arr.count(i) + arr.count(x / i) > 0) {
                ans -= k;
                break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'arr' was not declared in this scope
   18 |             if (arr.count(i) + arr.count(x / i) > 0) {
      |                 ^~~
Language: C++

#include<iostream>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int arr[n];
    int count=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
    }
    sort(arr,arr+n);
    for(int i=0;i<n;i++)
    {
        int flag=0;
        for(int j=0;j<i;j++)
        {
            if(i!=j)
            {
               if((arr[i]%arr[j])==0)
               {
                   flag=1;
                   break;
               }
            }
        }
        if(flag==0)
        count++;
    }
    cout<<count;
    return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(arr,arr+n);
      |     ^~~~
      |     short
Language: C++

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

int main() {
	int s;
	cin>>s;
	int arr[s];
	for(int k=0;k<s;k++){
		cin>>arr[k];
	}
	sort(arr,arr+s);
	for(int i=0;i<n;i++){
		if(arr[i]==arr[i+1]){
			i++;
		}
	}
	int j=0,m=1000004,g=0;
	int n=arr[s-1]; 
	//cout<<n<<"\n";
    bool prime[1000001]; 
    memset(prime, true, sizeof(prime)); 
    int l=arr[j];
    for (int p=l; p*p<=1000000 && j<s;j++) 
    { 
    	p=arr[j];
    	//cout<<p<<"\n";
        if (prime[p] == true) 
        { 
        	if(m==p){
        		prime[p]=false;
        	}
            for (int i=2*p; i<=n; i += p) {
                prime[i] = false; 
                //cout<<i<<" ";
            }
        }
        m=arr[j];
        //cout<<"\n";
    } 
    for (int k=0; k<s; k++) 
       if (prime[arr[k]]) {
       	//cout<<arr[k]<<"\n";
       	g++;
       }
       if(g==s){
       	g=0;
       }
cout<<g;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:23: error: 'n' was not declared in this scope
   12 |         for(int i=0;i<n;i++){
      |                       ^
Language: C++

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

bool tof[1000005] ;
int main(){
ll  n;cin>> n ;
vector<ll> A(n);
rep(i,n) cin>>A[i] ;
sort(A.begin(),A.end()) ;
rep(i,1000005) tof[i]=0 ;
 rep(j,n){
  ll u=A[j] ;
  if(tof[u]!=0) continue ;
  if(tof[u]==0){
   for(ll i=u*2 ;i<=1000003 ;i+=u){
     
     if(tof[i]!=0) continue ;
      tof[i]=1 ;
   }
  }
 }
 rep(i,n) tof[A[i]]++ ;
 ll ans=0 ;
 rep(i,n) if(tof[A[i]]==1) ans++ ;
   cout<<ans<<"\n" ;
  return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:24:19: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   24 |  rep(i,n) tof[A[i]]++ ;
      |           ~~~~~~~~^
Language: C++

#include<bits/stdc++.h>

using namespace std;

const int mx = (int)1e6+7;
int main()
{
	int n; cin >> n;
	int arr[n];
	for(int i = 0; i < n; i++) cin >> arr[i];
	sort(arr, arr+n);
	int ans = 0;
	for(int i = 0; i < n-1; i++){
		if(arr[i] == arr[i+1]){
			ans--;
		}	
	}
	if(arr[n-1] == arr[n-2]) ans--;
	map<ll, int> m;
	for(int i = 0; i < n; i++){
		if(!m[arr[i]]){ ans++; continue;}
		for(int j = 2*arr[i]; j < mx; j += arr[i]){
			m[j] = 1;
		}
	}
	cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:13: error: 'll' was not declared in this scope
   19 |         map<ll, int> m;
      |             ^~
a.cc:19:20: error: template argument 1 is invalid
   19 |         map<ll, int> m;
      |                    ^
a.cc:19:20: error: template argument 3 is invalid
a.cc:19:20: error: template argument 4 is invalid
a.cc:21:22: error: invalid types 'int[int]' for array subscript
   21 |                 if(!m[arr[i]]){ ans++; continue;}
      |                      ^
a.cc:23:26: error: invalid types 'int[int]' for array subscript
   23 |                         m[j] = 1;
      |                          ^
Language: C++

#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <set>
#include <deque>
#include <utility>

bool exist[1000004];
bool duplicate[1000004];

bool dfs(std::vector<int > pr, std::vector<int> yakusuu, int val, int index, int orig){
  if (index==yakusuu.size()){
    if (val==orig) return false;
    else if (exist[val]) return true;
    else return false;
  } else {
    bool ret = false;
    int target=yakusuu[index];
    int num=pr[target];
    int multiple=1;
    for (int i=0; i<=num; i++){
      ret |= dfs(pr, yakusuu, val*multiple, index+1, orig);
      multiple *= target;
      if (ret) return true
    }
    return ret;
  }
}

int main(){
  int N;
  scanf("%d", &N);
  std::vector<int > A(N);
  for (int i=0; i<1000004; i++){
    exist[i]=false;
    duplicate[i]=false;
  }
  for (int i=0; i<N; i++){
    scanf("%d", &A[i]);
  }
  std::sort(A.begin(), A.end());
  for (int i=0; i<N; i++){
    if (exist[A[i]]) {
      duplicate[A[i]]=true;;
    } else {
      exist[A[i]]=true;
    }
  }
  int ans = 0;
  for (int i=0; i<N; i++){
    //printf("i=%d\n", i);
    if (duplicate[A[i]]) continue;
    std::vector<int > pr(1000004, 0);
    std::vector<int > yakusuu;
    int temp=A[i];
    for (int i=2; i*i<=temp; i++){
      while(temp%i==0){
	if(pr[i]==0) yakusuu.push_back(i);
	pr[i]++;
	temp=temp/i;
      }
    }
    if (temp!=1) {
      yakusuu.push_back(temp);
      pr[temp]++;
    }
    bool existyakusuu = dfs(pr, yakusuu, 1, 0, A[i]);
    if (!existyakusuu) ans++;
    //printf("exist yakusuu = %d\n", existyakusuu);
  }
  std::cout << ans << std::endl;
  return 0;
}
 

Compiler output:
a.cc: In function 'bool dfs(std::vector<int>, std::vector<int>, int, int, int)':
a.cc:32:27: error: expected ';' before '}' token
   32 |       if (ret) return true
      |                           ^
      |                           ;
   33 |     }
      |     ~
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)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(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 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;
  cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  sort(all(a));
  ll ans=0;
  vll b(1000001);
  rep(i,n){
    if(b[a[i]]==0) ans++;
    ll now=1;
    while(now*a[i]<1000001){
      b[now*a[i]]=1;
      now++;
    }
  }
  COUT(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:7: error: 'i' was not declared in this scope
   50 |   rep(i,n) cin>>a[i];
      |       ^
a.cc:50:3: error: 'rep' was not declared in this scope; did you mean 'repR'?
   50 |   rep(i,n) cin>>a[i];
      |   ^~~
      |   repR
Language: C++

#include<iostream>
#include<cmath>
#include<bits/stdc++.h>
#include<string.h>
using namespace std;
typedef long long int ll;
const long long int m=(int)1e6;
int main()
{
    int n;
    cin>>n;
    int a[n];
    int i;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    int freq[m+1]={0};
    for(i=0;i<n;i++)
    {
        freq[a[i]]++;
    }
    int c=0;
    if(freq[1]==1)
        cout<<1;
    else if(freq[1]>1)
        cout<<0;
    else{
    for(i=0;i<n;i++)
    {
        if(freq[a[i]]>1)
            continue;
        int f=0;
        for(j=2;j*j<=a[i];j++)
        {
            if(a[i]%j!=0)
                continue;
            if(freq[j]>0 || freq[a[i]/j]>0)
            {
                f=1;
                break;
            }
        }
        if(f==0)
            c++;
    }
    cout<<c;
    }
    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'j' was not declared in this scope
   34 |         for(j=2;j*j<=a[i];j++)
      |             ^
Language: C

//#include<bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sys/types.h>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include<bitset>
#include<fstream>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef tree<pair<int, int>, null_type, less<pair<int, int>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(x) x.begin(), x.end()
#define rep(a, b, c) for (int a = b; a < c; a++)
#define pb push_back
#define fi first
#define se second
#define INF 1000000000000000000
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
# define M_PI 3.14159265358979323846
const int maxx = 10000002;
const int mod2 = 987654319;
const int maxlog = 20;
const ll mod = 1000000007;
const int mod3 = 998244353;

ll power(ll x, ll y) {
    ll res = 1;
    while (y) {
        if (y & 1) res = (res * x) % mod; 
        y >>= 1;
        x = (x * x) % mod;
    }
    return res;
}


void solve(int test) {
    int N;
    cin >> N;
    vector<int> a(N);
    map<int, int> mp;
    rep(i, 0, N) {
        int x; cin >> x;
        a[i] = x;
        mp[x]++;
    } 
    int ans = 0;
    rep(i, 0, N) {
        int ok = 1;
        for (int j = 2; j * j <= a[i]; j++) {
            if (a[i] % j == 0) {
                int t = a[i] / j;
                if (mp.count(t) || mp.count(j)) {
                    ok = 0;
                    break;
                }
            }
        }
        if (mp[a[i]] > 1 || mp.count(1)) ok = 0;
        ans += ok;
    }
    cout << ans;
}


int main() {
    IOS
    ifstream ifs;
    ofstream ofs;
    ifs.open("input.txt");
    ofs.open("output.txt");
    //make();
    int tt = 1, test = 1;
    //cin >> tt;
    while (tt--) {
        solve(test);
        test++;
    }
}


Compiler output:
main.c:2:10: fatal error: iostream: No such file or directory
    2 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;
const int M = 1000005;

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  frep(i,n){
    cin >> a[i];
	//cout << "OK" << endl;
  }
  vector<int> cnt(M);
  
  for(int x : a){
    if(cnt[x] != 0){
      cnt[x] = 2;
      continue;
    }
    for(int i = x; i < M; i += x){
      cnt[i]++;
    }
  }
  int ans = 0;
  for(int x : a){
    if(cnt[x] == 1){
      ans++;
    }
  }
  
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'i' was not declared in this scope
   13 |   frep(i,n){
      |        ^
a.cc:13:3: error: 'frep' was not declared in this scope; did you mean 'frexp'?
   13 |   frep(i,n){
      |   ^~~~
      |   frexp
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;
const int M = 1000005;

int main(){
  int n;
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
  }
  vector<int> cnt(M);
  
  for(int x : a){
    if(cnt[x] != 0){
      cnt[x] = 2;
      continue;
    }
    for(int i = x; i < M; i += x){
      cnt[i]++;
    }
  }
  for(int x : a){
    if(cnt[x] == 1){
      ans++;
    }
  }
  
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:7: error: 'ans' was not declared in this scope; did you mean 'abs'?
   28 |       ans++;
      |       ^~~
      |       abs
a.cc:32:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;
using P = pair<int, int>; 
using ll = long long;
const int M = 1000005;

int main(){
  int N,ans= 0;
  vector<int> a(N);
  rep(i,N){
    cin >> a[i];
  }
  vector<int> cnt(M);
  
  for(int x : a){
    if(cnt[x] != 0){
      cnt[x] = 2;
      continue;
    }
    for(int i = x; i < M; i += x){
      cnt[i]++;
    }
  }
  for(int x : a){
    if(cnt[i] == 1){
      ans++;
    }
  }
  
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'i' was not declared in this scope
   27 |     if(cnt[i] == 1){
      |            ^