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

#include <bits/stdc++.h>

using namespace std;
vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  for(int64_t i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<long long> v;
  unondered_map<long long, long long> mp;
  for(int i = 0;i < n;++i) {
    int x;
    cin >> x;
    v.push_back(x);
    mp[x]++;
  }
  unondered_map<long long, long long> mp2;
  long long ans = 0;
  for(int iii = 0;iii < n;++iii) {
	long long value = v[iii];
    
    mp[value]--;
    int ok = 1;
      for(int64_t i = 1; i * i <= value; i++) {
      if(value % i == 0) {
        if(mp[i] > 0 || mp2[i] > 0) {
ok = 0;
          break;
        }
        if(i * i != value){
        long long vv = value / i;
          if(mp[vv] > 0 || mp2[vv] > 0) {
 ok = 0;
            break;
          }
        }
      }
    }
    if(ok==1) ++ans;
    
    mp2[value]++;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:3: error: 'unondered_map' was not declared in this scope
   21 |   unondered_map<long long, long long> mp;
      |   ^~~~~~~~~~~~~
a.cc:21:17: error: expected primary-expression before 'long'
   21 |   unondered_map<long long, long long> mp;
      |                 ^~~~
a.cc:26:5: error: 'mp' was not declared in this scope
   26 |     mp[x]++;
      |     ^~
a.cc:28:17: error: expected primary-expression before 'long'
   28 |   unondered_map<long long, long long> mp2;
      |                 ^~~~
a.cc:33:5: error: 'mp' was not declared in this scope
   33 |     mp[value]--;
      |     ^~
a.cc:37:25: error: 'mp2' was not declared in this scope
   37 |         if(mp[i] > 0 || mp2[i] > 0) {
      |                         ^~~
a.cc:43:28: error: 'mp2' was not declared in this scope
   43 |           if(mp[vv] > 0 || mp2[vv] > 0) {
      |                            ^~~
a.cc:52:5: error: 'mp2' was not declared in this scope
   52 |     mp2[value]++;
      |     ^~~
Language: C

#include <stdio.h>

int main(void)
{
	int N
  	int data[N];
  	int i = 0;
	int j = 0;
  	int count;
  count = N + 1;
	scanf("%d",&N);	/* 入力部分 */
   for(i = 0;i < N;i++){
	scanf("%d",&data[i]);
  	}

  	for(i = 0;i < N;i++){
		for(j = 0;i < N;j++){
        if(data[i] % data[j] == 0) count--;
        }
	
	}
  printf("%d"&,count);
  
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:14: error: expected ';' before 'int'
    5 |         int N
      |              ^
      |              ;
    6 |         int data[N];
      |         ~~~   
main.c:6:18: error: 'N' undeclared (first use in this function)
    6 |         int data[N];
      |                  ^
main.c:6:18: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:15: error: expected expression before ',' token
   22 |   printf("%d"&,count);
      |               ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int) n; i++)
using ll = long long;
template <class T>
using vt = vector<T>;
using vvi = vector<vt<int>>;

int main(){

  int n;
  cin >> n;
  vt<int> a(n),c(n);
  rep(i,n)  cin >> a[i];

  int cnt = 0;
  rep(i, n-1){
    for(int j = i+1; j < n; j++){
      if(c[j] == 1 || a[i]%a[j] == 0){
        cnt++;
        if(a[i] == a[j])
          c[j] = 1;
        break;
      }
  }

  cout << n - cnt << endl;
  return 0;
}


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

import java.util.*;
import java.util.stream.Collectors;

public class MainD {
    public static void main(String[] args) {
        final var scanner = new Scanner(System.in);
        final var n = scanner.nextLine();
        final var A = Arrays.stream(scanner.nextLine().split(" ")).map(Integer::parseInt).collect(Collectors.toList());
        final var A_set = new HashSet(A);

        final var counter = new HashMap<Integer, Integer>();
        for (var a : A) {
            counter.merge(a, 1, Integer::sum);
        }

        var count = 0;
        for (var a : A) {
            if (counter.get(a) > 1) {
                count += 1;
                continue;
            }

            var i = 1;
            while (i * i <= a) {
                if (a % i == 0) {
                    if (A_set.contains(i) && i != a) {
                        count += 1;
                        break;
                    }
                    if (i != (a / i)) {
                        if (A_set.contains(a / i) && (a / i) != a) {
                            count += 1;
                            break;
                        }
                    }
                }
                i += 1;
            }
        }
        System.out.println(A.size() - count);
    }
}


Compiler output:
Main.java:4: error: class MainD is public, should be declared in a file named MainD.java
public class MainD {
       ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

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

bool isPrime(int n) 
{ 
    // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
  
    // This is checked so that we can skip 
    // middle five numbers in below loop 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
  
    for (int i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
  
    return true; 
} 

int main(){
    int n; cin>>n; int a[n]; int one=0; std::vector<int>diff; int last=0;
    for(int i=0; i<n; i++){cin>>a[i]; if(a[i]==1)one++;}
    sort(a, a+n); int counter=0; last=a[0]; diff.push_back(a[0]);
    for(int i=1; i<n; i++){
        if(a[i]>last)diff.push_back(a[i]);
        last=a[i];
    }
    if(one==1)cout<<1<<endl;
    else if(one>1)cout<<counter<<endl;
    else{
        for(int i=0; i<n; i++){
            if(i>0 && a[i]==a[i-1])continue;
            else if(i<n-1 && a[i]==a[i+1])continue;
            else if(isPrime(a[i]))counter++;
            else{bool test=false; int j=0;
                while(diff[j]*2<=a[i]){
                    if(a[i]%diff[j]==0){test=true; break;}
                    j++;
                }
                if(test==false)counter++;
            }
        }//cout<<endl;
        cout<<counter<<endl;
    }

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

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


// vectorからindex番目の要素を削除する
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
int main()
{
    int n, a;
    vector<int>A;
    cin >> n; 
    bool chofuku = false;
    bool ok = true;
    for (int i = 0; i < n; i++) {
        chofuku = false;
        ok = true;
        scanf_s("%d", &a);
        for (int j = 0; j < A.size(); j++) {
            if (A[j] == a) {
                remove(A, j);
                j--;
                chofuku = true;
            }
            else if (A[j] > a) {
                if (A[j] % a == 0) {
                    remove(A, j);
                    j--;
                }
            }
            else {
                if (a % A[j] == 0) {
                    ok = false;
                    break;
                }
            }
        }
        if (chofuku == false && ok==true) {
            A.emplace_back(a);
        }
        
    }
   
    cout << A.size() << endl;
 ////   sort(A.begin(), A.end());
 //   //auto itrr = A.begin();
 //   int i = 0;
 //   //while (itrr != A.end()) {//
 //   while(i<A.size()){
 //       chofuku = false;
 //       //for (auto itr = ++itrr; itr != A.end(); itr++) {
 //       //    int youso = *itrr;
 //       //    if (youso == (*itr)) {
 //       //        chofuku = true;
 //       //        A.erase(itr);
 //       //    }
 //       //    else if ((*itr) % youso == 0) {
 //       //        A.erase(itr);
 //       //    }
 //       //    
 //       //}
 //       for (int j = 0; j < A.size(); j++) {
 //           if (i != j) {
 //               int youso = A[i];
 //               if (youso == A[j]) {
 //                   chofuku = true;
 //                   remove(A, j);
 //                   if(i>j)i--;
 //                   j--;
 //               }
 //               else if (A[j] % youso == 0) {
 //                   remove(A, j);
 //                   if(i>j)i--;
 //                   j--;
 //               }
 //           }
 //       }

 //       if (chofuku) {
 //           //A.erase(itrr);
 //           remove(A, i);
 //       }
 //       else {
 //           i++;
 //       }

   // }
  //  cout << A.size() << endl;
    
}




Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   23 |         scanf_s("%d", &a);
      |         ^~~~~~~
      |         scanf
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll mod = 1e9 + 7;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  sort(a.begin(), a.end());

  if (a[0] == a[n-1]) {
    cout << 0 << endl;
    return 0;
  }

  int cnt = 1, ans = 1;
  vector<int> b(1e5);
  b[0] = a[0];

  for (int i = 1; i < n; i++) {
    bool s = false;
    rep(j,cnt) {
      if (a[i] % b[j] == 0) {
        s = true;
        break;
      }
    }
    if (!s) {
      ans++;
      b[cut] = a[i];
      cnt++;
    }
  }

  cout << ans << endl;


  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: 'cut' was not declared in this scope; did you mean 'cnt'?
   36 |       b[cut] = a[i];
      |         ^~~
      |         cnt
Language: C

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

using namespace std;

#define MAX_N 200000

int A[MAX_N + 1];

int main( int argc, char **argv )
{
    int N;
    cin >> N;

    for ( int i = 0; i < N; i++ ) cin >> A[i];

    vector<int> B;

    for ( int i = 0; i < N; i++ )
    {
        auto a = A[i];
        auto divisible = false;

        for ( auto b : B )
        {
            if ( !( a % b ) )
            {
                divisible = true;
                break;
            }
        }

        if ( !divisible ) B.push_back( a );
    }

    auto ans = B.size();
    for ( auto b : B )
    {
        auto i = binary_search( A, A + N, b );
        if ( i < N && A[i] == b ) { ans--; }
    }

    cout << ans << endl;

    return 0;
}


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

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

int main() {
    vector<int> v;
    int n, tmp, ans = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> tmp;
        v.push_back(tmp);
    }
    sort(v.begin(), v.end());
    if (v[0] == 1) {
        if (v[0] != v[1]) {
            cout << 1 << endl;
        }
        else {
            cout << 0 << endl;
        }
        return 0;
    }
    for (int i = 0; i < (int)v.size(); i++) {
        if (i == 0) {
            if (v[i] != v[i + 1]) ans++;
        } 
        else if (i != n-1 && v[i] != v[i + 1]) {
            ans++;
            for (int j = 0; j < i; j++) {
                if (v[i] % v[j] == 0) {
                    ans--;
                    erase(v[i]);
                    break;
                }
                if (v[i] / 2 <= v[j]) break;
            }
        }
        if (i == n-1) {
            ans++;
            for (int j = 0; j < i; j++) {
                if (v[i] % v[j] == 0) {
                    ans--;
                    break;
                }
                if (v[i] / 2 <= v[j]) break;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:21: error: 'erase' was not declared in this scope
   33 |                     erase(v[i]);
      |                     ^~~~~
Language: Java

import java.util.Scanner;
import java.util.HashSet;

class Main{
      public static void main(String args[]){
	Scanner sc = new Scanner(System.in);
	HashSet<Integer> a = new HashSet<>();
	HashSet<Integer> doubleList = new HashSet<>();
	int n = sc.nextInt();
	int maxValue = 0;
	for(int i=0;i<n;i++){
	    boolean addable = true;
	    int x = sc.nextInt();
	    if(maxValue<x){
		maxValue = x;
	    }
	    if(x==1&&a.contains(1)){
		a.remove(1);
		doubleList.add(1);
	    }
	    if(a.contains(1)||doubleList.contains(1)){
		continue;
	    }
	    if(x==0){
		for(int i=0;i<maxValue;i++){
		    if(a.contains(i)){
			a.remove(i);
		    }
		}
		continue;
	    }
	    //xがリストにあったらdoubleListに登録
	    if((a.contains(x)||doubleList.contains(x))){
		doubleList.add(x);
		addable = false;
		a.remove(x);
		continue;
	    }
	    for(int j=2;j<x;j++){
		//因数がリストにあったら追加しない
		if(x%j==0){
		    if(a.contains(j)){
			addable = false;
			break;
		    }
		}
	    }
	    //因数がListになければListに追加
	    if(addable){
		a.add(x);
	    }
	    //xを因数とする数値の削除
	    for(int j=2;x*j<=maxValue;j++){
		if(a.contains(j*x)){
		    a.remove(j*x);
		    if(doubleList.contains(j*x)){
			doubleList.remove(j*x);
		    }
		}
	    }
	}
	System.out.println(a.size());
	sc.close();
      }
}


Compiler output:
Main.java:25: error: variable i is already defined in method main(String[])
		for(int i=0;i<maxValue;i++){
		        ^
1 error
Language: C++

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

long long A[200000];
long long N; 

int main()
{
    int cnt;
    long long a;
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    cnt = 0;
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(A[i] % A[j] == 0){
                break;
            }else if(i<N-1){
                continue;
            }
            cnt++; 
        }
    }
    cout << cnt;
    return 0;

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: expected '}' at end of input
   32 |     return 0;
      |              ^
a.cc:13:1: note: to match this '{'
   13 | {
      | ^
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 c=0;
  for(int i=0;i<n;i++){
    int c_c=0;
    for(int j=0;j<n&&c_c=!0;j++){
      if(j==i)	continue;
      else if(a.at(i)%a.at(j)==0)	c_c++;
    }
    if(c_c==0)	c++;
  }
  cout << c;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:20: error: lvalue required as left operand of assignment
   13 |     for(int j=0;j<n&&c_c=!0;j++){
      |                 ~~~^~~~~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n){
    cin >> a.at(i);
  }
  if (n==1){
    cout << "0" << endl;
    return 0;
  }
  sort(a.begin(),a.end());
  int count = 0;
  rep(i,n){
    if(i==0){
      if(a.at(0)%a.at(1) == 0){
	continue;
      }else{
	count++;
	continue;
      }
    }
    int flag = 0;
    for(int j= 0;j < i;j++){
      if(a.at(j)*a.at(j) > a.at(i){
	  break;
	}
      if(a.at(i)%a.at(j) == 0){
	flag=1;
	break;
      }
    }
    if(flag==0){
      count++;
    }

  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:35: error: expected ')' before '{' token
   29 |       if(a.at(j)*a.at(j) > a.at(i){
      |         ~                         ^
      |                                   )
a.cc:36:5: error: expected primary-expression before '}' token
   36 |     }
      |     ^
Language: C++

#include <iostream>
#include <queue>
#include <list>
#include <vector>

using namespace std;

#define MIN(x, y) x<y?x:y
#define MAX(x, y) x<y?y:x
#define ABS(x, y) x<y?(y-x):(x-y)

#define MAX_VAL 256

typedef long long Long;

int main()
{

	int n, a;

	vector<int> vec_a;

	int i, j;
	int ans = 0;

	cin>>n;

	for(i=0 ; i<n ; i++){
		cin>>a;
		vec_a.push_back(a);
	}

	sort(vec_a.begin(), vec_a.end(), greater<int>());

	for(i=0 ; i<n ; i++) {
		for(j=i+1; j<n ; j++){
			// cout<<j<<": "<<vec_a[i]<<" "<<vec_a[j]<<endl;
			if(vec_a[i]%vec_a[j]==0) {
				j=n+1;
			}
		}
		if(j==n) {
			ans++; 
		}
	}

	cout<<ans<<endl;

	return 0;
}


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

/* Author : Alokit Kumar */
#include<bits/stdc++.h>
using namespace std;
#define int long long
int32_t main()
{
  int t,n,i,j,k,x,y,l,l1,s=0;k=1;a
  int a[200001];a[0]=1;a[1]=1;
  for(i=2;i<=200000;i++)
   a[i]=i;
  for(i=2;i<=200000;i++)
  {
    if(a[i]!=i)
     continue;
    for(j=2*i;j<=200000;j+=i)
    {
      if(a[j]==j)
       a[j]=i;
    }
  }
  cin>>n;
  map<int,int> m;
  for(i=1;i<=n;i++)
  {
    cin>>k;
    m[k]++;
  }
  if(m.count(1)){
    if(m[1]==1)
     cout<<"1";
    else
     cout<<"0";
  }
 else{ bool hi;
  for(auto it=m.begin();it!=m.end();it++)
  { hi=true;
    j=(it->second);
    if(j>1)
     continue;
    l=(it->first);x=l;
    if(a[l]==l)
    { s++;continue;}
    j=a[l];
    for(k=j;k*k<=l;k++)
    {
      if(l%k==0){l1=x;
      if(m.count(k))
      {
        hi=false;
        break;
      }
      while(l1%k==0)
      {
        l1=l1/k;l=l/k;
        if(m.count(l1))
         {
           hi=false;
           break;
         }
      }
      if(!hi) break;
     
      
      }
    }
    if(hi){
    if(m.count(l))
      {
        hi=false;
      }
    }
      if(hi)
       {s++;}
    
  }
  cout<<s;
 }
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:7:34: error: 'a' was not declared in this scope
    7 |   int t,n,i,j,k,x,y,l,l1,s=0;k=1;a
      |                                  ^
Language: C++

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

vector<bool> m;
vector<ll> a;
ll n;
//数列の任意の他の数で割り切れない要素の数を求める
void isOk(){
  rep(i,n) m.at(i) = true;
  //割る数
  rep(i,n){
    //割られる数
    for(ll j=n-1;j>=0;--j){
      if( j == i || !m.at(j) ) continue;
      if( a.at(i) > a.at(j) ) break;
      if( a.at(j)%a.at(i) == 0 ){
        m.at(j) = false;
      }
    }
  }
}

int main(){
  cin >> n;
  //入力
  map<ll,bool> b; //重複した数字を記憶
  ll cnt = 0;
  rep(i,n){
    ll num;
    scanf("%lld",&num);
    
      a.emplace_back(num);
      ++cnt;
    
  }a
  n = cnt;
  m.resize(n);
  sort(a.begin(),a.end());
  //計算
  isOk();
  ll ans = 0;
  rep(i,n){
    if( m.at(i) ) ++ans;
  }
  ans -= b.size();
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:5: error: expected ';' before 'n'
   38 |   }a
      |     ^
      |     ;
   39 |   n = cnt;
      |   ~
Language: Java

import java.util.*;

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

		// 整数の入力
		int a = sc.nextInt();//整数の数
		int cnt = 0;
		
		List<Integer> list = new ArrayList<>();
		
		for (int i = 0; i < a; i++) {
			list.add(sc.nextInt());
		}
		Collections.sort(list);
		
		for (int i = 0; i < a; i++) {
			flag = false;
			int b = list.get(i);
			for (int j = 0; j < a; j++) {
				if (j == i) {
					continue;
				}
				int c = list.get(j);
				if (b < c) {
					break;
				}
				if (b % c == 0) {
					cnt++;
					break;
				}
			}
		}
		System.out.println(cnt);
	}
}

Compiler output:
Main.java:20: error: cannot find symbol
			flag = false;
			^
  symbol:   variable flag
  location: class Main
1 error
Language: C++

ﾃｿﾁｼﾘﾏﾉﾂﾆﾏｽﾝｲﾆﾗ ﾓｿﾈﾄ 

Compiler output:
a.cc:1:1: error: '\U0000ff83\U0000ff7f\U0000ff81\U0000ff7c\U0000ff98\U0000ff8f\U0000ff89\U0000ff82\U0000ff86\U0000ff8f\U0000ff7d\U0000ff9d\U0000ff72\U0000ff86\U0000ff97' does not name a type
    1 | ﾃｿﾁｼﾘﾏﾉﾂﾆﾏｽﾝｲﾆﾗ ﾓｿﾈﾄ
      | ^~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll MOD = 1000000007;
const ll INF = 1061109567;
const double EPS = 1e-10;
int main(){
    ll n;
    cin>>n;
    vector<ll> a(n);
    ll count=0;
    ll buf;
    bool flag1=true;
    for(ll i=0;i<n;i++){
        cin>>buf;
        a[i]=buf;
    }
    sort(a.begin(), a.end());
    a.push_back(MOD);
    for(ll i=0;i<n;i++){
        flag1=true;
        if(a[i]==a[i+1]){
            continue;
        }
        for(int j=0;j<=i;j++){
            if((a[i]%a[j]==0||a[i]==a[j])&&i!=j){
                flag1=false;
                break;
            }
            if(a[j]>a[i]/2)){
                break;
            }
        }
        if(flag1){
            count++;
        }

    }
    cout<<count<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:28: error: expected primary-expression before ')' token
   30 |             if(a[j]>a[i]/2)){
      |                            ^
Language: C++

#include<iostrean>
using namespace std;
int main()
{
  long long int n,i,j,k=0,m;
  cin>>n;
  vector<long long int> ar;
  for(i=0; i<n; i++)
  {
    cin>>m;
    ar.push_back(m);

  }
  for(i=0; i<n-1; i++)
  {
    for(j=i+1; j<=n-1; j++)
    {
      if(ar[i]%ar[j]!=0)
        k++;
    }
  }
  cout<<k;
}

Compiler output:
a.cc:1:9: fatal error: iostrean: No such file or directory
    1 | #include<iostrean>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <set>
#include <bitset>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define rep(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define rrep(i,a,b) for(ll i=a-1;i>=(ll)(b);i--)

#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める

#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)

#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素

#define popcount __builtin_popcount
#define LIST(a) memset(a, 0, sizeof(a))


int main(void){
    ll n, ans = 0;
    cin >> n;
    ll a[n + 2];
    rep(i, 0, n){
        cin >> a[i];
    }
    sort(a, a+n);
    a[n] = 0;
    a[n + 1] = 0;
    rep(i, 0, n-1){
        if(a[i] == 0) continue;
        ll wa = a[i];
        for(ll j = i+1; j < n; j += 3){
            // j
            if(a[j] > 0){
                if(wa == a[j]){
                    a[i] = 0;
                    a[j] = 0;
                } else if(a[j] % wa == 0){
                    a[j] = 0;
                }
            }
            // j + 1
            if(a[j + 1] > 0){
                if(wa == a[j + 1]){
                    a[i] = 0;
                    a[j + 1] = 0;
                } else if(a[j + 1] % wa == 0){
                    a[j + 1] = 0;
                }
            }
            // j + 2
            if(a[j + 2] > 0){
                if(wa == a[j + 2]){
                    a[i] = 0;
                    a[j + 2] = 0;
                } else if(a[j + 2] % wa == 0){
                    a[j + 2] = 0;
                }
            }
    }
    rep(i, 0, n){
        if(a[i] != 0) ans += 1;
    }
    cout << ans << endl;
    return 0;
}


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

import java.util.*;

public class Main{
    public static void main(String[] args){

        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        List<Integer> A = new ArrayList<>();

        for(int loop=0; loop<N; loop++) {
            int scan = scanner.nextInt();

            boolean exist = false;
            for(int temp : A) {
                if(temp%scan==0) {
                    A.removeAll( temp );
                    break;
                }else if(scan%temp==0) {
                    exist = true;
                    break;
                }
            }
            if(!exist) {
                A.add(scan);
            }
        }

        int count=0;

        for(int loop : A) {
            for(int innerLoop : A) {
                if( innerLoop == loop ){
                    continue;
                }
                if( loop % innerLoop == 0 ) {
                    count++;
                    break;
                }
            }
        }

        System.out.println( N - count );
    }
}

Compiler output:
Main.java:16: error: incompatible types: int cannot be converted to Collection<?>
                    A.removeAll( temp );
                                 ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

int main(){
    int n;
    int count =0;//割り切れ"た"数
    cin >> n;
    
    int a[n];
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    
    sort(a, a+sizeof(a)/sizeof(a[0]));
    
    for(int i=0;i<n;i++){
      if(
        for(int j=0;j<n;j++){
          
           // if(j>100)break;
            if(a[i]%a[j]==0){
                if(i!=j){
                    count++;
                    break;
                }
            }
        }
    }
    cout << n-count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:9: error: expected primary-expression before 'for'
   41 |         for(int j=0;j<n;j++){
      |         ^~~
a.cc:40:10: error: expected ')' before 'for'
   40 |       if(
      |         ~^
      |          )
   41 |         for(int j=0;j<n;j++){
      |         ~~~
a.cc:41:21: error: 'j' was not declared in this scope
   41 |         for(int j=0;j<n;j++){
      |                     ^
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
int dsc(const void *a, const void *b) {
  return *(int *)b - *(int *)a;
}
int main(){
    int n,i,j,ans,same[200020]={},a[200020]={},div[200020]={};
    scanf("%d",&n);
    for(i=0; i<n; i++){
        scanf("%d",&a[i]);
    }
    ans=n;
    j=0;
    qsort(a,n,sizeof(int),dsc);
    for(i=0; i<n-1; i++){
        if(a[i]==a[i+1])same[j]++;
        if(same[j]==1)same[j]++;
        if(a[i]!=a[i+1])j++;
    }
    for(i=0; i<n; i++){
        if(a[i]==a[i+1]){
            div[i+1]=div[i];
            continue
        }
        for(j=n-1; j>=i; j--){
            if(j==i)continue;
            if(a[i]<2*a[j])break;
            if(a[i]%a[j]==0){
                div[i]++;
                break;
            }
        }
    }
    for(i=0; i<n; i++){
        ans-=div[i]+same[i];
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:26:21: error: expected ';' before '}' token
   26 |             continue
      |                     ^
      |                     ;
   27 |         }
      |         ~
Language: C

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

int a[200010];

int main()
{
	int scanCheck = 0;
	int n;
	int cnt = 0, flag = 0;

	scanCheck = scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanCheck = scanf("%d", &a[i]);
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
				if (a[i] % a[j] == 0) {
					if (i != j) {
						flag = 1;
						break;
					}
				}
			}
		}
		if (flag == 0) {
			cnt++;
		}
		flag = 0;
	}
	printf("%d", cnt);
	return (0);
}

Compiler output:
main.c:31:16: error: expected declaration specifiers or '...' before string constant
   31 |         printf("%d", cnt);
      |                ^~~~
main.c:31:22: error: unknown type name 'cnt'; did you mean 'int'?
   31 |         printf("%d", cnt);
      |                      ^~~
      |                      int
main.c:32:9: error: expected identifier or '(' before 'return'
   32 |         return (0);
      |         ^~~~~~
main.c:33:1: error: expected identifier or '(' before '}' token
   33 | }
      | ^
Language: C++

#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

bool isPrime(int n, int i = 2)
{
    // Base cases
    if (n <= 2)
        return (n == 2) ? true : false;
    if (n % i == 0)
        return false;
    if (i * i > n)
        return true;

    // Check for next divisor
    return isPrime(n, i + 1);
}

int main(void)
{
    int N;
    cin >> N;

    int num;
    set<int> st;
    // int mx = -1;
    for (int i = 0; i < N; i++)
    {
        cin >> num;
        st.insert(num);
    }

    // find prime number
    int ans = 0;
    for (auto itr = st.begin(); itr != st.end(); itr++)
    {
        if (isPrime(*itr))
        {
            ans++;
            st.erase(itr);
        }
    }

    for (auto itr = st.begin(); itr != st.end(); itr++)
    {
        cout << *itr << endl;
    }
    cout << ans << endl;
    return (0);
} 
}



Compiler output:
a.cc:55:1: error: expected declaration before '}' token
   55 | }
      | ^
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
    int N;
    cin >> N;
    int vec[N];
    for(int i=0; i<N; i++) cin >> vec[i];
    sort(vec, vec + N);
    int count = 0;
    short flag = 1;
    
    for (int i = 0; i < N; i++) {
        flag = 1;
        if (vec[i]==vec[i-1]){
            flag = 0;
            continue;
        }
        if (i!=N-1){
            if (vec[i]==vec[i+1]){
                flag = 0;
                continue;
            }
        }
        for (int j = 0; j < i; j++) {
            if (vec[i]<vec[j]+vec[j]){
                break;
            }
            if (vec[i]%vec[j]==0){
                flag=0;
                break;
        }
        count+=flag;
    } 
    cout << count << endl;
}

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

#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }
bool sosu(int n){
  bool ret=true;
  for(int i=2;i*i<=n;i++){
   if(n%i==0) ret=false; 
  }
 return ret; 
}
int main() {
int n;
  cin>>n;
  vin a(n);
  rep(i,0,n)  cin>>a[i];
  sort(all(a));
  
  int ans=0;
  int mx=a[n-1];
 // int cnt=0;
 rep(i,0,n){
if(sosu(a[i])){
  ans++;
  int c=a[i];
                           rep(j,i,n){
                           // cnt++;
                              if(a[j]%c==0) {
                                a.erase(a.begin()+j);
                                j--;
                                
                                n--;
                                
                              }

                            }
}
  }
  while(a.size()>0){

    if(a.size()==1)ans++;
    else if(a[0]!=a[1])ans++;
    int c=a[0];
  int  kg=a.size();
            rep(j,0,kg){
  
            cnt++;
              if(a[j]%c==0) {
                a.erase(a.begin()+j);
                j--;
                kg--;
              }

            }
    
  }
  cout<<ans<<endl;
 // cout<<cnt<<endl;
}










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

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

int main()
{
    int N;
    cin>>N;
    vector<int> arr;
    for(int i=0;i<N;i++)
    {
        int a;
        cin>>a;
        arr.push_back(a);
    }
    int a=0;
    for(int i=0;i<N;i++)
    {
        int k=1;
        for(int j=0;j<N;j++)
            if(i!=j && arr[i]%arr[j]==0)
             {k=0;break}
        if(k)
         a++;
    }
    cout<<a;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:24: error: expected ';' before '}' token
   22 |              {k=0;break}
      |                        ^
      |                        ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
//typedef
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
//define
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)

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

  int ans = 0;
  rep(i,n){
    rep(j,n){
      if(i!=j || a[i]<a[j]){
        a[i] % a[j]>0; 
        ans++;
      }
    }
  }

  cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected ',' or ';' before 'for'
    8 | #define FOR(i,a,b) for(int i=(a);i<(b);++i)
      |                    ^~~
a.cc:9:19: note: in expansion of macro 'FOR'
    9 | #define rep(i,n)  FOR(i,0,n)
      |                   ^~~
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,n){
      |   ^~~
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   rep(i,n){
      |       ^
a.cc:8:34: note: in definition of macro 'FOR'
    8 | #define FOR(i,a,b) for(int i=(a);i<(b);++i)
      |                                  ^
a.cc:15:3: note: in expansion of macro 'rep'
   15 |   rep(i,n){
      |   ^~~
Language: C

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

using namespace std;

#include <iostream>

int main()
{
    
    int x;
    cin >> x ;
    vector<int> v;
    for (int j = 0; j < x; ++j)
    {
        int number;
        cin >> number;
        v.push_back(number);
    }
    int n = x;
    int count = 0;
    for (int i = 0; i < x; ++i)
    {
        for (int j = 0; j < x; ++j)
        {
            if (v[i] % v[j] == 0 && j != i)
            {
                --n;
                break;
            }
        }
    }
    cout <<n;
}

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

#include <bits/stdc++.h>

using namespace std;
typedef long long lint;

#define RPT(i, b, e) for (int i = ((int)b); i <= ((int)e); i++)
#define RPT0(i, n) RPT(i, 0, ((int)n) - 1)
#define RPT1(i, n) RPT(i, 1, (n))
#define EACH(it, v) for (const auto& it : v)
#define ALL(v) v.begin(), v.end()

void resolve()
{
    int N;
    cin >> N;
    vector<int> X(N);
    RPT0(i, N) cin >> X[i];

    sort(ALL(X));

    DBG_V(X);

    if (X[0] == 1) {
        if (N >= 2 && X[1] == 1)
            cout << 0 << endl;
        else
            cout << 1 << endl;
        return;
    }

    auto it = X.begin();
    while (it != X.end()) {
        auto it2 = it + 1;
        bool exist_same = (it2 != X.end() && *it == *it2);
        while (it2 != X.end()) {
            if (*it2 % *it == 0) {
                cout << "cur: " << *it << ", erase: " << *it2 << endl;
                it2 = X.erase(it2);
            } else
                it2++;
        }
        if (exist_same) {
            it = X.erase(it, upper_bound(it, X.end(), *it));
        } else
            it++;
    }

    DBG_V(X);
    cout << X.size() << endl;
}

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


Compiler output:
a.cc: In function 'void resolve()':
a.cc:21:5: error: 'DBG_V' was not declared in this scope
   21 |     DBG_V(X);
      |     ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define all(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    int N;
    cin>>N;
    vector<int> A(N);
    rep(i,N){
        cin>>A[i];
    }
    sort(all(A));
    int ans=0;
    if(N==1){
        cout << 1 << endl;
        return 0;
    }
    //割り切れるかどうかはそれ以下まで調べればよいが、それでも足りない
    //同じ数字はどうせ不可能だから融合する
    vector<int> B;
    int tmp=0;
    set<int> dob;

    rep(i,N){
        if(tmp!=A[i]){
            B.push_back(A[i]);
            tmp=A[i];
        }else{
            dob.insert(tmp);
        }
    }
    if(B.size()==1){
        cout << 0 << endl;
        return 0;
    }
    //重複なしでBに詰まった。
    //重複してる奴はdobに入れた


    rep(i,B.size()){
        bool divflag=false;
        rep2(j,0,i){
            if(B[i]%B[j]==0){
                divflag=true;
                break;
            }else if(B[i]<3*B[j]){
                //存在するならB[i]=2*B[j]しかないのでにぶたん
                int tmpmin=j;
                int tmpmax=i;
                int tmp=(tmpmin+tmpmax)/2;
                while(1==1){
                    if(B[i]==2*B[tmp]){
                        divflag=true;
                        break;
                    }
                    if(tmpmin==tmpmax){
                        break;
                    }
                    if(2*B[tmp]>B[i]){
                        tmpmax=tmp;
                        tmp=(tmpmax+tmpmin)/2;
                    }else if(2*B[tmp]<B[i]){
                        tmpmin=tmp;
                        tmp=(tmpmax+tmpmin)/2;
                    }
                    if(tmpmax-tmpmin==1){
                        if(2*B[tmpmax]==B[i]||2*B[tmpmin]==B[i]){
                            divflag=true;
                            break;
                        }else{
                            break;
                        }
                    }
                }
                break;
        }
        if(!divflag&&!dob.count(B[i])){
            ans++;
        }
    }

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

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

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

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

int compareInt(const void* a, const void* b)
{
  int aNum = *(int*)a;
  int bNum = *(int*)b;

  return -aNum + bNum;
}

int main(void){
  int X, N, TF, sum=0;
  scanf("%d", &N);

  int arr[N];

  for(int i=0; i<N; i++){
    scanf("%d", &arr[i]);
  }

  qsort(arr, SIZE_OF_ARRAY(arr), sizeof(int), compareInt);

  for(int i=0; i<N; i++){
    TF = 1;
    for(int j=N; j>i; j--){
      if(j!=i && (arr[i]%arr[j] == 0)){
        TF = 0;
        break;
      }
    }
    if(TF == 1) sum = sum+1;
  }

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

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

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

int compareInt(const void* a, const void* b)
{
  int aNum = *(int*)a;
  int bNum = *(int*)b;

  return -aNum + bNum;
}

int main(void){
  int X, N, TF, sum=0;
  scanf("%d", &N);

  int arr[N];

  for(int i=0; i<N; i++){
    scanf("%d", &arr[i]);
  }

  qsort(arr, SIZE_OF_ARRAY(arr), sizeof(int), compareInt);

  for(int i=0; i<N; i++){
    TF = 1;
    for(int j=N; j>i; j--){
      if(j!=i && (arr[i]%arr[j] == 0)){
        TF = 0;
        break;
      }
    }
    if(TF == 1) sum = sum+1;
  }

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

}

Compiler output:
main.c:41:2: error: stray '#' in program
   41 | }#include <stdio.h>
      |  ^
main.c:41:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   41 | }#include <stdio.h>
      |           ^
main.c:56:5: error: redefinition of 'main'
   56 | int main(void){
      |     ^~~~
main.c:16:5: note: previous definition of 'main' with type 'int(void)'
   16 | int main(void){
      |     ^~~~
Language: C++

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

typedef long long ll;

int main () {
	int N;
	vector <ll> v;
	cin >> N;
	for (int i=0; i<N; i++) {
		ll tmp;
		cin >> tmp;
		v.push_back (tmp);
	}
	sort (v.begin(), v.end());
	int sum=0;
	for (int i=0; i<N; i++) {
		bool f = true;
		if (i<N-1 && v[i]==v[i+1])
			continue;
		for (int j=0; j<i; j++) {
			if (i==j)
				continue;
			if (v[i]%v[j]==0) {
				f = false;
				break;
			}
		}
		if (f)
			sum ++;
	}
	cout << sum << endl;
	return 0;
}

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

#include <bits/stdc++.h>

using namespace std;

int n, a[100030], ans = 0, x;
bool b[100030];

int main() {
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	sort(a , a + n);
	for (int j = 0; j < n; j++){
		if (b[a[j]] == 0){
			for (int i = 1; i * a[j] <= a[n - 1]; i++){
				b[a[j] * i] = 1;
			}
			ans++;
		}
	}
	if (a[0] == a[1]){
		ans--;a
	}
	cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected ';' before '}' token
   24 |                 ans--;a
      |                        ^
      |                        ;
   25 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  long long int N;
  cin >> N;
  vector<long long int> A (N);
  for(long long int i = 0; i < N; i++){
    cin >> A[i];
  }
  long long int count = 0;
  bool shingo = true;
  for(long long int i = 0; i < N; i++){
    for(long long int j = 0; j < N; j++){
      if(j == i){
        continue;
      }else{
        if(A[i]%A[j] == 0){
        shingo = false;
        break;
      }
    }
    if(shingo == true){
      count++;
    }else{
      shingo = true;
    }
  }
  cout << count << endl;
}

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

#include<cstdio>
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
vector<int> a;
vector<bool> flg;
int main(){
  int n,tmp,count=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>tmp;
    a.push_back(tmp);
  }
  sort(a.begin(),a.end());
  for(int i=0;i<a.size();i++){
    for(int j=0;j<a.size();j++){
      if(i==j)continue;
      if(a[i]==a[j])break;
      else if(a[j]>a[i]/2){
        //cout<<a[j]<<" > "<<sqrt(a[i])<<":"<<a[i]<<endl;
        count++;
        break;
      }
      else if(a[i]%a[j]==0){
        break;
      }
    }
  }
  cout<<count<<endl;
  return 0;
}


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

/*
float like a butterfly
sting like a Bee

?#%^*&~`!  YOUR ONLY LIMIT IS YOUR MIND

*/

#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define pop pop_back
#define F first
#define S second
#define q '\n'
#define fast ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)

using namespace std;

lli n, a[100030], ans = 0, x;
bool b[100030];

int main() {
	fast;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	sort(a , a + n);
	for (int j = 0; j < n; j++){
		if (b[a[j]] == 0){
			for (int i = 1; i * a[j] <= a[n - 1]; i++){
				b[a[j] * i] = 1;
			}
			ans++;
		}
	}
	if (a[0] == a[1]){
		ans--;
	}
	cout << ans;
}
/*
float like a butterfly
sting like a Bee

?#%^*&~`!  YOUR ONLY LIMIT IS YOUR MIND

*/

#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define pop pop_back
#define F first
#define S second
#define q '\n'
#define fast ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)

using namespace std;

lli n, a[100030], ans = 0, x;
bool b[100030];

int main() {
	fast;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> a[i];
	}
	sort(a , a + n);
	for (int j = 0; j < n; j++){
		if (b[a[j]] == 0){
			for (int i = 1; i * a[j] <= a[n - 1]; i++){
				b[a[j] * i] = 1;
			}
			ans++;
		}
	}
	if (a[0] == a[1]){
		ans--;
	}
	cout << ans;
}


Compiler output:
a.cc:62:5: error: redefinition of 'long long int n'
   62 | lli n, a[100030], ans = 0, x;
      |     ^
a.cc:20:5: note: 'long long int n' previously declared here
   20 | lli n, a[100030], ans = 0, x;
      |     ^
a.cc:62:8: error: redefinition of 'long long int a [100030]'
   62 | lli n, a[100030], ans = 0, x;
      |        ^
a.cc:20:8: note: 'long long int a [100030]' previously declared here
   20 | lli n, a[100030], ans = 0, x;
      |        ^
a.cc:62:19: error: redefinition of 'long long int ans'
   62 | lli n, a[100030], ans = 0, x;
      |                   ^~~
a.cc:20:19: note: 'long long int ans' previously defined here
   20 | lli n, a[100030], ans = 0, x;
      |                   ^~~
a.cc:62:28: error: redefinition of 'long long int x'
   62 | lli n, a[100030], ans = 0, x;
      |                            ^
a.cc:20:28: note: 'long long int x' previously declared here
   20 | lli n, a[100030], ans = 0, x;
      |                            ^
a.cc:63:6: error: redefinition of 'bool b [100030]'
   63 | bool b[100030];
      |      ^
a.cc:21:6: note: 'bool b [100030]' previously declared here
   21 | bool b[100030];
      |      ^
a.cc:65:5: error: redefinition of 'int main()'
   65 | int main() {
      |     ^~~~
a.cc:23:5: note: 'int main()' previously defined here
   23 | int main() {
      |     ^~~~
Language: C++

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

#define all(v) begin(v), end(v)
#define endl '\n';
#define pii pair<int, int>

const int N = 1e6;
int mp[N+1];

bool factor(int x) {
    bool good = true;
    for (int i = 2; i*i <= x; i++) {
        if (x % i == 0) {
            if (mp[i] > 0) {good = false; break;};
            if (x/i != i) {
                if (mp[x/i] > 0) {good = false; break;};
            }
        }
    }
    return good;
}

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

    int n; cin >> n;
    vector<int> a(n), b;
    
    for (int& x : a) {
        cin >> x;
        mp[x]++;
    }
    sort(all(a));
    if (mp[1]) {
        if (mp[1] == 1) cout << 1 << endl;
        else cout << 0 << endl;
        return 0;
    }
    int ans = 0;
    for (int& x : a) {
        if (mp[x] > 1) continue;
        if (factor(x)) ans++;
    }
    cout << ans << endl;    
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:38:9: error: expected '}' before 'else'
   38 |         else cout << 0 << endl;
      |         ^~~~
a.cc:36:16: note: to match this '{'
   36 |     if (mp[1]) {
      |                ^
a.cc: At global scope:
a.cc:42:5: error: expected unqualified-id before 'for'
   42 |     for (int& x : a) {
      |     ^~~
a.cc:46:5: error: 'cout' does not name a type
   46 |     cout << ans << endl;
      |     ^~~~
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^