criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main{

	public static final int SIZE = 1000001;

	public static void main(String [] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));

		int n = Integer.parseInt(br.readLine());
		StringTokenizer st = new StringTokenizer(br.readLine());
		int [] a = new int[n];

		for(int i=0;i<n;i++){
			a[i] = Integer.parseInt(st.nextToken());
		}

		Arrays.sort(a);
			
		ArrayList<Pair> ans = new ArrayList<Pair>();
		boolean [] isPrime = new boolean[SIZE];
		for(int i=0;i<n;i++){
			boolean check = true;
			int sqrtn = (int)Math.sqrt(a[i]);		
			for(int j=1;j<=sqrtn && check;j++){
				if(a[i] % j == 0){
					if(isPrime[j]) check = false;
					if(isPrime[a[i] / j]){
						check = false;
						if(!ans.isEmpty() && ans.get(ans.size() - 1).getLeft() == a[i]){
							ans.get(ans.size() - 1).setRight(false); 
						}
					}
				}
			}
			if(check){
				ans.add(new Pair(a[i], true));
			}
			isPrime[a[i]] = true;
		}

		int val = 0;
		for(int i=0;i<ans.size();i++){
			if(ans.get(i).getRight()) val++;
		}
		bw.write(val+"");
		bw.flush();
		bw.close();
		br.close();
	}
}

public class Pair{
	int left;
	boolean right;

	public Pair(int left, boolean right){
		this.left = left;
		this.right = right;
	}

	public void setRight(boolean right){
		this.right = right;
	}

	public int getLeft(){
		return this.left;
	}
	
	public boolean getRight(){
		return this.right;
	}
}

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

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

using namespace std;
typedef long long int ll;
typedef long double ld;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define FOR(i, n, m) for(ll i = (ll)n; i < (ll)(m); i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1LL << 62)

#define PI (acos(-1))
#define PRINT(x) std::cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dx[8] = {0,1,0,-1, 1, -1, 1, -1}, dy[8] = {1,0,-1,0,1,1,-1,-1};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";  
    return os; 
}

template <typename T1, typename T2> 
ostream& operator<<(ostream& os, const map<T1, T2>& m) 
{ 
    for (auto p : m) os << "<" << p.first << ", " << p.second << "> "; 
    return os; 
}

int main()
{ 
  ll N;
  cin >> N;
  
  vector<ll> A(N);
  map<ll, ll> cnt;
  REP(i, N) { 
      cin >> A[i];
      cnt[A[i]]++;
  }
  sort(ALL(A));
  ll ans = 0;
  ll Amax = 1000000;
  vector<bool> dp(Amax+1, true);
  vector<bool> cnts(Amax+1, false)
  REP(i, N) {
    if (cnts[A[i]]) continue;
    cnts[A[i]] = true;
    for(ll j = A[i]*2; j <= Amax; j+=A[i]) {
      dp[j] = false;
    }
  }
  REP(i, N) {
    if (cnt[A[i]] == 1 && dp[A[i]]) ans++;
  }
  PRINT(ans);
  return 0;
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected ',' or ';' before 'for'
    7 | #define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
      |                   ^~~
a.cc:53:3: note: in expansion of macro 'REP'
   53 |   REP(i, N) {
      |   ^~~
a.cc:53:7: error: 'i' was not declared in this scope
   53 |   REP(i, N) {
      |       ^
a.cc:7:35: note: in definition of macro 'REP'
    7 | #define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
      |                                   ^
Language: C++

//time limit exceeded
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Pair{
    public:
    int num;
    bool b;
    Pair(int n,bool inb):num(n),b(inb){}
    bool operator<(Pair& p){
        return this->num<p.num;
    }
    bool operator==(Pair& p){
        return this->num==p.num;
    }    
};


int main(){
    int n;
    cin>>n;
    vector<int> B;
    vector<Pair> A;
    int f=0,i,j;
    for(i=0;i<n;i++){
        int t;
        cin>>t;
        B.push_back(t);
    }
    stable_sort(B.begin(),B.end());

    for(i=0;i<n;i++){
        A.push_back(Pair(B[i],false));
    }
    int s=A.size();
    for(int i=0;i<s;i++){
        for(int j=i+1;j<s;j++){
            if(A[j].num==A[i].num){
                A[i].b=true;
                A.erase(A.begin()+j);
                j--;
                s=A.size();
            }
            else if(A[j].num%A[i].num==0){
                A.erase(A.begin()+j);
                j--;
                s=A.size();
            }
        }
    }
    // for(i=0;i<n;i++){
        
    //     int t=B[i];
    //     bool flag=false;
    //     if(i>0&&t==B[i-1]){
    //         if(f!=0&&t==A[f-1].num){
    //             A[f-1].b=true;
    //         }
    //         continue;
    //     }
        
    //     for(j=0;j<f;j++){
    //         if(A[j].num==t){
    //             A[j].b=true;
    //             break;
    //         }
    //         else if(t%A[j].num==0){
    //             break;
    //         }
           
    //     }
    //     if(j==f&&!flag){
    //         A.push_back(Pair(t,false));
            
    //         f++;   
    //     }
    // }
    
    int cnt=0;
    for(int i=0;i<s;i++){
        if(A[i].b) cnt++;

    cout<<s-cnt<<endl;
}

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

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6+5;
int a[MAXN]= {0};
map<int,int>mm;
int solve(int n) {
    /*
    if(mm[n]>1||mm[1])
        return 0;
    for(int i=2;i*i<=n;++i){
        if(n%i==0){
            mm[n]--;
            if(mm[n/i]||mm[i]){
                mm[n]++;
                return 0;
            }
            mm[n]++;
        }
    }
    return 1;
    */

    int f;
    for(int j=1; j*j<=n; j++) {
        if(n%j==0) {
            mp[n]--;
            if(mp[j]||mp[a[i]/j]) {
                ans++;
                f=1;
            }
            mp[a[i]]++;
            if(f)
                reutrn 0;
        }
    }
    return 1;

}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    for(int i=0; i<n; i++) {
        cin >> a[i];
        mm[a[i]]++;
    }
    int ans = 0;
    for(int i=0; i<n; i++) {
        ans+=solve(a[i]);
    }
    cout <<ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int solve(int)':
a.cc:30:13: error: 'mp' was not declared in this scope; did you mean 'mm'?
   30 |             mp[n]--;
      |             ^~
      |             mm
a.cc:31:28: error: 'i' was not declared in this scope
   31 |             if(mp[j]||mp[a[i]/j]) {
      |                            ^
a.cc:32:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   32 |                 ans++;
      |                 ^~~
      |                 abs
a.cc:35:18: error: 'i' was not declared in this scope
   35 |             mp[a[i]]++;
      |                  ^
a.cc:37:17: error: 'reutrn' was not declared in this scope
   37 |                 reutrn 0;
      |                 ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;
const int MAXN = 1e6+5;
int prime[MAXN]={0};
vector<int>fac[MAXN];
void getprime(){
    for(int i=2;i*i<MAXN;i++){
        if(!prime[i]){
            //fac[i].push_back(i);
            for(int j=i*i;j<MAXN;j+=i)
            {
                prime[j]=1;
                fac[j].push_back(i);
            }
        }
    }
    for(int i=2;i<MAXN;i++){
        if(!prime[i])
            fac[i].push_back(i);
    }

}
int a[MAXN]={0};
map<int,int>mm;
int solve(int n){
    if(mm[n]>1)
        return 0;
    vector<int>vv;
    vv.push_back(1);
    for(auto pr:fac[n]){
        vector<int>cc;
        int p1=pr;
        while(n%pr==0){
            cc.push_back(pr);
            pr*=p1;
        }
        int sz = vv.size();
        for(int i=0;i<sz;i++){
            for(auto p:cc){
                vv.push_back(vv[i]*p);
            }
        }
    }
    for(auto ele:vv){
        //cout <<ele <<" ";
        if(ele!=n&&mm[ele]){
            return 0;
        }
    }
    return 1;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    getprime();
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];
        mm[a[i]]++;
    }
    sort(a,a+n,greater<int>());
    int ans = 0;
    for(int i=0;i<n;i++){
        ans+=solve(a[i]);
    }
    cout <<ans << endl;
    return 0;
}


Compiler output:
a.cc:8:1: error: 'vector' does not name a type
    8 | vector<int>fac[MAXN];
      | ^~~~~~
a.cc: In function 'void getprime()':
a.cc:16:17: error: 'fac' was not declared in this scope
   16 |                 fac[j].push_back(i);
      |                 ^~~
a.cc:22:13: error: 'fac' was not declared in this scope
   22 |             fac[i].push_back(i);
      |             ^~~
a.cc: In function 'int solve(int)':
a.cc:31:5: error: 'vector' was not declared in this scope
   31 |     vector<int>vv;
      |     ^~~~~~
a.cc:5:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    4 | #include <map>
  +++ |+#include <vector>
    5 | using namespace std;
a.cc:31:12: error: expected primary-expression before 'int'
   31 |     vector<int>vv;
      |            ^~~
a.cc:32:5: error: 'vv' was not declared in this scope
   32 |     vv.push_back(1);
      |     ^~
a.cc:33:17: error: 'fac' was not declared in this scope
   33 |     for(auto pr:fac[n]){
      |                 ^~~
a.cc:34:16: error: expected primary-expression before 'int'
   34 |         vector<int>cc;
      |                ^~~
a.cc:37:13: error: 'cc' was not declared in this scope
   37 |             cc.push_back(pr);
      |             ^~
a.cc:42:24: error: 'cc' was not declared in this scope
   42 |             for(auto p:cc){
      |                        ^~
Language: C++

// In god we trust
 
#include <bits/stdc++.h>
#include <chrono>
#include <algorithm>
#include <signal.h>
#include <thread>
 
#define pb push_back
#define fi first
#define se second
#define Vi vector<int>
#define Vb vector<bool>
#define Pi pair<int, int>
#define MP make_pair
#define MT make_tuple
#define Q queue
#define Qi Q<int>
#define INF 1000000000 
#define LINF 1000000000000000000
#define int long long
using namespace std;
using namespace std::chrono;

const int max_ = 1000010;
bool dp[max_];
bool dbl[max_];
bool vistied[max_];

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

  int n;
  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 - 1; i++)
    if (a[i] == a[i + 1])
      dbl[a[i]] = true;

  for (int i = 1; i < max_; i++)
    if (dbl[i])
      dp[i] = true;
  
  for (int i = 0; i < n; i++){
    if (dbl[a[i]] and visited[a[i]])
      continue;
    visited[a[i]] = true;
    int j = a[i];
    while (j + a[i] < max_)
      j += a[i], dp[j] = true;
  }
  
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if (!dp[a[i]])
      cnt++;

  cout << cnt << "\n";
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:23: error: 'visited' was not declared in this scope; did you mean 'vistied'?
   52 |     if (dbl[a[i]] and visited[a[i]])
      |                       ^~~~~~~
      |                       vistied
a.cc:54:5: error: 'visited' was not declared in this scope; did you mean 'vistied'?
   54 |     visited[a[i]] = true;
      |     ^~~~~~~
      |     vistied
Language: C++

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;
using namespace chrono;
 
typedef long long ll;
typedef long double ld;

typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;

//#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define loop(x,n) for(int x = 0; x < n; ++x)
#define FORd(i,a,b) for (int i = (b)-1; i >= (a); i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a, x) for (auto& a : x)

#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound

#define sz(x) (int)x.size()
#define beg(x) x.begin()
#define en(x) x.end()
#define all(x) beg(x), en(x)
#define resz resize

const int MOD = 1000000007; // 998244353
const ll INF = 1e18;
const int MX = 100001;

string get_str() {
    string temp;
    cin >> temp;
    return temp;
}
int get_int() {
    int temp;
    cin >> temp;
    return temp;
}

void solve() {



}

int n, a[200000], b[200000], ans; 

int main() {
    
    cin >> n;
    vector<int> interest;
    loop(i, n) {
        cin >> a[i];
    }

    sort(a, a+n);

    vector<bool> dp(a[n-1], true);

    loop(i, n) {
        if (!dp[a[i]]) continue;

        if (i > 0 && a[i] == a[i-1]) {
            f[a[i]] = false;
            ans--;
            continue;
        }

        ans++;

        for(int j=a[i]*2; j < a[n-1]; j++) {
            f[j] = false;
        }
    }

    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:83:13: error: 'f' was not declared in this scope
   83 |             f[a[i]] = false;
      |             ^
a.cc:91:13: error: 'f' was not declared in this scope
   91 |             f[j] = false;
      |             ^
Language: C++

int N;
	scanf_s("%d", &N);
	int* A = new int[N];
	int count = 0;
	for (int i = 0; i < N; i++) {
		scanf_s("%d",&A[i]);
	}
	int same = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			if (A[i] != 0 && A[j] != 0 && A[i] == A[j]) same++;
			if (i != j&& A[i] != 0 && A[i]!=A[j] && A[j]!=0) {
				if (A[i] % A[j] == 0) // 나눠져
					A[i] = 0;
			}
		}
	}
	for (int i = 0; i < N; i++) {
		if (A[i] != 0) count++;
	}
	same = same / N;
	count -= same;
	printf("%d", count);
	
	delete A;

Compiler output:
a.cc:2:16: error: expected constructor, destructor, or type conversion before '(' token
    2 |         scanf_s("%d", &N);
      |                ^
a.cc:5:9: error: expected unqualified-id before 'for'
    5 |         for (int i = 0; i < N; i++) {
      |         ^~~
a.cc:5:25: error: 'i' does not name a type
    5 |         for (int i = 0; i < N; i++) {
      |                         ^
a.cc:5:32: error: 'i' does not name a type
    5 |         for (int i = 0; i < N; i++) {
      |                                ^
a.cc:9:9: error: expected unqualified-id before 'for'
    9 |         for (int i = 0; i < N; i++) {
      |         ^~~
a.cc:9:25: error: 'i' does not name a type
    9 |         for (int i = 0; i < N; i++) {
      |                         ^
a.cc:9:32: error: 'i' does not name a type
    9 |         for (int i = 0; i < N; i++) {
      |                                ^
a.cc:18:9: error: expected unqualified-id before 'for'
   18 |         for (int i = 0; i < N; i++) {
      |         ^~~
a.cc:18:25: error: 'i' does not name a type
   18 |         for (int i = 0; i < N; i++) {
      |                         ^
a.cc:18:32: error: 'i' does not name a type
   18 |         for (int i = 0; i < N; i++) {
      |                                ^
a.cc:21:9: error: 'same' does not name a type
   21 |         same = same / N;
      |         ^~~~
a.cc:22:9: error: 'count' does not name a type
   22 |         count -= same;
      |         ^~~~~
a.cc:23:15: error: expected constructor, destructor, or type conversion before '(' token
   23 |         printf("%d", count);
      |               ^
a.cc:25:9: error: expected unqualified-id before 'delete'
   25 |         delete A;
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef		 long long int     ll;
typedef		vector<ll>      vll;
#define     fi              first
#define     se              second
#define		pb              push_back
#define		nn              "\n"
#define		all(p)          p.begin(),p.end()
#define		zz(v)           (ll)v.size()
#define 	S(a)            scanf("%lld",&a)
#define 	SS(a,b)         scanf("%lld %lld",&a,&b)
#define 	SSS(a,b,c)      scanf("%lld %lld %lld",&a,&b,&c)
#define		ss              ' '
#define     pii             pair<ll,ll>
#define		gcd(a,b)        __gcd(a,b)
#define		lcm(a,b)        (a*b)/gcd(a,b)
const double eps = 1e-8;




int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0)
    ll n,m;
    cin>>m;
    ll ar[m+1];
    map<ll,ll>mp;
    for(ll i=0; i<m; i++)
    {
        cin>>ar[i];
        mp[ar[i]]++;
    }
    ll mn=1e18,ans=0;
    for(ll i=1; i<1e6+7; i++)
    {
        if(mp[i]==0)
            continue;
        else
            ans++;
        for(ll j=i+i; j<1e6+7; j+=i)
        {
            mp[j]=0;
        }
    }
    cout<<ans<<nn;



}


/* Final check before submit :

1. array size or integer overflow.

2. Think twice,code once.check all possible counter test case.

3. Be careful about corner case! n=1?k=1? something about 0?

4. avoid stupid mistake!complexity(t/m)?precision error?submit same code twice?

5. if got WA than remember that you are missing something common.
   *** Be confident!!! who knows? may be your one step back to AC ***

*/



Compiler output:
a.cc: In function 'int main()':
a.cc:26:15: error: expected ';' before 'll'
   26 |     cin.tie(0)
      |               ^
      |               ;
   27 |     ll n,m;
      |     ~~         
a.cc:28:10: error: 'm' was not declared in this scope; did you mean 'tm'?
   28 |     cin>>m;
      |          ^
      |          tm
a.cc:33:14: error: 'ar' was not declared in this scope
   33 |         cin>>ar[i];
      |              ^~
Language: Java

import java.util.*;
import java.lang.*;
import java.io.*;

public class Main{
    public static void main(String[] args) throws IOException{
        FastReader sc = new FastReader();
        int n = sc.nextInt();
        int[] nums = new int[n];
        for (int i = 0; i < n; i++){
            nums[i] = sc.nextInt();
        }
        Arrays.sort(nums);
        boolean good = true;
        int ans = 0;
        for (int i = 0; i < n; i++){
            for (int j = i-1; j >= 0; j--){
                if (nums[i] % nums[j]) good = false;
            }
            if (good) ans++;
        }

            
    }
}
class FastReader{ 
    BufferedReader br; 
    StringTokenizer st; 
    public FastReader() { 
        br = new BufferedReader(new InputStreamReader(System.in)); 
    } 
    String next(){ 
        while (st == null || !st.hasMoreElements()) { 
            try{ 
                st = new StringTokenizer(br.readLine()); 
            }catch (IOException  e){ 
                e.printStackTrace(); 
            } 
        } 
        return st.nextToken(); 
    } 
    int nextInt(){ 
        return Integer.parseInt(next()); 
    } 
    long nextLong(){ 
        return Long.parseLong(next()); 
    } 
    double nextDouble(){ 
      return Double.parseDouble(next()); 
    } 
    String nextLine(){ 
        String str = ""; 
        try{ 
            str = br.readLine(); 
        } 
        catch (IOException e){ 
            e.printStackTrace(); 
        } 
        return str; 
    } 
}


Compiler output:
Main.java:18: error: incompatible types: int cannot be converted to boolean
                if (nums[i] % nums[j]) good = false;
                            ^
1 error
Language: C

#include<bits/stdc++.h>
using namespace std;
bool b[1000001];
int main(){
long long int n;
  cin>>n;
  long long int a[n];
  for(long long int i =0;i<n;i++)cin>>a[i];
  sort(a,a+n);
  for(long long int i =0;i<n;i++){
    long long int u =a[i];
    if(b[u]==false){
    while(u<=a[n-1]){
     u+=u;
     b[u]=true;
    }
  }
  }
  long long int count = 0;
  for(long long int i =0;i<n;i++){
    if(b[i]==false)count++;
  }
  cout<<count<<endl;
}

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

b#include<bits/stdc++.h>
using namespace std;
bool b[1000001];
int main(){
long long int n;
  cin>>n;
  long long int a[n];
  for(long long int i =0;i<n;i++)cin>>a[i];
  sort(a,a+n);
  for(long long int i =0;i<n;i++){
    long long int u =a[i];
    if(b[u]==False){
    while(u<=a[n-1]){
     u+=u;
     b[u]=True;
    }
  }
  }
  long long int count = 0;
  for(long long int i =0;i<n;i++){
    if(b[i]==False)count++;
  }
  cout<<count<<endl;
}

Compiler output:
main.c:1:2: error: stray '#' in program
    1 | b#include<bits/stdc++.h>
      |  ^
main.c:1:1: error: unknown type name 'b'
    1 | b#include<bits/stdc++.h>
      | ^
main.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | b#include<bits/stdc++.h>
      |          ^
main.c:3:1: error: unknown type name 'bool'
    3 | bool b[1000001];
      | ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
  +++ |+#include <stdbool.h>
    1 | b#include<bits/stdc++.h>
main.c: In function 'main':
main.c:6:3: error: 'cin' undeclared (first use in this function)
    6 |   cin>>n;
      |   ^~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: implicit declaration of function 'sort' [-Wimplicit-function-declaration]
    9 |   sort(a,a+n);
      |   ^~~~
main.c:12:14: error: 'False' undeclared (first use in this function)
   12 |     if(b[u]==False){
      |              ^~~~~
main.c:15:11: error: 'True' undeclared (first use in this function)
   15 |      b[u]=True;
      |           ^~~~
main.c:23:3: error: 'cout' undeclared (first use in this function); did you mean 'count'?
   23 |   cout<<count<<endl;
      |   ^~~~
      |   count
main.c:23:16: error: 'endl' undeclared (first use in this function)
   23 |   cout<<count<<endl;
      |                ^~~~
Language: C

b#include<bits/stdc++.h>
using namespace std;
bool b[1000001];
int main(){
long long int n;
  cin>>n;
  long long int a[n];
  for(long long int i =0;i<n;i++)cin>>a[i];
  sort(a,a+n);
  for(long long int i =0;i<n;i++){
    long long int u =a[i];
    if(b[u]==false){
    while(u<=a[n-1]){
     u+=u;
     b[u]=true;
    }
  }
  }
  long long int count = 0;
  for(long long int i =0;i<n;i++){
    if(b[i]==false)count++;
  }
  cout<<count<<endl;
}

Compiler output:
main.c:1:2: error: stray '#' in program
    1 | b#include<bits/stdc++.h>
      |  ^
main.c:1:1: error: unknown type name 'b'
    1 | b#include<bits/stdc++.h>
      | ^
main.c:1:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | b#include<bits/stdc++.h>
      |          ^
main.c:3:1: error: unknown type name 'bool'
    3 | bool b[1000001];
      | ^~~~
main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
  +++ |+#include <stdbool.h>
    1 | b#include<bits/stdc++.h>
main.c: In function 'main':
main.c:6:3: error: 'cin' undeclared (first use in this function)
    6 |   cin>>n;
      |   ^~~
main.c:6:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:3: error: implicit declaration of function 'sort' [-Wimplicit-function-declaration]
    9 |   sort(a,a+n);
      |   ^~~~
main.c:12:14: error: 'false' undeclared (first use in this function)
   12 |     if(b[u]==false){
      |              ^~~~~
main.c:12:14: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:15:11: error: 'true' undeclared (first use in this function)
   15 |      b[u]=true;
      |           ^~~~
main.c:15:11: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:23:3: error: 'cout' undeclared (first use in this function); did you mean 'count'?
   23 |   cout<<count<<endl;
      |   ^~~~
      |   count
main.c:23:16: error: 'endl' undeclared (first use in this function)
   23 |   cout<<count<<endl;
      |                ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e5 + 10;

int a[MAXN];
int b[MAXN];


int main() {
    int n;
    cin >> n;
    
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if (a[i] <= 1000) {
            b[a[i]]++;
        }
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        bool f = true;
        for (int j = 1; j <= 1000; j++) {
            if (b[j] == 1 && a[i] % j == 0) {
                if (a[i] == j && b[j] == 1) {
                    f = true;
                    continue;
                }
                f = false;
                break;
            }
        }
        if (f) {
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}
#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2e5 + 10;

int a[MAXN];
int b[MAXN];


int main() {
    int n;
    cin >> n;
    
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if (a[i] <= 1000) {
            b[a[i]]++;
        }
    }
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        bool f = true;
        for (int j = 1; j <= 1000; j++) {
            if (b[j] == 1 && a[i] % j == 0) {
                if (a[i] == j && b[j] == 1) {
                    f = true;
                    continue;
                }
                f = false;
                break;
            }
        }
        if (f) {
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Compiler output:
a.cc:45:11: error: redefinition of 'const int MAXN'
   45 | const int MAXN = 2e5 + 10;
      |           ^~~~
a.cc:5:11: note: 'const int MAXN' previously defined here
    5 | const int MAXN = 2e5 + 10;
      |           ^~~~
a.cc:47:5: error: redefinition of 'int a [200010]'
   47 | int a[MAXN];
      |     ^
a.cc:7:5: note: 'int a [200010]' previously declared here
    7 | int a[MAXN];
      |     ^
a.cc:48:5: error: redefinition of 'int b [200010]'
   48 | int b[MAXN];
      |     ^
a.cc:8:5: note: 'int b [200010]' previously declared here
    8 | int b[MAXN];
      |     ^
a.cc:51:5: error: redefinition of 'int main()'
   51 | int main() {
      |     ^~~~
a.cc:11:5: note: 'int main()' previously defined here
   11 | int main() {
      |     ^~~~
Language: C

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

int b[1000001];
int ans;
int main () {
	int n;
	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++) {
		if(b[a[i]]==0) {
			if (a[i]!=a[i-1]&&a[i]!=a[i+1]) {
				ans++;
			}
			for(int j=a[i];j<1000001;j+=a[i]) {
				b[j]=1;
			}
		}
	}
	cout << ans;
}

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

import java.util.*;
import java.io.*;
public class ABC170D{
	static int[] a;
	static ArrayList<Integer> x = new ArrayList<Integer>();
   public static void main(String[] main) throws Exception{
      BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
      StringTokenizer st = new StringTokenizer(br.readLine());
      PrintWriter out = new PrintWriter(System.out);
      int n = Integer.parseInt(st.nextToken());
      st = new StringTokenizer(br.readLine());
      a = new int[n];
      for(int i = 0; i < n; i++)
          a[i] = Integer.parseInt(st.nextToken());
      sieve();
      out.println(x.size());
      out.close();
   }
   static void sieve() {
	   boolean[] dp = new boolean[1000001];
	   for(int i = 0; i < dp.length; i++)
		   dp[i] = true;
	   for(int i = 0; i < a.length; i++) {
		   if(dp[a[i]] && a[i] <= 1000) {
			   for(int j = a[i]*2; j < 1000001; j += a[i]) {
				   dp[j] = false;
			   }
		   }
	   }
	   HashSet<Integer> elements = new HashSet<Integer>();
	   HashSet<Integer> dup = new HashSet<Integer>();
	   for(int i = 0; i < a.length; i++) {
		   if(elements.contains(a[i]))
			   dup.add(a[i]);
		   elements.add(a[i]);
	   }
	   for(int i = 0; i < a.length; i++)
		   if(dp[a[i]] && !dup.contains(a[i]))
			   x.add(a[i]);
   }
}

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

#include <cstdio>
#include <algorithm>
using namespace std;
bool b[1000001];
int main(){
	int n;
	scanf("%d", &n);
	int a[n + 1], ans = 0;
	for (int i = 0; i < n; i++) scanf("%d", &a[i]);
	a[n] = 2147483647
	sort(a, a + n);
	for (int i = 0; i < n; i++){
		if (i != 0 && a[i] == a[i - 1] && a[i] != a[i + 1]) ans--;
		if (b[a[i]]) continue;
		ans++;
		for (int j = a[i]; j <= 1000000; j += a[i]) b[j] = true;
	}
	printf("%d\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:26: error: expected ';' before 'sort'
   10 |         a[n] = 2147483647
      |                          ^
      |                          ;
   11 |         sort(a, a + n);
      |         ~~~~
Language: C++

// 171

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <queue>
#include <iomanip>
#include <climits>
#include <string>
#include <cmath>

using namespace std;
using ll = long long;


int main(){
    ll n, count=0;
    cin >> n;
    vector<ll> a(n);
    for(ll i=0; i<n; i++){
        cin >> a.at(i);
    }
    sort(a.begin(), a.end());
    vector<ll> v(a.back()+1, 0);
    for(ll n: a){
        if(v.at(n) != 0){
            v.at(n) = 2;
            continue;
        }
        for(ll j=1; n*j<n=; j++){
            v.at(n*j)++;
        }
    }
    for(ll buf: a){
        if(v.at(buf) == 1) count++;
    }
    cout << count << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:27: error: expected primary-expression before ';' token
   32 |         for(ll j=1; n*j<n=; j++){
      |                           ^
Language: C++

#include <iostream>
using namespace std;
int main() {
  int divisors[1000010];
  memeset(divisors,0,sizeof(divisors));
  int n; cin >> n;
  int arr[n],cnt=0; for (int i=0; i<n; i++) cin >> arr[i];
  sort(arr,arr+n);
  for (int i=0; i<n; i++) {
    for (int j = 2*arr[i]; j<=1000000; j+=arr[i]) {
      divisors[j]++;
    }
  }
  for (int i=0; i<n; i++) if (!divisors[arr[i]]) cnt ++;
  cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'memeset' was not declared in this scope; did you mean 'wmemset'?
    5 |   memeset(divisors,0,sizeof(divisors));
      |   ^~~~~~~
      |   wmemset
a.cc:8:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |   sort(arr,arr+n);
      |   ^~~~
      |   short
Language: Java

import java.util.Scanner;

public class NotDivisible {
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scn = new Scanner(System.in);
		int N = scn.nextInt();
		int[] arr = new int[N];
		for (int i = 0; i < N; i++) {
			arr[i] = scn.nextInt();
		}
		quickSort(arr, 0, N - 1);
		int ans = 1;
		if (N >= 2) {
			if (arr[0] == arr[1]) {
				ans--;
			}
		}
		for (int i = N - 1; i >= 0; i--) {
			int a = arr[i];
			boolean check = true;
			for (int j = 0; j <= i; j++) {
				int b = arr[j];
				if (j != i && (a % b) == 0) {
					check = false;
					break;
				}
			}
			if (i != 0 && check) {
				ans++;
			}
		}
		System.out.println(ans);
	}

	public static void quickSort(int[] arr, int lo, int hi) {
		if (lo >= hi) {
			return;
		}
		int mid = (lo + hi) / 2;
		int pivot = arr[mid];
		int left = lo;
		int right = hi;
		while (left <= right) {
			while (arr[left] < pivot) {
				left++;
			}
			while (arr[right] > pivot) {
				right--;
			}
			if (left <= right) {
				int temp = arr[left];
				arr[left] = arr[right];
				arr[right] = temp;
				left++;
				right--;
			}
		}
		quickSort(arr, lo, right);
		quickSort(arr, left, hi);
	}
}

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

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

#define ll          long long
#define uint        unsigned int 
#define ld          long double
#define SAM         ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define FOR(i,a,b)  for(int i=a;i<b;++i)
#define RFOR(i,a,b) for(int i=a;i>b;--i)
#define mod         1000000007
#define mxn         200005
#define pb          push_back
#define pii         pair<int,int>
#define f           first
#define s           second
#define sz(x)       (int)x.size()
#define all(x)      x.begin(),x.end()

using namespace std;

int main()
{
    SAM;
    int n;
    cin>>n;
    int arr[n];
    FOR(i,0,n)
    {
    	cin>>arr[i];
    }
    sort(arr,arr+n);
    bool a;

    int count=0;
    FOR(i,0,n)
    {
        a=true;
        FOR(j,0,n)
        {
            if(i==j)
                continue;
            if(arr[i]%arr[j]==0)
            {
                a=false;
                break;
            }
        }
        if(a==true)
            count++;
    }
    cout<<count;
   
    
    return 0;
}




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

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
    cin>>a[i];
  }


  vector<int> v(n,0);

  sort(a.begin(),a.end());
  int i=0;
  int x=n;
  rep(i,n){
    if (v[i]==1)continue;
    for (int j=i+1;j<n;j++){
      if (v[j]==1)continue;

      if (a[j]==a[i]){
        v[i]=1;
      //  cout<<i<<"i"<<endl;
        int now=j;
      //  cout<<j<<"j"<<endl;
        while(a[now]==a[i]){
          v[now]=1;
          now++;
        }
        }
      else if (a[j]%a[i]==0){
        v[j]=1;
  //      cout<<j<<"j"<<endl;
      }
    }
  }

  int ans=0;
  rep(i,n){
    if (v[i]==0)ans++;
  }
cout<<ans;
}


Compiler output:
a.cc:4:19: error: declaration does not declare anything [-fpermissive]
    4 | typedef long long int;
      |                   ^~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  sort(a.begin(),a.end());
  vector<int> used(1000001);
  int ans=0;
  for(int i=0;i<n;i++){
    if(used[a[i]]<=1) {
  	  for(int j=1;j*a[i]<=1000000;j++) used[j*a[i]]++;
    }
  }
  for(int j=1;j<=1000000;j++) ans+=used[i]!=0;
  cout<<ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:41: error: 'i' was not declared in this scope
   20 |   for(int j=1;j<=1000000;j++) ans+=used[i]!=0;
      |                                         ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> v;
    while(n--) {
        int t = 0;
        cin >> t;
        v.push_back(t);
    }
    int count = 0;
    for(const auto& i : v) {
        bool b = true;
        for(const auto& j : v) {
            if(i & j == 0) {
                b = false;
            })
        }
        if(b) {
            count++;
        }
    }
    cout << count << '\n';
    return 0;
}

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

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

int main()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(a, a + n);
    int b[a[n - 1] + 1];
    for(int i=0)
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: expected ';' before ')' token
   19 |     for(int i=0)
      |                ^
      |                ;
a.cc:19:16: error: expected primary-expression before ')' token
a.cc:19:16: error: expected ';' before ')' token
   19 |     for(int i=0)
      |                ^
      |                ;
Language: C++

//#include <stdio.h>
#include<iostream>
#include<math.h>
using namespace std;
#define PI 3.14159265359;

class Hoge{
  public:
					long int i0;
					int i1,N0;
					string s0;
					int* iarray0;
					Hoge(int);
					void func0();
					void array0();
	void printarray0();
	~Hoge();
  private:
	
	void inputarray(int*,int);
	void inputarray2(int*,int*,int);
	void printarray(int*,int);
	void count0();
					};


Hoge::Hoge(int itemp){
	
	i0=itemp;
	//cout<<"i0="<<i0<<endl;
	
									}

void Hoge::func0(){
	//cout<<"N0?"<<endl;
	cin>>N0;
	iarray0=new int[N0];
	int N1=3;int N2=2;
	//int* iarray1=new int[N1];
	//int* iarray2=new int[N1];
	inputarray(iarray0,N0);
	//printarray(iarray0,N0);
	sort(iarray0,iarray0+N0,greater<int>());		//sort
	//printarray(iarray0,N0);
	
	count0();
	
	//
	//
	//inputarray2(iarray1,iarray2,N1);
	
	//delete [] iarray1;
	//delete [] iarray2;
	
								}

void Hoge::count0(){
	int icount=0;
	//printarray(iarray0,N0);
	for(int i0=0;i0<N0-1;i0++){
		for(int i1=i0+1;i1<N0;i1++){
		//	cout<<"i0:"<<i0<<"="<<iarray0[i0]<<",";
		//	cout<<"i1:"<<i1<<"="<<iarray0[i1]<<endl;
			if(iarray0[i0]==iarray0[i1]){
			while(iarray0[i0]==iarray0[i1]){
				
				iarray0[i1]=0;
					i1++;
				if(i1>N0){break;}}
				iarray0[i0]=0;
														}
			else if(iarray0[i0]==0){}
			else if(iarray0[i1]==0){}
			else if(iarray0[i0]%iarray0[i1]==0){
				iarray0[i0]=0 ;
			}
			
		}
	//	printarray(iarray0,N0);
	}
		for(int i0=0;i0<N0;i0++){
			if(iarray0[i0]==0){icount++;}
	}
	
	cout<<(N0-icount)<<endl;
}
void Hoge::array0(){

	cout<<"N0?";
	cin>>N0;
	
	
	for (int i0=0;i0<N0;i0++){
		cout<<"i0="<<i0<<endl;
		cin>>iarray0[i0];
			
	}
}

void Hoge::inputarray(int* itemp,int itempn){
	
	int* iarray=itemp;
	int n0=itempn;
	for (int i0=0;i0<n0;i0++){
		//cout<<"i0="<<i0<<endl;
		cin>>iarray[i0];
	}
}
void Hoge::inputarray2(int* itemp,int* itemp2,int itempn){
	
	int* iarray=itemp;
	int* iarray2=itemp2;
	int n0=itempn;
	
	for (int i0=0;i0<n0;i0++){
		cout<<"i0="<<i0<<endl;
		cin>>iarray[i0];
		cin>>iarray2[i0];
	}
}

void Hoge::printarray(int* itemp,int itempn){
	
	int* iarray=itemp;
	int n0=itempn;
	for (int i0=0;i0<n0;i0++){
		cout<<"iarray["<<i0<<"]="<<iarray[i0]<<endl;
		
	}
	cout<<"--------------"<<endl;
}
	
	void Hoge::printarray0(){
							 
							 for (int i0=0;i0<N0;i0++){
			cout<<"iarray0["<<i0<<"]="<<iarray0[i0]<<endl;
			
							 
							 }
	
	
}
Hoge::~Hoge(){
	
	delete [] iarray0;
							}
int main(){
				int N;
				//cin>>N;
	Hoge* hoge=new Hoge(N);
	hoge->func0();
	
	/*
	int i0,i1;
	i0=0;
	i1=4;
	i1=i1/i0;
	cout<<i1<<endl;
	*/
	//hoge->array0();
	//hoge->printarray0();
	return 0;
	delete hoge;
}//end of main

Compiler output:
a.cc: In member function 'void Hoge::func0()':
a.cc:43:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   43 |         sort(iarray0,iarray0+N0,greater<int>());                //sort
      |         ^~~~
      |         sqrt
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<int>a(n);
  vector<int>v(1000001,0)
    for(int i=0;i<n;i++)
    {
      cin>>a[i];
      for(int j=a[i];j<=1000000;j+=a[i])
      {
        v[j]++;
      }
    }
  int count=0;
  for(int i=0;i<n;i++)
    if(v[a[i]]==1)
      count++;
  cout<<count;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<int>a(n);
  vector<int>v(1000001,0)
    for(int i=0;i<n;i++)
    {
      cin>>a[i];
      for(int j=a[i];j<=1000000;j+=a[i])
      {
        v[a[i]]++;
      }
    }
  int count=0;
  for(int i=0;i<n;i++)
    if(v[a[i]]==1)
      count++;
  cout<<count;
}

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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<int>a(n);
  vector<int>v(1000001,0)
    for(int i=0;i<n;i++)
    {
      cin>>a[i];
      for(int j=a[i];j<=1000000;j+=a[i])
      {
        v[a[i]]++;
      }
    }
  int count=0;
  for(int i=0;i<n;i++)
    if(v[a[i]]==1)
      count++;
  cout<<count;

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: expected ',' or ';' before 'for'
    9 |     for(int i=0;i<n;i++)
      |     ^~~
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int i=0;i<n;i++)
      |                 ^
a.cc:21:15: error: expected '}' at end of input
   21 |   cout<<count;
      |               ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: Java

public class Main {
	public static void main(String[] args) {
		var sc = new java.util.Scanner(System.in);
		var n = sc.nextInt();
		var a = new Integer[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		Arrays.sort(a,Collections.reverseOrder());

		var cal = new Boolean[a[0]+1];
		for(int i=0;i<cal.length;i++) {
			cal[i]=false;
		}
		var work = -1;
		for(int i=0;i<a.length;i++) {
			if(work==a[i]) {
				cal[a[i]]=false;
			}else {
				cal[a[i]]=true;
				for(int k=a[i]*2;k<cal.length;k+=a[i]) {
					cal[k]=false;
				}
			}
			work=a[i];
		}
		System.out.println(Arrays.stream(cal).filter(v->v).count());
	}
}

Compiler output:
Main.java:9: error: cannot find symbol
		Arrays.sort(a,Collections.reverseOrder());
		^
  symbol:   variable Arrays
  location: class Main
Main.java:9: error: cannot find symbol
		Arrays.sort(a,Collections.reverseOrder());
		              ^
  symbol:   variable Collections
  location: class Main
Main.java:27: error: cannot find symbol
		System.out.println(Arrays.stream(cal).filter(v->v).count());
		                   ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<math.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rep1(i,n) for(int i = 1; i < (n); i++)

const int M = 1000005;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'i' was not declared in this scope
   19 |         if(c[i]>0){
      |              ^
Language: C++

#include<bits/stdc++.h>
// #include<ext/pb_ds/assoc_container.hpp>
// #include<ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
using namespace std;
#define int                 long long
#define FF(i,a,b)           for(int i=a;i<b;i++)
#define BF(i,a,b)           for(int i=a;i>=b;i--)
#define vi                  vector<int>
#define MAP                 map<int,int>
#define pb                  push_back
#define MP                  make_pair
#define F                   first
#define S                   second
#define pi                  pair<int,int>
#define all(v)              v.begin(),v.end()
#define PIE                 3.1415926535897932384626433832795
#define FastIO              ios::sync_with_stdio(0); cin.tie(0);cout.tie(0)
//#define ordered_set         tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
/*

    order_of_key (k) : Number of items strictly smaller than k .
    find_by_order(k) : K-th element in a set (counting from zero).

*/
/**************************************************************************************/
                       /*Global Variables*/
const int mod = 1e9+7;
const int N = 1e6+10;
const int inf = 3e18;
vi fact[N];
/**************************************************************************************/
template <typename A>istream& operator>>(istream& input,vector<A>& x) {for(auto& i:x)input>>i;return input;}
template<typename A>ostream& operator<<(ostream& output,vector<A>& x) {for(auto& i:x)output<<i<<' ';return output;}
int add(int a, int b){return (a%mod + b%mod + mod)%mod;}
int sub(int a, int b){return (a%mod - b%mod + mod)%mod;}
int mul(int a, int b){return ((a%mod)*(b%mod) + mod)%mod;}
signed main()
{
    FastIO;
    int T=1;
    //cin>>T;
    for(int i=1;i<N;i++)
    {
        for(int j=i;j<N;j+=i)
        {
            fact[j].pb(i);
        }
    }
    while(T--)
    {
        int n;
        cin>>n;
        vi a(n);
        cin>>a;
        MAP mp;
        for(auto it:a)mp[it]++;
        int ans=0;
        for(int i=0;i<n;i++)
        {
            bool ok=false;
            int val=a[i];
            if(mp[val]>1)continue;
            for(auto it:fact[val])if(mp[it])ok=true,break;
            if(!ok)ans++;
        }
        cout<<ans<<"\n";
    }

}
/*
|| Do what you can with all you have,wherever you are. ||

|| Knowing is not enough, we must apply. Wishing is not enough, we must do. ||

|| A goal is a dream with deadline. ||

|| Whether you think you can or you think you can't, you're right. ||

|| A year from now you may wish you had started today ||
*/



Compiler output:
a.cc: In function 'int main()':
a.cc:64:53: error: expected primary-expression before 'break'
   64 |             for(auto it:fact[val])if(mp[it])ok=true,break;
      |                                                     ^~~~~
Language: C

#include <iostream>
#include <vector>

int main()
{
	int N;
	std::cin >> N;
	std::vector<int> A(N, 0);
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}

	std::vector<int> all_num(1000005, 0);	// この中が0なら存在せず、2以上なら割り切れる数がいる
	for (int value : A) {
		// その数の倍数を塗りつぶす
		if( all_num[value] !=0 )
		{
			all_num[value]++;	// かぶってるものを1以外にする
			continue;	// もうその数の倍数は割り切られている
		}

		for(int i=1; /* true */; i++)
		{
			int tmp=value*i;
			if(tmp>=1000001)
			{
				break;
			}
			all_num[tmp]++;
		}
	}

	int cnt=0;
	for (int value : A) {
		if(all_num[value] == 1)
		{
			cnt++;
			// printf("%d(%d)\n", value, all_num[value]);
		}
	}

	std::cout << cnt << '\n';

	return 0;
}


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