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

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

typedef pair<long long, long long> P;
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<int> ju(N, 0);
    vector<long long> r(1e6 + 1, 0);
    for(int i = 1; i < N; i++){
        if(A[i] == A[i - 1]){
            ju[i] = -1;
            ju[i - 1] = -1;
        }
    }
    for(int i = 0; i < N; i++){
      	if(r[A[i] != 0) continue;
        long long t = A[i];
        long long res = 2;
        while(t*res <= A[N - 1]){
            r[t*res]++;
            res++;
        }
    }
    long long ans = 0;
    for(int i = 0; i < N; i++){
        if(r[A[i]] == 0 && ju[i] == 0) ans++;
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: expected ']' before ')' token
   22 |         if(r[A[i] != 0) continue;
      |                       ^
      |                       ]
Language: C

import math
import sys

x,n=(int(x) for x in input().split())

if (x<1)or(100<x)or(n<0)or(100<n):
    sys.exit(0)

p = 0
for i in range(n):
    p.append(int(input()))
    if p[i]=='':
        print(x)
        sys.exit()
    if (p[i]<1)or(100<p[i]):
        sys.exit(0)

j = 0;

while True:
    l = x-j;
    r = x+j;

    if (l in p)==False:
        print(l)
        sys.exit()

    if (r in p)==False:
        print(r)
        sys.exit()

    j += 1


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import math
      | ^~~~~~
main.c:2:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import'
    2 | import sys
      | ^~~~~~
main.c:2:1: error: unknown type name 'import'
main.c:12:14: error: empty character constant
   12 |     if p[i]=='':
      |              ^~
main.c:20:1: error: expected identifier or '(' before 'while'
   20 | while True:
      | ^~~~~
main.c:22:5: warning: data definition has no type or storage class
   22 |     r = x+j;
      |     ^
main.c:22:5: error: type defaults to 'int' in declaration of 'r' [-Wimplicit-int]
main.c:22:9: error: 'x' undeclared here (not in a function)
   22 |     r = x+j;
      |         ^
main.c:22:11: error: 'j' undeclared here (not in a function)
   22 |     r = x+j;
      |           ^
main.c:24:5: error: expected identifier or '(' before 'if'
   24 |     if (l in p)==False:
      |     ^~
Language: C++

#include <iostream>
#include <vector>
#include <vector>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  vector<int> 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++) {
    int end = min(i + 1, n - 1);
    bool div = false;
    for (int j = 0; j <= end; j++) {
      if (i == j) continue;
      if (a[i] % a[j] == 0) div = true;
    }
    if (!div) ans++;
  }
  cout << ans << endl;
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll                long long int
#define ld                long double
#define pb                push_back
#define mk                make_pair
#define in(i,a,n)         for(ll i=0;i<n;++i) cin>>a[i];
#define out(i,a,n)        for(ll i=0;i<n;++i) cout<<a[i]<<" ";
#define sz                size()
#define all(c)            c.begin(), c.end()
#define rall(c)           c.rbegin(), c.rend()
#define loop(i,a,b)       for(ll i=a;i<b;i++)
#define rloop(i,a,b)      for(ll i=a;i>b;i--)
#define F                 first
#define S                 second
#define deb(x) cout << #x << " " << x << endl
#define inf INT_MAX
const ll N = 100010;
const ll MOD = 1e9+7;
ll mod(ll n) {
    return (n % MOD + MOD) % MOD;
}


void solve(){
    int N;
    cin >> N;
    vecctor<int> v(N+1);
    for(int i=0;i<N;i++){
        cin >> v[i];
    }
    int ans = 0;
    vector<int> P(pow(10, 6), 0);
    for(int i=0;i<N;i++){
        if(P[v[i]] == 0){
            for(int j=0;j<=pow(10, 6)/a[i];j++){
                P[j * v[i]] = 1;
            }
            if(i == N-1 || a[i] != a[i+1])
                ans++;
        }
    }
    cout << ans;
}

int main(){
    fast
    int T=1;
    //cin >> T;
    for(int i=0;i<T;i++) solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:29:5: error: 'vecctor' was not declared in this scope
   29 |     vecctor<int> v(N+1);
      |     ^~~~~~~
a.cc:29:13: error: expected primary-expression before 'int'
   29 |     vecctor<int> v(N+1);
      |             ^~~
a.cc:31:16: error: 'v' was not declared in this scope
   31 |         cin >> v[i];
      |                ^
a.cc:36:14: error: 'v' was not declared in this scope
   36 |         if(P[v[i]] == 0){
      |              ^
a.cc:37:39: error: 'a' was not declared in this scope
   37 |             for(int j=0;j<=pow(10, 6)/a[i];j++){
      |                                       ^
a.cc:40:28: error: 'a' was not declared in this scope
   40 |             if(i == N-1 || a[i] != a[i+1])
      |                            ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
# define f(a,b) for(int i=a;i<b;i++)
#define endl '\n'
#define ll long long
#define INF 1000000000
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define fast ios::sync_with_stdio(0);cin.tie(0);
map<int,int> mp; 
bool find(int n)
{
	if (mp[1]==1) return false;
	if(mp[n]>1) return false;
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			if(mp[i]==1 || mp[n/i]==1) return false;
		}
	}
	return true;
}
void solveD()
{
	int n;
	cin>>n;
	int a[n],c=0;
	for(int i=0;i<n;i++) cin>>a[i],mp[a[i]]++;
	for(int i=0;i<n;i++)
	{
		int no=a[i];
		if(no==1) {
			cout<<1<<endl;
			return;
		}
		else if(find(no)) c++;
	}
	cout<<c<<endl;
}
int main()
{
	fast;
//	int t;
//	cin>>t;
//	while(t--)
	solveD();
}
map<int,int> mp; 
bool find(int n)
{
	for(int i=2;i*i<=n;i++)
	{
		if(n%i==0)
		{
			if(mp[i]>=1 || mp[n/i]>=1) return false;
		}
	}
	return true;
}
void solveD()
{
	int n;
	cin>>n;
	int a[n],c=0;
	for(int i=0;i<n;i++) cin>>a[i],mp[a[i]]++;
	if(mp[1]==1){
		cout<<1<<endl;
		return;
	}
	else if(mp[1]>=2){
		cout<<2<<endl;
		return;
	}
	else{
		for(int i=0;i<n;i++)
		{
			int no=a[i];
			if(mp[no]>=2) 
			continue;
			else if(find(no)) c++;
		}
	cout<<c<<endl;
	}
}
int main()
{
	fast;
//	int t;
//	cin>>t;
//	while(t--)
	solveD();
}

Compiler output:
a.cc:48:14: error: redefinition of 'std::map<int, int> mp'
   48 | map<int,int> mp;
      |              ^~
a.cc:9:14: note: 'std::map<int, int> mp' previously declared here
    9 | map<int,int> mp;
      |              ^~
a.cc:49:6: error: redefinition of 'bool find(int)'
   49 | bool find(int n)
      |      ^~~~
a.cc:10:6: note: 'bool find(int)' previously defined here
   10 | bool find(int n)
      |      ^~~~
a.cc:60:6: error: redefinition of 'void solveD()'
   60 | void solveD()
      |      ^~~~~~
a.cc:23:6: note: 'void solveD()' previously defined here
   23 | void solveD()
      |      ^~~~~~
a.cc:85:5: error: redefinition of 'int main()'
   85 | int main()
      |     ^~~~
a.cc:40:5: note: 'int main()' previously defined here
   40 | int main()
      |     ^~~~
Language: C++

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

int main ()
{
  int n;
   cin>>n;
   int a[n];
   unordered_map<int,int> m;
   for(int i=0;i<n;i++)
   {
       m[cin>>a[i],a[i]]++;
   }
   int ans=0;
   sort(a,a+n);
   if(a[0]==1)
   {
       cout<<1<<endl;
       continue;
   }
   for(int i=0;i<n;i++)
   {
        int f=0;
        if(m[a[i]]>1)
        {
            f=1;
            continue;
        }
        else
        {
            for(int k=2;k<=sqrt(a[i]);k++)
            {
                if(a[i]%k==0)
                {
                    if((m[a[i]/k])||m[k])
                    {
                        f=1;
                        break;
                    }
                }
            }
        }
        if(!f)
            ans++;
   }
   cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:8: error: continue statement not within a loop
   19 |        continue;
      |        ^~~~~~~~
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using namespace std;

int sosuu(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;
	vector<int> A;
	cin >> N;

	rep(i, N) {
		int a;
		cin >> a;
		A.push_back(a);
	}
	sort(A.begin(), A.end());
	//reverse(A.begin(), A.end());

	int max = A[N-1];
	vector<int> dp(max+1,false);

	rep(i, N) {
		if (dp[A[i]] == true)continue;
		if (i<N-1 && A[i] == A[i + 1])dp[A[i]] = true; 

		rep(j, max) {

			if (j == 0 || j == 1)continue;
			int tmp = A[i] * j;
			if (tmp > max)break;
			dp[tmp] = true;
		}
	}

	int ans = 0;
	rep(i, N) {
		if (dp[A[i]] == false)ans++;
	}


	cout << ans;

	return 0;
}

Compiler output:
a.cc: In function 'int sosuu(int)':
a.cc:14:26: error: 'sqrt' was not declared in this scope
   14 |         double sqrtNum = sqrt(num);
      |                          ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
typedef vector<string> vstring;
#define _GLIBCXX_DEBUG
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
const int INF = 1 << 30;
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
#define stp(x)  setprecision(x)
int main(){
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  vint a(n+1,0);
  rep(i,n){
    cin>>a[i];
  }
  sort(all(n));
  ll maxx=a[n-1];
  vint dp(ma+1,0);
  rep(i,n){
    if(dp[a[i]]==0){
      if(a[i]!=a[i+1]) ans++;
      for(int j=a[i];j<=maxx;j+=a[i]){
        dp[j]++;
      }
    }
  }
  cout<<ans<<'\n';
  return(0);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: error: request for member 'begin' in 'n', which is of non-class type 'int'
   13 | #define all(v) v.begin(), v.end()
      |                  ^~~~~
a.cc:28:8: note: in expansion of macro 'all'
   28 |   sort(all(n));
      |        ^~~
a.cc:13:29: error: request for member 'end' in 'n', which is of non-class type 'int'
   13 | #define all(v) v.begin(), v.end()
      |                             ^~~
a.cc:28:8: note: in expansion of macro 'all'
   28 |   sort(all(n));
      |        ^~~
a.cc:30:11: error: 'ma' was not declared in this scope; did you mean 'a'?
   30 |   vint dp(ma+1,0);
      |           ^~
      |           a
a.cc:33:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   33 |       if(a[i]!=a[i+1]) ans++;
      |                        ^~~
      |                        abs
a.cc:39:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   39 |   cout<<ans<<'\n';
      |         ^~~
      |         abs
Language: C

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

int main(void)
{
  int n,tmp;
  int a[1000001]={0};
  int max=0;
  int ans=0;

  scanf("%d",&n);
  for(int i=0;i<n;i++)
  {
    scanf("%d",&tmp);
    a[tmp]++;
    if(max<tmp) max=tmp;
  }

  for(int j=1,j<=max;j++)
  {
    if(a[j]==1)
    {
      ans++;
      for(int k=2*i;k<=1000000;k+=i)
      {
        a[k]=0;
      }
    }
    else a[j]=0;
  }

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

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   20 |   for(int j=1,j<=max;j++)
      |                ^~
main.c:20:25: error: expected ';' before ')' token
   20 |   for(int j=1,j<=max;j++)
      |                         ^
      |                         ;
main.c:25:19: error: 'i' undeclared (first use in this function)
   25 |       for(int k=2*i;k<=1000000;k+=i)
      |                   ^
main.c:25:19: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>

using namespace std;

#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)

using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

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;
    int a[200010];
    for (int i=0; i<n; i++) {
        cin >> a[i];
    }
    multiset<int> s;
    for (int i=0; i <n; i++) {
        s.insert(a[i]);
    }
    int res =0;
    for (int i=0; i<n; i++) {
        s.erase(s.find(a[i]));

        auto div = divisor(a[i]);
        for (auto e: div) {
            if (s.find(e) != s.end()) {
                goto bad;
            }
        }
        res++;
        bad:
        s.insert(a[i]);
        delete(div);
    }

    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:67:16: error: type 'class std::vector<long int>' argument given to 'delete', expected pointer
   67 |         delete(div);
      |               ~^~~~
Language: C++

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

int main() {
    int n;
    cin >> n;
    vecotr<int> a(n);
    int maxa=-1;
    rep(i,n){
        cin >> a[i];
        maxa = max(a[i],maxa);
    }
    sort(ALL(a));
    int ans = 0;
    vector<bool> flag(maxa,false);
    vector<bool> flag2(maxa,false);
    rep(i,n){
        if(flag[a[i]]&&!falg2[a[i]]) ans++;
        if(flag2[a[i]]) continue;
        flag2[a[i]] = true;
        int j = 1;
        while(j*a[i]<=maxa){
            flag[j*a[i]]==true;
            j++;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'vecotr' was not declared in this scope
   11 |     vecotr<int> a(n);
      |     ^~~~~~
a.cc:11:12: error: expected primary-expression before 'int'
   11 |     vecotr<int> a(n);
      |            ^~~
a.cc:14:16: error: 'a' was not declared in this scope
   14 |         cin >> a[i];
      |                ^
a.cc:17:14: error: 'a' was not declared in this scope
   17 |     sort(ALL(a));
      |              ^
a.cc:4:17: note: in definition of macro 'ALL'
    4 | #define ALL(x) (x).begin(), (x).end()
      |                 ^
a.cc:22:25: error: 'falg2' was not declared in this scope; did you mean 'flag2'?
   22 |         if(flag[a[i]]&&!falg2[a[i]]) ans++;
      |                         ^~~~~
      |                         flag2
Language: C++

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

int main() {


    int n;

    cin >> n;

    vector<int> v(n);

    for(int i = 0; i < n; ++i)
        cin >> v[i];

    sort(v.begin(), v.end());
    int maxV = v[n - 1];

    vector<bool> used(maxV + 1, false);
    int count = 0;

    for(int i = 0; i < n; ++i) {

        if(used[v[i])
            continue;

        for(int j = 1; j * v[i] <= maxV; j++) {
            used[v[i] * j] = true;
        }

        if(i + 1 < n && v[i] == v[i + 1])
            continue;

        count++;

    }

    cout << count << endl;

    return 0;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:21: error: expected ']' before ')' token
   26 |         if(used[v[i])
      |                     ^
      |                     ]
Language: C++

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

vector<long long> divisor(long long n){//nの約数列挙
    vector<long long> res;
    for(long long i = 1; i * i <= n; i++){
        if(n % i == 0){
            res.push_back(i);
            if(i != n / i) res.push_back(n / i);
        }
    }
    return res;
}

typedef pair<long long, long long> P;
int main(){
    long long N;
    cin >> N;
    vector<long long> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    map<long long, long long> m;
    sort(A.begin(), A.end());
    vector<int> ju(N, 0);
    for(int i = 1; i < N; i++){
        if(A[i] == A[i - 1]){
            ju[i] = -1;
            ju[i - 1] = -1;
        }
    }
    for(int i = 0; i < N; i++){
        if(m.count(A[i])) continue;
        long long t = A[i];
        long long res = 2;
        while(t*res <= A[Nー1]){
            m[t*res]++;
            res++;
        }
    }
    long long ans = 0;
    for(int i = 0; i < N; i++){
        if(m[A[i]] == 0 && ju[i] == 0) ans++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:26: error: 'N\U000030fc1' was not declared in this scope
   36 |         while(t*res <= A[Nー1]){
      |                          ^~~~
Language: C++

#include <cstdio>
#include <cstdint>
#include <vector>

using namespace std;
using uint = unsigned int;

int main() {
  uint n;
  scanf("%u", &n);
  vector<uint> as(n);
  for (auto& a : as) {
    scanf("%u", &a);
  }
  sort(as.begin(), as.end());

  auto end = as.end();
  uint k = 0;
  auto next = end;
  for (auto it = as.begin(); it != end; it = next) {
    next = it + 1;
    if (*it == 0) {
      continue;
    }
    if (!(next != end && *it == *next)) {
      k++;
    }
    for (auto jt = next; jt != end; ++jt) {
      if (*jt % *it == 0) {
        *jt = 0;
      }
    }
  }

  printf("%u", k);
  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 'short'?
   15 |   sort(as.begin(), as.end());
      |   ^~~~
      |   short
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
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<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
// map<ll,ll> prime_factor(ll n) {
//     map<ll,ll> res;
//     for(ll i = 2,i*i<=n;i++){
//         while(n%i==0) {
//             ++res[i];
//             n/=i;
//         }
//     }

//     if (n!=1) {
//         res[n] = 1;
//     }
//     return res;
// }
using P = pair<int,int>;
int main(void){
    // Your code here!
    int n; cin >> n;
    vector<int> a(n);
    vecotor<int> is_prime(100000+1,0);

    rep(i,n) {
        cin >> a[i];
        is_prime[a[i]]++;
    }
    sort(a.begin(),a.end());

    for (int i = 1; i <= a[n-1];i++) {
        if (is_prime[i] > 0) {
            for (int j = 2 * i; j <= a[n-1];j += i) {
                is_prime[j] = 0;
            }
        }
    }
    int cnt = 0;
    rep(i,a[n-1]+1) {
        if (is_prime[i] == 1) {
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'vecotor' was not declared in this scope
   37 |     vecotor<int> is_prime(100000+1,0);
      |     ^~~~~~~
a.cc:37:13: error: expected primary-expression before 'int'
   37 |     vecotor<int> is_prime(100000+1,0);
      |             ^~~
a.cc:41:9: error: 'is_prime' was not declared in this scope
   41 |         is_prime[a[i]]++;
      |         ^~~~~~~~
a.cc:46:13: error: 'is_prime' was not declared in this scope
   46 |         if (is_prime[i] > 0) {
      |             ^~~~~~~~
a.cc:54:13: error: 'is_prime' was not declared in this scope
   54 |         if (is_prime[i] == 1) {
      |             ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define ll long long
#define vi vector<int>
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
#define forn(b) for(int i = 0; i < b; i++)
#define rforn(b) for(int i = b - 1 ;i >= 0; i--)
#define It(m) for(auto it = m.begin(); it != m.end(); it++)
#define N 500500
#define PI 3.14159265358979323846264338327950L
#define speed ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
const ll mod = (ll)1e9 + 7;
    
int main(){
    speed;
    int n; cin >> n;
    vi v(n);
    vector<pii> data(1000001, {1, 1});
    data[0].first = false;
    data[1].first = false;
    data[2].first = true;
    vector<map<int, bool>> info(1000001);
    for(int i = 2; i * i <= 1000000; i++) {
        if(data[i].first) {
            for(int j = 2 * i; j <= 1000000; j+= i) {
                data[j].first = false;
                data[j].second = i;
            }
        }
    }
    vector<int> m(1000001);
    forn(n) { 
        cin >> v[i];
        m[v[i]]++;
    }
    int res = 0;
    for(int i = 0; i < n; i++) {
        if(m[1] == true && v[i] != 1) continue;
        if(m[v[i]] != 1) continue;
        if(data[v[i]].first == true) {
            res++;
        }
        else {
            int n1 = v[i];
            bool out = false;
            for(int j = 1; j * j <= n1; j++) {
                if(v[i] % j == 0) {
                    if( m[j] ) {
                        out = true;
                        break;
                    }
                    if( n1 / j != j && m[x/j]) {
                        out = true;
                        break;
                    }
                }
            }
            if(out == false) res++;
        }
    }
    cout << res;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:57:42: error: 'x' was not declared in this scope
   57 |                     if( n1 / j != j && m[x/j]) {
      |                                          ^
Language: C++

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
// typedef long double ldouble;

using Graph = vector<vector<int>>;

// int ctoi(const char c){
//   if('0' <= c && c <= '9') return (c-'0');
//   return -1;
// }

// int gcd(int a, int b){
//   int ma = max(a,b);
//   int mi = min(a,b);
//   if(mi == 0) return ma;

//   return gcd(mi, ma%mi);
// }

// llong POW(llong a, llong b){
//   if(b == 0) return 1;
//   else{
//     if(b%2 == 0) return POW(a * a % MOD, b / 2) % MOD;
//     else return a * POW(a * a % MOD, b / 2) % MOD;
//   }
// }

int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N;
	cin >> N;
	vector<int> A(N);
	for(int i=0; i<N; ++i) cin >> A[i];
	sort(A.begin(), A.end89)
	vector<int> ref(A[N-1], 0);
	for(int i=0; i<N-1; ++i){
		if(ref[A[i]-1]==1) continue;
		int count = 2;
		while(A[i]*count < A[N-1]){
			ref[A[i]*count-1] = 1;
			++count;
		}
	}
	for(int i=0; i<N-1; ++i) if(A[i]==A[i+1]) ref[A[i]-1] = 1;
	int ans = 0;
	for(int i=0; i<N; ++i) if(ref[A[i]-1]==0) ++ans;
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:27: error: 'class std::vector<int>' has no member named 'end89'; did you mean 'end'?
   44 |         sort(A.begin(), A.end89)
      |                           ^~~~~
      |                           end
a.cc:47:23: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   47 |                 if(ref[A[i]-1]==1) continue;
      |                       ^
a.cc:50:28: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   50 |                         ref[A[i]*count-1] = 1;
      |                            ^
a.cc:54:54: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   54 |         for(int i=0; i<N-1; ++i) if(A[i]==A[i+1]) ref[A[i]-1] = 1;
      |                                                      ^
a.cc:56:38: error: invalid types '<unresolved overloaded function type>[__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type {aka int}]' for array subscript
   56 |         for(int i=0; i<N; ++i) if(ref[A[i]-1]==0) ++ans;
      |                                      ^
Language: C++

#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <functional>
using namespace std;

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

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

  vector<int> A_sort;
  for(int i=0;i<N;i++){
    cin >> A;
    A_sort.push_back(A);

  }
  sort(A_sort.begin(),A_sort.end());
  int answer = 0;
  int flag = -1;
  for(int i=0;i<N;i++){
    flag = 0;
    for(int j=0;j<N;j++){
      if(i==j) continue;
      if(A_sort[i]<A_sort[j]) break;
      if(gcd(A_sort[i],A_sort[j])==A_sort[j]){
        flag = 1;
        break;
      }
    }
    if(flag!=1) answer += 1;
  }

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

int main(void) {
	int N;
	cin >> N;
	vector<int> A(N);
	vector<int> A2;
	map<int, int>memo;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());


	//ダブりは消す
	for (int i = 0; i < A.size() - 1; i++) {
		if (A[i] == A[i + 1]) {
			A.erase(A.begin() + i + 1);
			memo[A[i]] = 1;
			i--;
		}
	}
	return  0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> N;
      |         ^~~
a.cc:4:9: error: 'vector' was not declared in this scope
    4 |         vector<int> A(N);
      |         ^~~~~~
a.cc:4:16: error: expected primary-expression before 'int'
    4 |         vector<int> A(N);
      |                ^~~
a.cc:5:16: error: expected primary-expression before 'int'
    5 |         vector<int> A2;
      |                ^~~
a.cc:6:9: error: 'map' was not declared in this scope
    6 |         map<int, int>memo;
      |         ^~~
a.cc:6:13: error: expected primary-expression before 'int'
    6 |         map<int, int>memo;
      |             ^~~
a.cc:8:24: error: 'A' was not declared in this scope
    8 |                 cin >> A[i];
      |                        ^
a.cc:10:14: error: 'A' was not declared in this scope
   10 |         sort(A.begin(), A.end());
      |              ^
a.cc:10:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |         sort(A.begin(), A.end());
      |         ^~~~
      |         short
a.cc:17:25: error: 'memo' was not declared in this scope
   17 |                         memo[A[i]] = 1;
      |                         ^~~~
Language: Java

import java.util.Scanner;
import java.util.Set;
import java.util.HashSet;
import java.util.TreeSet;

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

    int n = sc.nextInt();
    Set distinctSet = new TreeSet();
    for (int i = 0; i < n; i++) {
      distinctSet.add(sc.nextInt());
    }

    int[] a = new int[distinctSet.size()];
    int ctr = 0;
    Set idx = new HashSet();
    for (int m : distinctSet) {
      a[ctr] = m;
      idx.add(ctr++);
    }

    int pos = 0;
    while (pos < n) {

      if (a[pos] > 1000) break;

      if (!idx.contains(pos)) {
        pos++; continue;
      }

      int d = a[pos];

      pos++;
      for (int i = pos; i < n; i++) {
        if (idx.contains(i) && a[i] % d == 0)  {
          idx.remove(i);
        }
      }
    }

    System.out.println(idx.size());

  }
}


Compiler output:
Main.java:19: error: incompatible types: Object cannot be converted to int
    for (int m : distinctSet) {
                 ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <cstdlib>
using namespace std;

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

int main(void){
  int N;
  cin >> N;
  int A;
  vector<int> A_sort;
  for(int i=0;i<N;i++){
    cin >> A;
    A_sort.push_back(A);
  }
  sort(A_sort.begin(),A_sort.end());
  int answer = 0;
  int flag = -1;
  for(int i=0;i<N;i++){
    flag = 0;
    for(int j=0;j<i;j++){
      if(gcd(A_sort[i],A_sort[j])==A_sort[j]){
        flag = 1;
        break;
      }
    }
    if(flag!=1) answer += 1;
  }

  printf("%d\n",answer);
  return 0;
}

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

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

int main() {
  int N;
  cin>>N;
  vector<int> A(N);
  rep(i,N){cin >> A.at(i);}

  sort(A.begin(), A.end())
    
  int Ans,c;
 Ans=0;
  rep(i,N){
   c=0;
   rep(j,N){if(A.at(i)<A.at(j)){break;}
            if(A.at(i)%A.at(j)==0){c++;if(c==2){break;}}
           }
            if(c!=2){Ans++;}
  }
  cout<<Ans<<endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:27: error: expected ';' before 'int'
   11 |   sort(A.begin(), A.end())
      |                           ^
      |                           ;
   12 | 
   13 |   int Ans,c;
      |   ~~~                      
a.cc:14:2: error: 'Ans' was not declared in this scope
   14 |  Ans=0;
      |  ^~~
a.cc:16:4: error: 'c' was not declared in this scope
   16 |    c=0;
      |    ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

int divisor[1000000+10];
void maked(int n){divisor[0]=-1;divisor[1]=1;ll i=2;for(;i*i<=n;i++)if(!divisor[i]){divisor[i]=i;for(ll j=i*i;j<=n;j+=i)if(!divisor[j])divisor[j]=i;}for(;i<=n;i++)if(!divisor[i])divisor[i]=i;}
int div(ll n,ll*a){//約数（div使用）
	ll cnt=1;a[0]=1;
	while(n!=1){ll num=1,i=divisor[n],temp=i;while(n%i==0){n/=i;num++;}rep(k,1,num){rep(j,0,cnt)a[k*cnt+j]=a[j]*temp;temp*=i;}cnt*=num;}
	//sortup(a,cnt);
	return cnt;
}

int n;
int a[200010];
int aa[1000010];
ll yakusuu[1000];
int main(){
	maked(1000000+5);
	scanf("%d",&n);
	rep(i,0,n)scanf("%d",a+i);
	rep(i,0,n)aa[a[i]]++;

	int ans=0;
	rep(i,0,n){
		int cnt=div(a[i],yakusuu);
		int flag=aa[a[i]]==1;
		rep(i,0,cnt)if(yakusuu[i]!=a[i])flag&=aa[yakusuu[i]]==0;
		if(flag)ans++;
	}
	
	printf("%d",ans);
}

Compiler output:
main.c:23:5: error: conflicting types for 'div'; have 'int(long long int,  long long int *)'
   23 | int div(ll n,ll*a){//約数（div使用）
      |     ^~~
In file included from main.c:2:
/usr/include/stdlib.h:992:14: note: previous declaration of 'div' with type 'div_t(int,  int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
Language: C++

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

vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  ret.push_back(1);
  for(int64_t i = 2; 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;
  map<int,int> s;
  const int n_max = 1e6+10;
  vector<int> aru(n_max,0);
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
    aru[a[i]]++;
  }
  sort(a.begin(),a.end());
  int ans = 0;
  if(a[0]==1) {
    if(aru[a[i]]>1)cout << 0 << endl;
    else cout << 1 << endl;
    return 0;
  }
  rep(i,n){
    if(aru[a[i]]>=10000000 || aru[a[i]]<1) continue;
    else{
      if(aru[a[i]]==1) ans++;
      for(int j=a[i]*2;j<n_max;j+=a[i]){
        aru[j] = 1e7;
      }
    }
  }
  cout << ans << endl;
  return 0;
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:14: error: 'i' was not declared in this scope
   39 |     if(aru[a[i]]>1)cout << 0 << endl;
      |              ^
Language: C++

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

vector< int64_t > divisor(int64_t n) {
  vector< int64_t > ret;
  ret.push_back(1);
  for(int64_t i = 2; 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;
  map<int,int> s;
  const int n_max = 1e6+10;
  vector<int> aru(n_max,0);
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
    aru[a[i]]++;
  }
  sort(a.begin(),a.end());
  int ans = 0;
  if(a[i]==1) {
    if(aru[a[i]]>1)cout << 0 << endl;
    else cout << 1 << endl;
    return 0;
  }
  rep(i,n){
    if(aru[a[i]]>=10000000 || aru[a[i]]<1) continue;
    else{
      if(aru[a[i]]==1) ans++;
      for(int j=a[i]*2;j<n_max;j+=a[i]){
        aru[j] = 1e7;
      }
    }
  }
  cout << ans << endl;
  return 0;
    

}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:8: error: 'i' was not declared in this scope
   38 |   if(a[i]==1) {
      |        ^
Language: C++

#include<iostream>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<algorithm>
#include <vector>
#include<cstdio>
#include <numeric>
#include <queue>
#include <list>
#include <math.h>
#include <stdio.h>
#include <math.h>
#include <errno.h>
#include <fenv.h>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
long long mod=1000000007;
vector< int> divisor(int n) {
  vector< int > ret;
  for(int 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(){
  int N;cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  int ans=N;
  A.push_back(0);
  sort(A.begin(),A.end());
  if(A[1]==1){
    ans=0;
    cout<<ans<<endl;
  }
  else{
      
  
  vector<int>B;
  for(int i=1;i<N+1;i++){
    if(A[i]==A[i-1]){
      ans-=1;
    }
    else B.push_back(A[i]);
  }
  if(B.size()==1)cout<<0<<endl;
  else{
    //cout<<ans<<endl;
  sort(B.begin(),B.end());
    
  for(int i=0;i<B.size();i++){
    vector<int>ret=divisor(B[i]);
    for(int j=0;j<ret.size()-1;j++){
    auto itr=lower_bound(B.begin(), B.end(), ret[j]);
    if(itr!=B.end()){
      if(*itr==ret[j]){
        //cout<<"ihhi"<<" "<<*itr<<endl;
        ans-=1;
        break;
      }
    }
    }
  }
  }
  cout<<ans<<endl;
  }
 
  

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

import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
    ArrayList<Integer> a = new ArrayList<Integer>();
    ArrayList<Integer> ans = new ArrayList<Integer>();

    for(int i=0; i<n; i++) {
      int tmp = sc.nextInt();
      a.add(tmp);
    }

    Collections.sort(a);
/*
      for(int i=0; i<n; i++) {
      System.out.println(a.get(i));
    }
*/

    for(int i=0; i<n; i++) {
      boolean f = false;
      for(int w=0; w<i; w++) {
        if(i == w){
          continue;
        }
        if(a.get(i) % a.get(w) == 0) {
          f = true;
          break;
        }
        if((a.get(i)/2 > a.get(w)) {
          break;
        }
      }// for w
      if(f == false) {
        ans.add(a.get(i));
      }
    }//for i
    int answer = ans.size();
    if(a.get(0) == a.get(1)) {
      answer = 0;
    }
    System.out.println(answer);

	}
}


Compiler output:
Main.java:32: error: ')' expected
        if((a.get(i)/2 > a.get(w)) {
                                  ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
vector<int> A;
vector<int> A1;
#define ten6 2000030
int N;
bool used[ten6];

int main()
{
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        int a = 0;
        cin >> a;
        A.push_back(a);
        //dependent.push_back(0);
    }
    sort(A.begin(), A.end());
    if(A[0]==1){
        if(N>1){
            if(N[1]==1){
                cout<<0;
                return 0;
            }
        }
        cout<<1;
        return 0;
    }
    int last=0;
    for (int i = 0; i < N; i++)
    {
        if(last==A[i]){
            used[A[i]-1]=true;
            continue;
        }
        for(int x=A[i]*2;x<=ten6;x+=A[i]){
            used[x-1]=true;
        }
        last=A[i];
    }
    int res=0;

    for (int i = 0; i < N; i++)
    {
        if(!used[A[i]-1]){
            res++;
        }
    }
    cout<<res<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: invalid types 'int[int]' for array subscript
   22 |             if(N[1]==1){
      |                 ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long l;
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    l N;
    cin>>N;
    l A[N];
    for(l i=0;i<N;i++)
    {
        cin>>A[i];
    }
    sort(A,A+N);
    l ans=0;
    for(l i=0;i<N;i++)
    {
        bool b=true;
        for(l j=i-1;j>=0;j--)
        {
            if(A[i]!=A[j])
            {
                if(A[i]%A[j]==0)
                {
                    b=false;
                    break;
                }
            }
            else{
                b=false;
                break;
            }
        }
        if(i==0)
        {
            if(i!=(N-1))
            {
                if(A[i]!=A[i+1])
                {
                    ans++
                }
            }
          else ans++;
        }
        else if(b) ans++;
    }
    cout<<ans;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:26: error: expected ';' before '}' token
   40 |                     ans++
      |                          ^
      |                          ;
   41 |                 }
      |                 ~
Language: Java

import java.util.*;

public class Main {
    public static void sort(int array[], int left, int right){
        if(left <= right){
            int p = array[(left + right) >>> 1];
            int l = left;
            int r = right;
            while(l <= r){
                while (array[l] < p){
                    l++;
                }
                while (array[r] > p){
                    r--;
                }
                if (l <= r){
                    int tmp = array[l];
                    array[l] = array[r];
                    array[r] = tmp;
                    l++;
                    r--;
                }
            }
            Main.sort(array, left, r);
            Main.sort(array, l, right);
        }
    }
    
    public static void main(String args[]){
        Scanner stdIn = new Scanner(System.in);
        
        int n = stdIn.nextInt();
        int a[] = new int[n];
        int waren[] = new int[n];
        
        for(int i = 0; i < n; i++){
            a[i] = stdIn.nextInt();
        }
        
        Main.sort(a, 0, n - 1);
        
        int counter = 0;
        int samNum = 0;
        
        for(int i = 0; i < n; i++){
            boolean warenFlag = true;
            boolean samFlag = false;
            boolean samUpFlag = false;
            boolean sosuFlag = true;
            
            if(i != n - 1){
                if(a[i] == a[i + 1]){
                    samFlag = true;
                }
            }
            
            if(i != 0){
                if(a[i - 1] == a[i]){
                    samUpFlag = true;
                }
            }
            
            if(int j = 2; j * j < a[i]; j++){
                if(a[i] % j == 0){
                    sosuFlag = false;
                    break;
                }
            }
            
            if(a[0] != 1 && !sosuFlag){
                for(int j = 0; j < counter; j++){
                    if(a[i] / 2 < waren[j]){
                        break;
                    }
                    if(a[i] % waren[j] == 0){
                        warenFlag = false;
                        break;
                    }
                }
            }
                
            if(warenFlag && !samUpFlag){
                waren[counter] = a[i];
                counter++;
                if(samFlag){
                    samNum++;
                }
            }
        }
        
        System.out.println(counter - samNum);
        
    }
}


Compiler output:
Main.java:63: error: '.class' expected
            if(int j = 2; j * j < a[i]; j++){
                   ^
Main.java:63: error: not a statement
            if(int j = 2; j * j < a[i]; j++){
                                ^
Main.java:63: error: ';' expected
            if(int j = 2; j * j < a[i]; j++){
                                           ^
3 errors
Language: C++

#include<iostream>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<string>
#include<algorithm>
#include <vector>
#include<cstdio>
#include <numeric>
#include <queue>
#include <list>
#include <math.h>
#include <stdio.h>
#include <math.h>
#include <errno.h>
#include <fenv.h>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
long long mod=1000000007;
vector< int> divisor(int n) {
  vector< int > ret;
  for(int 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(){
  int N;cin>>N;
  vector<int>A(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  int ans=N;
  A.push_back(0);
  sort(A.begin(),A.end());
  if(A[1]==1){
    ans=0;
    cout<<ans<<endl;
  }
  
  
  
 else{
  if(B.size()==1)cout<<0<<endl;
  
  else{
  
  vector<int>B;
  for(int i=N-1;i>0;i++){
    if(A[i]==A[i-1]){
      ans-=1;
    }
    else B.push_back(A[i]);
  }
  sort(B.begin(),B.end());
  
  for(int i=0;i<B.size()-1;i++){
    vector<int>ret=divisor(B[i]);
    for(int j=0;j<ret.size();j++){
    auto itr=lower_bound(B.begin(), B.end(), ret[j]);
    if(itr!=B.end()){
     // cout<<"hi"<<endl;
      if(*itr==ret[j]){
        //cout<<"ihhi"<<" "<<*itr<<endl;
        ans-=1;
        break;
      }
    }
    }
  }
  cout<<ans<<endl;
  }
  }

  
  





}

Compiler output:
a.cc: In function 'int main()':
a.cc:55:6: error: 'B' was not declared in this scope
   55 |   if(B.size()==1)cout<<0<<endl;
      |      ^
a.cc:59:14: error: redeclaration of 'std::vector<int> B'
   59 |   vector<int>B;
      |              ^
a.cc:55:6: note: '<typeprefixerror>B' previously declared here
   55 |   if(B.size()==1)cout<<0<<endl;
      |      ^
Language: C++


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

class Link{
public:
    u_int32_t data;
    Link* next;

    Link::Link(u_int32_t data) {
        this->data = data;
        this-> next = NULL;
    }
};

void Main() {
    // input
    u_int32_t N;
    cin >> N;;

    vector<u_int32_t> nums(N);
    for (u_int32_t i = 0; i < N; i++) {
        cin >> nums[i];
    }

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

    Link* ans = new Link(nums[0]);
    Link* next = ans->next;
    for (int i = 1; i < nums.size(); i++) {
        next = new Link(nums[i]);
        next = next -> next;
    }

    Link* pre_i = NULL;
    for (Link* it_i = ans; it_i != NULL;) {
        Link* pre_j = it_i;
        bool same_flag = true;
        for (Link* it_j = it_i + 1; it_j != NULL; ) {
            
            if (it_j->data % it_i->data == 0) {
                if (it_j->data == it_i->data) {
                    same_flag = true;
                }
                pre_j->next = it_j->next;
                it_j = it_j->next;
            } else {
                pre_j = it_j;
                it_j = it_j-> next;
            }
        }
        if (same_flag) {
            pre_i->next = it_i->next;
            it_i = it_i->next;
        } else {
            pre_i = it_i->next;
            it_i = it_i->next;
        }
    }

    u_int32_t ans_num = 0;
    for (Link* it = ans; it != NULL; it++) {
        ans_num++;
    }

    cout << ans_num << endl;


    // translate


    // output

}

int main() {
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Compiler output:
a.cc:12:5: error: extra qualification 'Link::' on member 'Link' [-fpermissive]
   12 |     Link::Link(u_int32_t data) {
      |     ^~~~
a.cc: In function 'void Main()':
a.cc:28:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   28 |     sort(nums.begin(), nums.end());
      |     ^~~~
      |     short
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: expected ';' before 'int'
    5 |   cin>>n
      |         ^
      |         ;
    6 |   int arr[n];
      |   ~~~    
a.cc:11:5: error: 'arr' was not declared in this scope
   11 |     arr[i]=a;
      |     ^~~
a.cc:15:10: error: 'arr' was not declared in this scope
   15 |       if(arr[k]=arr[j]>0){
      |          ^~~