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

#include <bits/stdc++.h>
using namespace std;
int main(){
     const ll MAX_SIZE = 1000005;

    bool num[MAX_SIZE];
    for(int i = 0; i < MAX_SIZE; ++i)
    {
        num[i] = false;
    }

    int n;
    cin >> n;
    vector<ll> a(n);
    for(int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    sort(a.begin(), a.end());

    int ans = 0;
    for(int i = 0; i < n; ++i)
    {
        if(num[a[i]] == true)
        {
            continue;
        }

        // 重複がなければ
        if (!(i < n - 1 && a[i] == a[i + 1]))
        {
            ans++;
        }

        ll prime = 0;
        while(prime += a[i], prime < MAX_SIZE)
        {
            num[prime] = true;
        }
    }
    cout << ans; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: 'll' does not name a type
    4 |      const ll MAX_SIZE = 1000005;
      |            ^~
a.cc:6:14: error: 'MAX_SIZE' was not declared in this scope
    6 |     bool num[MAX_SIZE];
      |              ^~~~~~~~
a.cc:9:9: error: 'num' was not declared in this scope; did you mean 'enum'?
    9 |         num[i] = false;
      |         ^~~
      |         enum
a.cc:14:12: error: 'll' was not declared in this scope
   14 |     vector<ll> a(n);
      |            ^~
a.cc:14:14: error: template argument 1 is invalid
   14 |     vector<ll> a(n);
      |              ^
a.cc:14:14: error: template argument 2 is invalid
a.cc:17:17: error: invalid types 'int[int]' for array subscript
   17 |         cin >> a[i];
      |                 ^
a.cc:19:12: error: request for member 'begin' in 'a', which is of non-class type 'int'
   19 |     sort(a.begin(), a.end());
      |            ^~~~~
a.cc:19:23: error: request for member 'end' in 'a', which is of non-class type 'int'
   19 |     sort(a.begin(), a.end());
      |                       ^~~
a.cc:24:12: error: 'num' was not declared in this scope; did you mean 'enum'?
   24 |         if(num[a[i]] == true)
      |            ^~~
      |            enum
a.cc:24:17: error: invalid types 'int[int]' for array subscript
   24 |         if(num[a[i]] == true)
      |                 ^
a.cc:30:29: error: invalid types 'int[int]' for array subscript
   30 |         if (!(i < n - 1 && a[i] == a[i + 1]))
      |                             ^
a.cc:30:37: error: invalid types 'int[int]' for array subscript
   30 |         if (!(i < n - 1 && a[i] == a[i + 1]))
      |                                     ^
a.cc:35:11: error: expected ';' before 'prime'
   35 |         ll prime = 0;
      |           ^~~~~~
      |           ;
a.cc:36:15: error: 'prime' was not declared in this scope
   36 |         while(prime += a[i], prime < MAX_SIZE)
      |               ^~~~~
a.cc:36:25: error: invalid types 'int[int]' for array subscript
   36 |         while(prime += a[i], prime < MAX_SIZE)
      |                         ^
a.cc:38:13: error: 'num' was not declared in this scope; did you mean 'enum'?
   38 |             num[prime] = true;
      |             ^~~
      |             enum
Language: C++

#include<stdio.h>
int IN(void)
{
  int x=0;short f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
signed main(void)
{
  int N=IN(),a=0,i=0,j,max=0,DP[1000001]={0};
  while(i<N){a=IN();DP[a]++;max=a>max?a:max;i++;}a=0;
  for(i=1;i<=max;i++)
  {
    if(!DP[i])continue;
    else
    {
      if(DP[i]==1){a++;}else{DP[i]=0;}
      for(j=2*i;j<=max;j+=i)DP[j]=0;
    }
  }
  return prinrf("%d\n",a),0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:10: error: 'prinrf' was not declared in this scope; did you mean 'printf'?
   20 |   return prinrf("%d\n",a),0;
      |          ^~~~~~
      |          printf
Language: C++

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

int solve(long long N, std::vector<long long> A)
{

    sort(A.begin(), A.end());
    long long A_N = A[N];
    bool A_check[A_N] = {false};

    for (long long i = 0; i < A_N; i++)
    {
        long long index = 0;
        index = A[i];
        A_check[index] = true;
    }

    for (long long i = 0; A[i] * A[i] <= A_N; i++)
    {
        long long A_index = A[i];
        if (A_check[A_index] == true)
        {
            for (long long j = 2; i * j <= A_N; j++)
            {
                A_check[i * j] = false;
            }
        }
    }

    long long cnt = 0;
    for (x : A_check)
    {
        if (A_check)
            cnt++;
    }

    cout << cnt << endl;

    return 0;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Compiler output:
a.cc: In function 'int solve(long long int, std::vector<long long int>)':
a.cc:32:12: error: found ':' in nested-name-specifier, expected '::'
   32 |     for (x : A_check)
      |            ^
      |            ::
a.cc:32:10: error: 'x' has not been declared
   32 |     for (x : A_check)
      |          ^
a.cc:40:5: error: expected primary-expression before 'return'
   40 |     return 0;
      |     ^~~~~~
a.cc:38:25: error: expected ')' before 'return'
   38 |     cout << cnt << endl;
      |                         ^
      |                         )
   39 | 
   40 |     return 0;
      |     ~~~~~~               
a.cc:32:9: note: to match this '('
   32 |     for (x : A_check)
      |         ^
a.cc:41:1: warning: control reaches end of non-void function [-Wreturn-type]
   41 | }
      | ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

int num[200001];
int n;

int find(int j,int pos){
	int low=0,high=n-1,mid;
  
  	while(low <= high){
      mid =(low + high)/2;
    	if(num[mid] == j && pos!=mid){
        	return 1;
        }
      	else if( num[mid] < j){
        	low = mid+1;
        }
      	else
        {
        	high=mid -1;
        }
    }
  return 0;
}

int div(int n,int pos) 
{  
    for (int i=1; i<=sqrt(n); i++) 
    { 
        if (n%i == 0) 
        { 
              if (n/i == i){
              	  if(find(i,pos)){
                  	return 0;
                  }
              } 
            else { 
                if(find(i,pos) == 1 || find(n/i,pos)  == 1 ) {
                	return 0;
                }
            } 
        } 
    } 
  	return 1;
} 

int main(){

   int ans=0;
  
  cin>>n;
  
  for(int a=0;a<n;a++){
  		cin>>num[a];
  }
  
  sort(num,num +n);
  
  for(int a=0;a<n;a++){
  		ans+=div(num[a],a);
        
  }
           cout<<ans<<endl;
           
}

Compiler output:
a.cc:27:5: error: ambiguating new declaration of 'int div(int, int)'
   27 | int div(int n,int pos)
      |     ^~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: old declaration 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc: In function 'int main()':
a.cc:61:20: error: no match for 'operator+=' (operand types are 'int' and 'div_t')
   61 |                 ans+=div(num[a],a);
      |                 ~~~^~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int num[200001];
int n;

int find(int j,int pos){
	int low=0,high=n-1,mid;
  
  	while(low <= high){
      mid =(low + high)/2;
    	if(num[mid] == j && pos!=mid){
        	return 1;
        }
      	else if( num[mid] < j){
        	low = mid+1;
        }
      	else
        {
        	high=mid -1;
        }
    }
  return 0;
}

int div(int n,int pos) 
{  
    for (int i=1; i<=sqrt(n); i++) 
    { 
        if (n%i == 0) 
        { 
              if (n/i == i){
              	  if(find(i,pos)){
                  	return 0;
                  }
              } 
            else { 
                if(find(i,pos) == 1 || find(n/i,pos)  == 1 ) {
                	return 0;
                }
            } 
        } 
    } 
  	return 1;
} 

int main(){

   int ans=0;
  
  cin>>n;
  
  for(int a=0;a<n;a++){
  		cin>>num[a];
  }
  
  sort(num,num +n);
  
  for(int a;a<n;a++){
  		ans+=div(num[a],a);
        
  }
           cout<<ans<<endl;
           
}

Compiler output:
a.cc:27:5: error: ambiguating new declaration of 'int div(int, int)'
   27 | int div(int n,int pos)
      |     ^~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: old declaration 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc: In function 'int main()':
a.cc:61:20: error: no match for 'operator+=' (operand types are 'int' and 'div_t')
   61 |                 ans+=div(num[a],a);
      |                 ~~~^~~~~~~~~~~~~~~
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 count1,count2;
  count2=0;
  for(int j=0;j<n;j++){
    count1=0;
  	for(int l=0;l<n;l++){
      if(i==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:16:10: error: 'i' was not declared in this scope
   16 |       if(i==j){continue;}
      |          ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define db(x) cout << (x) << '\n';
#define all(x) x.begin(),x.end()
#define UNIQUE(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define LB(v,x) lower_bound(all(v),x)
#define UB(v,x) upper_bound(all(v),x)
#define endl "\n"
#define F first
#define S second
#define PB push_back
#define PF push_front
#define int long long
#define double long double
#define trick int m = (l+r)>>1,lc=n<<1,rc=lc|1

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

int dy[]={0,1,1,1,0,-1,-1,-1};
int dx[]={-1,-1,0,1,1,1,0,-1};
const int maxn = 1e6;
const int OO = 1e18;
const int mod = 1e9 + 7;
const double PI = acos(-1);

void maxself(int &a,int b)
{a=max(a,b);}
void minself(int &a,int b)
{a=min(a,b);}

bool mk[maxn+1];
vi p;
int num[maxn+1];
int cont[maxn+1];
int32_t main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

//	freopen("name.in","r",stdin);
//	freopen("name.out","w",stdout);

    int n;
    cin >> n;
    vi a(n);
    maxn=0;
    for(int i=0;i<n;i++)
        cin >> a[i],maxn=maxself(maxn,a[i]);
   
    for(int i=0;i<n;i++)
    {
        for(int j=a[i];j<=maxn;j+=a[i])
            num[j]++;
    }
    int ans = 0;
    for(int i=0;i<n;i++)
    {
        if(num[a[i]] == 1)
        {
            ans++;
        }
    }
    cout << ans;
    return 0;
}



Compiler output:
a.cc: In function 'int32_t main()':
a.cc:51:9: error: assignment of read-only variable 'maxn'
   51 |     maxn=0;
      |     ~~~~^~
a.cc:53:34: error: binding reference of type 'long long int&' to 'const long long int' discards qualifiers
   53 |         cin >> a[i],maxn=maxself(maxn,a[i]);
      |                                  ^~~~
a.cc:31:19: note:   initializing argument 1 of 'void maxself(long long int&, long long int)'
   31 | void maxself(int &a,int b)
      |                   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define db(x) cout << (x) << '\n';
#define all(x) x.begin(),x.end()
#define UNIQUE(x) sort(all(x)),x.resize(unique(all(x))-x.begin())
#define LB(v,x) lower_bound(all(v),x)
#define UB(v,x) upper_bound(all(v),x)
#define endl "\n"
#define F first
#define S second
#define PB push_back
#define PF push_front
#define int long long
#define double long double
#define trick int m = (l+r)>>1,lc=n<<1,rc=lc|1

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

int dy[]={0,1,1,1,0,-1,-1,-1};
int dx[]={-1,-1,0,1,1,1,0,-1};
const int maxn = 1e6;
const int OO = 1e18;
const int mod = 1e9 + 7;
const double PI = acos(-1);

void maxself(int &a,int b)
{a=max(a,b);}
void minself(int &a,int b)
{a=min(a,b);}

bool mk[maxn+1];
vi p;
int num[maxn+1];
int cont[maxn+1];
int32_t main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

//	freopen("name.in","r",stdin);
//	freopen("name.out","w",stdout);

    int n;
    cin >> n;
    vi a(n);
    for(int i=0;i<n;i++)
        cin >> a[i],cont[a[i]]++;
    UNIQUE(v);
    for(int i=0;i<n;i++)
    {
        for(int j=a[i];j<=maxn;j+=a[i])
            num[j]++;
    }
    int ans = 0;
    for(int i=0;i<n;i++)
    {
        if(num[a[i]] == 1)
        {
            ans += cont[a[i]];
        }
    }
    cout << ans;
    return 0;
}



Compiler output:
a.cc: In function 'int32_t main()':
a.cc:53:12: error: 'v' was not declared in this scope
   53 |     UNIQUE(v);
      |            ^
a.cc:6:16: note: in definition of macro 'all'
    6 | #define all(x) x.begin(),x.end()
      |                ^
a.cc:53:5: note: in expansion of macro 'UNIQUE'
   53 |     UNIQUE(v);
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    int M=1000005;
    int n;
    cin>>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]++;
    }
    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:8:9: error: 'i' was not declared in this scope
    8 |     rep(i,n) cin>>a[i];
      |         ^
a.cc:8:5: error: 'rep' was not declared in this scope
    8 |     rep(i,n) cin>>a[i];
      |     ^~~
Language: C++

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

int c[1000006];
vector<int> V;
set<int> S;
multiset<int> T;

int N, A[200005];

int dp[200005];

int num[1000006];

int main(void) {
	cin >> N;
	int Am = 0;
	for (int i = 1; i <= N; i++) {
		cin >> A[i];
		V.push_back(A[i]);
		S.insert(A[i]);
		T.insert(A[i]);
		Am = max(Am, A[i]);
		num[A[i]]++;
	}

	//sort(V.begin(), V.end());

	

	for(auto y: V){
		if (c[y] >= 1) { c[y] = 2; }
		else if (c[y] >= 0) { c[y]++;
		for (long long int j = y*2; j <= Am; j+=y) {
			c[(int) j] = -1;
		}
		}
	}

	for (int i = 1; i <= N;i++) {
		if (T.count(A[i]) >= 2) { continue; }
		else { if (C[A[i]] == 1) { int x = 1; } }
	}

	int ans = 0;

	for (int i = 1; i <= N; i++) {
		//if (T.count(A[i]) >= 2) { continue; }
		if (c[A[i]] == 1) { ans++; }
	}

	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:28: error: 'C' was not declared in this scope
   46 |                 else { if (C[A[i]] == 1) { int x = 1; } }
      |                            ^
Language: Java


import java.util.*;
import java.io.*;
public class Solution
{
    public static void main(String args[]) throws Exception
    {
        Scanner sc  = new Scanner(System.in);
        int n = sc.nextInt();
        long a[] = new long[n];
        for(int i=0;i<n;i++)
            a[i] = sc.nextInt();
        Arrays.sort(a);
        int count=0;
        int flag=0;
        for(int i=0;i<n;i++)
        {
            flag=0;
            for(int j=0;j<n;j++)
            {
                if(i==j)
                    continue;
                if(a[i]%a[j]==0)
                    flag++;
            }
            if(flag==0)
                count++;
        }
        System.out.println(count);
    }
}


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

#include <algorithm>
#include <iostream>
int n,a[200010];
int m[1000010];
int main(){
	std::cin>>n;
	rep(i,n){
		std::cin>>a[i];
	}
	std::sort(a,a+n);
	int ans=0;
	rep(i,n){
		if(!m[a[i]]){
			if(i==n-1||a[i]!=a[i+1])ans++;
			for(int j=a[i];j<=1000000;j+=a[i]){
				m[j]=true;
			}
		}
	}
	std::cout<<ans<<std::endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'i' was not declared in this scope
    7 |         rep(i,n){
      |             ^
a.cc:7:9: error: 'rep' was not declared in this scope
    7 |         rep(i,n){
      |         ^~~
Language: C

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

#include <iostream>

std::unordered_map<long, int> mp;

int main(void) {
  long n;
  long a[200010] = {0};
  int flg = 0;
  int cnt = 0;
  long b[200010] = {0};

  scanf("%ld", &n);

  for (long i = 0; i < n; i++) {
    scanf("%ld", &a[i]);
  }

  std::sort(a, a + n);

  for (long i = 0; i < n; i++) {
    mp[a[i]]=1;
  //  printf("%ld ", a[i]);
  }

  if(a[0] == a[1]){
    b[0] = 1;
  }

  for (long i = 0; i < n - 1; i++) {
    if(mp[a[i]]==0) continue;
    for(long j=2;;j++){
      if(a[j]*j>a[n-1]) break;
      mp[a[i]*j]=0;
    }
  }

  for(long j = 0; j < n; j++){
    if (mp[a[j]l!=0) {
      cnt++;
    }
  }

  printf("%d", cnt);

  return 0;
}


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

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int bisect_left(int x,int a[],int left,int right){
    int mid;
    right++;
    while (left < right) {
        mid = (left + right) / 2;
        if (a[mid] < x) {
            left = mid + 1;
        } else {
            right = mid;
        }
    }
    return left;
}



int main(void){
    int N;
    scanf("%d", &N);
    int *array = (int *)malloc(N * sizeof(int));
    for (int i = 0; i < N; i++) {
        scanf("%d", &array[i]);
    }
    qsort(array,N,sizeof (int), asc);   
    bool flag[100000+10] = {0};
    for (int i = 0; i < N; i++) {
        int now = 2;
        while(now * array[i] <= array[N-1]){
            flag[now * array[i]] = 1;
            now += 1;
        }
    }
    int ans = 0
    for (int i = 0; i < N; i++) {
        if (!flag[ array[i] ]) {
            if (bisect_left(array[i]+1,array,0,N-1)- bisect_left(array[i],array,0,N-1) == 1) {
                ans++;
            }
        }
    }
    printf("%d\n",ans);
}


Compiler output:
main.c: In function 'main':
main.c:44:5: error: expected ',' or ';' before 'for'
   44 |     for (int i = 0; i < N; i++) {
      |     ^~~
main.c:44:21: error: 'i' undeclared (first use in this function)
   44 |     for (int i = 0; i < N; i++) {
      |                     ^
main.c:44:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:44:31: error: expected ';' before ')' token
   44 |     for (int i = 0; i < N; i++) {
      |                               ^
      |                               ;
main.c:44:31: error: expected statement before ')' token
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const LL mod=998244353;
const LL LINF=1LL<<62;
const int INF=1<<30;
int dx[]={1,0,-1,0,-1,1,1,-1};
int dy[]={0,1,0,-1,-1,-1,1,1};



int main(){
    LL n;cin >> n;
    vector<int> a(n);
    map<int,int> ma;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        ma[a[i]]++;
    }
    vector<bool> p(1000001,0);
    for (int i = 0; i <= 1000000 i++) {
        if(ma[a[i]]){
            for (int j = 2; j * a[i] <= 1000000; j++) {
                p[a[i] * j] = true;
            }
        }
    }
    LL ans = 0;
    for (int i = 0; i < n; i++) {
        if(ma[a[i]] != 1 || p[a[i]]) continue;
        else ans++;
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:33: error: expected ';' before 'i'
   32 |     for (int i = 0; i <= 1000000 i++) {
      |                                 ^~
      |                                 ;
Language: C++

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>

int asc(const void *a, const void *b) {
    return *(int *)a - *(int *)b;
}

int bisect_left(int x,int a[],int left,int right){
    int mid;
    right++;
    while (left < right) {
        mid = (left + right) / 2;
        if (a[mid] < x) {
            left = mid + 1;
        } else {
            right = mid;
        }
    }
    return left;
}



int main(void){
    int N;
    scanf("%d", &N);
    int *array = (int *)malloc(N * sizeof(int));
    for (int i = 0; i < N; i++) {
        scanf("%d", &array[i]);
    }
    qsort(array,N,sizeof (int), asc);   
    bool flag[100000+10] = {0};
    for (int i = 0; i < N; i++) {
        int now = 2;
        while(now * array[i] <= array[N-1]){
            flag[now * array[i]] = 1;
            now += 1;
        }
    }
    int ans = 0
    for (int i = 0; i < N; i++) {
        if (!flag[ array[i] ]) {
            if (bisect_left(array[i]+1,array,0,N-1)- bisect_left(array[i],array,0,N-1) == 1) {
                ans++;
            }
        }
    }
    printf("%d\n",ans);
}


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

#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

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

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> cnt(1000005);
    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++;
    }
    print(ans);

}



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

#include <bits/stdc++.h>
#define rep(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
using ll = long long;
const ll MOD = 1e9+7;
const ll LINF = LLONG_MAX;
const int INF = INT_MAX;
const double PI=acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    ll n; cin>>n;
    vector<ll> a(n);
    rep(i,0,n) cin>>a[i];
    sort(all(a));
    vector<ll> v(100010,0);
    ll ans=0;
    rep(i,0,n-1){
        ll now=a[i];
        if(v[now]==1) continue;
        for(ll j=1; j*now<100010; j++) v[j*now]=1;
        if(now==a[i+1]) continue;
        ans++;
    }
    ll now=a[n-1];
    if(v[now]==1) continue;
    for(ll j=1; j*now<100010; j++) v[j*now]=1;
    ans++;
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:19: error: continue statement not within a loop
   29 |     if(v[now]==1) continue;
      |                   ^~~~~~~~
Language: C++

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

#define INF 2147483647
#define LINF 9223372036854775807
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;
typedef long double ld;

typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,P> PP;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};



int ok[1000010];
int main(){

    bool flag=false;
    ll ans=0,sum=0;

    fill(ok,ok+1000010,0);

    int n;
    cin>>n;
    vector<int> a(n);
    unordered_map<int,int> fq;

    rep(i,n){
        cin>>a[i];
        fq[a[i]]++;
    }

    for(auto p : fq){
        int frq = p.second;
        int num = p.first;

        if(ok[num] == 0){
            if(frq == 1)++ans;

            int i = 2*num;
            while(){
                if(i > 1000000)break;
                ok[i]=-1;
                i += num;
            }
        }
    }

    cout<<ans<<endl;

    //cout <<fixed<<setprecision(16)<< << endl;

    //if(flag)cout << "Yes" <<endl;
    //elsmpe cout << "No" <<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:71:19: error: expected primary-expression before ')' token
   71 |             while(){
      |                   ^
Language: C++

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

#define INF 2147483647
#define LINF 9223372036854775807
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;
typedef long double ld;

typedef pair<int,int> P;
typedef pair<int,P> iP;
typedef pair<P,P> PP;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};



int ok[1000010]={};
int main(){

    bool flag=false;
    ll ans=0,sum=0;

    int n;
    cin>>n;
    vector<int> a(n);
    unordered_map<int,int> fq;

    rep(i,n){
        cin>>a[i];
        fq[a[i]]++;
    }

    for(auto p : fq){
        int frq = p.second;
        int num = p.first;

        if(ok[num] == 0){
            if(frq == 1)++ans;

            int i = 2*num;
            while(){
                if(i > 1000000)break;
                ok[i]=-1;
                i += num;
            }
        }
    }

    cout<<ans<<endl;

    //cout <<fixed<<setprecision(16)<< << endl;

    //if(flag)cout << "Yes" <<endl;
    //elsmpe cout << "No" <<endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:69:19: error: expected primary-expression before ')' token
   69 |             while(){
      |                   ^
Language: C++

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

long long M = 100000*2;

int main(){
    long long n;
    cin >> n;
    vector<long long> a(n);
    for(int i = 0;i < n;i++){
        cin >> a[i];
    }
    /**/

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

    vector<long long> b;

    for(int i = 1;i < n;i++){
        if(a[i] != a[i - 1]){
            b.push_back(a[i - 1]);
        }
    }

    if(a[n - 1] != a[n - 2]){
        b.push_back(a[n - 1]);
    }

    

    /**/
    vector<long long> count(M);

    for(int j = 0;j < b.size();j++){
        for(int i = b[j];i < M;i += b[j]){
            count[i]++;
        }
    }

    int ans = 0;

    for(int i = 0;i < b.size();i++){
        if(count[b[i]] == 1){
            ans++;
        }
    }

    cout << ans << endl;

    
    return 0;
}

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

#include<stdio.h>
#include<stdlib.h>
#include<time.h>

using namespace std;

int main(void) {

	int* A;
	int N;
	srand((unsigned)time(NULL));

	scanf("%d", &N);
	A = (int*)calloc(N, sizeof(int));
	for (int i = 0; i < N; i++) {
		//A[i] = rand() % 1000000 + 1; //test
		scanf("%d", &A[i]); //submit
		
	}
	printf("%p\n",A); //debug

	int num = 0;
	char* flag = (char*)calloc(N,sizeof(char));
	for (int i = 0; i < N; i++)
		flag[i] = 1;
	//printf("%p\n", flag); //debug

	for (int i = 0; i < N; i++) {
		for (int j = 0; j < N; j++) {
			 //printf("%d,%d\n",i,j); //debug
			if ((flag[j]!=0)&&(i != j) && (A[i] % A[j] == 0)) {
				flag[i] = 0;
				if (A[i] == A[j]) {
					flag[i] = -1;//被り
				}
				break;
			}
		}
		if (flag[i]==1)
			num++;
		//printf("%d \n", flag[i]); //debug
	}
	printf("%d\n", num);

	//printf("0"); //debug
	free(A);
	//printf("1"); //debug
	free(flag);
	//printf("2"); //debug
	return 0;
}

Compiler output:
main.c:5:1: error: unknown type name 'using'
    5 | using namespace std;
      | ^~~~~
main.c:5:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'std'
    5 | using namespace std;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REPR(i, n) for(int i = n - 1;i >= 0;i--)
#define FOR(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define ll long long
#define INF 1e9
int main()
{
    int n;
    cin >> n;
    vector<int> vec(n);
    // int n = 5;
    // vector<int> vec{24, 11, 8, 3, 6};
    REP(i, n) cin >> vec.at(i);

    int count = 0;
    sort(ALL(vec));

    int samenumcheaker = 0;
    vector<int> cheaker(1e6 + 5, 0);

    for(int i = 0; i < vec.size(); i++){
        cheaker.at(vec.at(i))++;
    }

    for(int i = 0; i < cheaker.size(); i++){
        if(cheaker.at(i) > 1) samenumcheaker++;
    }

    for(int i = 0; i < vec.size(); i++){
        if(vec.at(i) != -1}
            count++;
            for(int j = i + 1; j < n; j++){
                if(vec.at(j) % vec.at(i) == 0) vec.at(j) = -1;
            }
        }
    }

    cout << count - samenumcheaker << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:33:27: error: expected ')' before '}' token
   33 |         if(vec.at(i) != -1}
      |           ~               ^
      |                           )
a.cc:33:27: error: expected primary-expression before '}' token
a.cc:35:25: error: 'i' was not declared in this scope
   35 |             for(int j = i + 1; j < n; j++){
      |                         ^
a.cc: At global scope:
a.cc:39:5: error: expected declaration before '}' token
   39 |     }
      |     ^
a.cc:41:5: error: 'cout' does not name a type
   41 |     cout << count - samenumcheaker << endl;
      |     ^~~~
a.cc:43:5: error: expected unqualified-id before 'return'
   43 |     return 0;
      |     ^~~~~~
a.cc:44:1: error: expected declaration before '}' token
   44 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <iomanip>
using namespace std;
using P = pair<int,int>;
typedef long long ll;


#define rep(i,n) for (int i=0; i<(n); i++)
//const int INF =1001001001;
const ll BIG = 1e9+7;
const double PI = 3.141592653589793;

const int M = 1000005;

int main(){
    int n;
    cin >> 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]++;
    }
    int ans = 0;
    for(int x: a){
        if(cnt[x]==1) ans++;
    }
    cout << ans << endl;
    return 0;
}

/*

int main(){
    int n;
    cin >> n;
    vector<int> a(n), to(n, 1);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());
    rep(i, n){
        int j = i+1;
        if(to[i]==0) continue;
        for(j; j<n; j++){
            if(to[j]==0) {
                continue;
            }
            if(a[j]==a[i]){
                to[i] = 0;
                to[j] = 0;
            }else if(a[j]>a[i] && a[j]%a[i]==0){
                to[j] = 0;
            }
        }
    }
    cout << accumulate(to.begin(), to.end(), 0) << endl;
    return 0;
}

Compiler output:
a.cc:38:1: error: unterminated comment
   38 | /*
      | ^
Language: C++

// #include <bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<queue>
#define PI 3.14159265358979323846264338327950288
#define rep(i,n) for(int i=0;i<n;i++)
#define exf(x)	 for(auto&& tmp : x) { cout << tmp << endl; }	// 拡張for
#define testP	 cout << "------------------ test ------------------" << endl;	// 動作確認テスト
#define testX(x) cout << "testout : " << x << endl;	// テストアウト
typedef long long ll;
using namespace std;
const int MOD{ int(1e9 + 7) };	// = 1000000007
const int inf{ 2100000000 };	// = 2100000000 (MAX:2147483647)

// ------------------ ベクター表示 ------------------ //
void printVec(vector<int>& vec) {
	cout << "";
	for (auto it = vec.begin(); it != vec.end(); it++) cout << *it << " ";
	cout << endl;
}

// ------------------ ベクター合計 ------------------ //
int sumVec(vector<int> v) {
	int sum = 0;
	for (size_t i = 0; i < v.size(); i++) sum += v[i];
	return sum;
}

// -------------------------------------------------- //
// ------------------ ここから本編 ------------------ //
// -------------------------------------------------- //

const M = 1000005;

int main(void) {

	int N, ans = 0;
	cin >> N;
	vector<int> A(N);
	rep(i, N) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());

	vector<int> ok(M);

	for (int x : A) {
		if (ok[x] != 0) {
			ok[x] = 2;
			continue;
		}
		for (int i = x; i < M; i += x) ok[i]++;
	}

	rep(i, N) {
		ans = (ok[A[i]]==1 ? ans + 1 : ans);
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc:39:7: error: 'M' does not name a type
   39 | const M = 1000005;
      |       ^
a.cc: In function 'int main()':
a.cc:51:24: error: 'M' was not declared in this scope
   51 |         vector<int> ok(M);
      |                        ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
int32_t main()
{
	int n;cin>>n;
	map<int,int>map;
	vector<int>v2(n);
	int t=-1;
	for(int i=0;i<n;i++)
	{
	 cin>>v2[i];
	 map[v2[i]]++;
	 if(v2[i]==1)t=1;;
	}
	if(t==1)
	{
	cout<<"0";
	return;
	}
    sort(v2.begin(),v2.end());
    v2.erase(unique(v2.begin(),v2.end()),v2.end());
	int counter=0;
	for(int i=0;i<v2.size();i++)
	{
	for(int j=0;j<v2.size();j++)
	{
	    if(v2[i]>v2[j])if(v2[i]%v2[j]==0 and i!=j)break;
		if(v2[i]==v2[j] and (i==j and map[v2[i]]==1))counter++;
		if(v2[i]<v2[j])break;
	}
	}
	cout<<counter;
}

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

#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef tuple<ll,ll,ll> tlll;
typedef tuple<int,int,int> tiii;
const ll mod=1e9+7;
const int inf=1<<30;

bool dp[1001010];

int main(){
  int n; cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  sort(all(a));
  set<int> st;
  rep(i,1e6+1) dp[i]=true;
  int ans=0;
  rep(i,n){
    if(dp[a[i]]==false) continue;
    ans++;
    for(int j=a[i];j<=1e6;j+=a[i]){
      dp[j]=false;
    }
  }
  if(a[0]==a[1]) ans^^;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:22: error: expected primary-expression before '^' token
   34 |   if(a[0]==a[1]) ans^^;
      |                      ^
a.cc:34:23: error: expected primary-expression before ';' token
   34 |   if(a[0]==a[1]) ans^^;
      |                       ^
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;

void prvec(vector<bool> vec){
    ll n = vec.size();
    rep(i,n) cout << i << " " << vec.at(i) << "\n";
}

void pr2d(vector<vector<ll>> vvec){
    ll h = vvec.size();
    ll w = vvec.at(0).size();
    rep(i,h){
        rep(j,w){
            cout << vvec.at(i).at(j) << " ";
        }
        cout << "\n";
    }
}

int main(){
    ll n ; cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a.at(i);
    sort(a.begin(),a.end());
    vector<bool> z(1000001,1);
    z[0] = 0;
    rep(i,n){
        ll x = a.at(i);
      　if(!(z.at(x))) continue;
        ll y = x+x;
        if(i!=0){
            if(a.at(i) == a.at(i-1)){
                y=x;
            }
        }
        while(y<=1000000){
            if(z.at(y)) z.at(y) = 0;
            y += x;
        }
    }
    //prvec(z);
    ll ans = 0;
    rep(i,n){
        if(z.at(a.at(i))) ans++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc:36:7: error: extended character 　 is not valid in an identifier
   36 |       　if(!(z.at(x))) continue;
      |       ^
a.cc: In function 'int main()':
a.cc:36:7: error: '\U00003000if' was not declared in this scope
   36 |       　if(!(z.at(x))) continue;
      |       ^~~~
Language: C++

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const ll mod = 1000000007;
const ll INF = 1001001001;
const ll LINF = 1001001001001001001;

void prvec(vector<bool> vec){
    ll n = vec.size();
    rep(i,n) cout << i << " " << vec.at(i) << "\n";
}

void pr2d(vector<vector<ll>> vvec){
    ll h = vvec.size();
    ll w = vvec.at(0).size();
    rep(i,h){
        rep(j,w){
            cout << vvec.at(i).at(j) << " ";
        }
        cout << "\n";
    }
}

int main(){
    ll n ; cin >> n;
    vector<ll> a(n);
    rep(i,n) cin >> a.at(i);
    sort(a.begin(),a.end());
    vector<bool> z(1000001,1);
    z[0] = 0;
    rep(i,n){
        ll x = a.at(i);
      　if(!z.at(x)) continue;
        ll y = x+x;
        if(i!=0){
            if(a.at(i) == a.at(i-1)){
                y=x;
            }
        }
        while(y<=1000000){
            if(z.at(y)) z.at(y) = 0;
            y += x;
        }
    }
    //prvec(z);
    ll ans = 0;
    rep(i,n){
        if(z.at(a.at(i))) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc:36:7: error: extended character 　 is not valid in an identifier
   36 |       　if(!z.at(x)) continue;
      |       ^
a.cc: In function 'int main()':
a.cc:36:7: error: '\U00003000if' was not declared in this scope
   36 |       　if(!z.at(x)) continue;
      |       ^~~~
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main(void) {

  int n, i=0, j, div, cnt=0;
  int e1 = 2*pow(10,5), e2 = pow(10,6);

  scanf("%d\n", &n);
  if ((n<1)||(e1<n)) {
    return -1;
  }

  int a[n], b[n];
  while (i<n) {
    scanf("%d", &a[i]);
    if ((a[i]<1)||(e2<a[i])) {
      return -1;
    }
    i++;
  }

  i = 0;
  while (i<n) {
    b[i] = 0;
    j = i;
    while (j<n-1) {
      j++;
      if ((a[i]%a[j]==0) {
        b[i] = 1;
        break;
      }
      if ((a[j]%a[i]==0) {
        b[j] = 1;
        break;
      }
    }
    if (b[i]==0) {
      cnt += 1;
    }
    i++;
  }

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:31:25: error: expected ')' before '{' token
   31 |       if ((a[i]%a[j]==0) {
      |          ~              ^~
      |                         )
main.c:44:3: error: expected expression before '}' token
   44 |   }
      |   ^
main.c:49:1: error: expected declaration or statement at end of input
   49 | }
      | ^
Language: C

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main(void) {

  int n, i=0, j, div, cnt=0;
  int e1 = 2*pow(10,5), e2 = pow(10,6);

  scanf("%d\n", &n);
  if ((n<1)||(e1<n)) {
    return -1;
  }

  int a[n], b[n];
  while (i<n) {
    scanf("%d", &a[i]);
    if ((a[i]<1)||(e2<a[i])) {
      return -1;
    }
    i++;
  }

  i = 0;
  while (i<n) {
    b[i] = 0;
    j = i;
    while (j<n-1) {
      j++;
      if ((a[i]%a[j]==0) {
        b[i] = 1;
        break;
      } if ((a[j]%a[i]==0) {
        b[j] = 1;
        break;
      }
    }
    if (b[i]==0) {
      cnt += 1;
    }
    i++;
  }

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

  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:31:25: error: expected ')' before '{' token
   31 |       if ((a[i]%a[j]==0) {
      |          ~              ^~
      |                         )
main.c:43:3: error: expected expression before '}' token
   43 |   }
      |   ^
main.c:48:1: error: expected declaration or statement at end of input
   48 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
 int n;  
  cin>>n;
vector<int> data(n);
  for(int i=0;i<n;i++){
     cin >> data.at(i);
  }
  int a=0;
 vector<int> data1(n);
  data1=sort(data.begin(),data.end());
bool b=true;
  for(int i=0;i<n;i++){
        b=false;
    for(int j=0;j<n;j++){
      if(i==j)        continue;
 
      if(data1.at(i)%data1.at(j)==0){     
        b=true;
        break;
    }
    }
     if(b==false) a++;
  }
  cout<<a<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:37: error: no match for 'operator=' (operand types are 'std::vector<int>' and 'void')
   12 |   data1=sort(data.begin(),data.end());
      |                                     ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'void' to 'const std::vector<int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'void' to 'std::vector<int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = int; _Alloc = std::allocator<int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'void' to 'std::initializer_list<int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include<iostream>
using namespace std;
int main(){
int a[1000007];
int b[1000007];
  int n;
  cin>>n;
  int m=0;
  for(int i=0;i<n;i++){
      cin>>a[i];
     if(a[i]>m) z=a[i];
  }
  int f=0;
  for(int i=0;i<n;i++){
int j=a[i];
    for(;j<=m;j+=a[i]){
      b[j]++;
    }
  }
  int cnt=0;
  for(int i=0;i<n;i++){
if(b[a[i]]==1) cnt++;
  }
  cout<<cnt;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'z' was not declared in this scope
   11 |      if(a[i]>m) z=a[i];
      |                 ^
Language: C

#include <stdio.h>
n,i,a[210000],b[1100000],A=0;
#define r for(i=0;i<n;i++)
int main(){
	scanf("%d",&n);r scanf("%d",a+i);r b[a[i]]++;
	r{	int flag=b[a[i]]==1;
		if(a[i]!=1)flag&=b[1]==0;
		for(int d=2;d*d<=a[i];d++)if(a[i]%d==0)flag&=b[d]==0&&b[a[i]/d]==0;
		if(flag)ans++;
	}
	
	printf("%d",ans);
}

Compiler output:
main.c:2:1: warning: data definition has no type or storage class
    2 | n,i,a[210000],b[1100000],A=0;
      | ^
main.c:2:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:2:3: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
    2 | n,i,a[210000],b[1100000],A=0;
      |   ^
main.c:2:5: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
    2 | n,i,a[210000],b[1100000],A=0;
      |     ^
main.c:2:15: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int]
    2 | n,i,a[210000],b[1100000],A=0;
      |               ^
main.c:2:26: error: type defaults to 'int' in declaration of 'A' [-Wimplicit-int]
    2 | n,i,a[210000],b[1100000],A=0;
      |                          ^
main.c: In function 'main':
main.c:9:25: error: 'ans' undeclared (first use in this function)
    9 |                 if(flag)ans++;
      |                         ^~~
main.c:9:25: note: each undeclared identifier is reported only once for each function it appears in