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

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

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


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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   18 |     if(cnt[x] != 0){
      |        ^~~
      |        int
a.cc:23:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |       cnt[x]++;
      |       ^~~
      |       int
a.cc:27:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   27 |     if(cnt[x] == 1){
      |        ^~~
      |        int
Language: C++

#include <bits/stdc++.h>
using namespace std;
bool prime(int n)
{
    if(n==2 || n==3 || n==5)
        return 1;
    else if(n==4)
        return 0;
    else
    {
        int flag=0;
        for(int i=2;i*i<=n;i++)
        {
            if(n%i==0)
                flag++;
        }
        if(flag==0)
            return 1;
        else
            return 0;
    }
}
int main()
{
    int n;
    cin>>n;
    int a[n];
    int flag=0;
    map<int,int> m;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        if(x==1)
            flag++;
        m[x]++;
    }
    if(flag==1)
        cout<<1;
    else if(flag>1)
        cout<<0;
    else
    {
        //sort(a,a+n);
        int itr=0;
        int count=0;
        for(auto i:m)
        {
            a[itr]=i->first;
            itr++;
        }
        for(int i=0;i<itr;i++)
        {
            int flag=0;
            if(m[a[i]]>1)
                continue;
            else if(prime(a[i]) && m[a[i]]==1)
                count++;
            else
            {
                for(int j=0;j<i;j++)
                {
                    if(i==j)
                        continue;
                    if(a[i]%a[j]==0)
                        flag++;
                }
                if(flag==0)
                    count++;
            }
        }
        cout<<count<<"\n";
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:21: error: base operand of '->' has non-pointer type 'std::pair<const int, int>'
   49 |             a[itr]=i->first;
      |                     ^~
Language: C++

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

using namespace std;

bool CheckValue(const vector<int>& a, int i, int n) {
	for (int j = n-1; j >= 0; j--){
		if (i == j) break;
		if (a[i] % a[j] == 0) return false;
	}
	return true;
}

int main()
{
	int  n;
	cin >> n;

	vector<int> a(n);

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

	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		if (CheckValue(a, i, n)) ans++;
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:41: error: missing template arguments before ')' token
   26 |         sort(a.begin(), a.end(), greater);
      |                                         ^
Language: C++

#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

const int MAX = 1e6 + 10;

int main() {
  ll n;
  cin >> n;
  vector<bool> div(MAX, false);
  rep(i, n) {
    int x;
    cin >> x;
    div[x] = true;
  }

  for (int i = 1; i < MAX; i++) {
    if (!div[i]) continue;
    for (int j = i + i; j < MAX; j += i) div[j] = false;
  }

  int ans = 0;
  for (int i = 1; i < MAX; i++) {
    if (div[i]) ans++;
  }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'll' was not declared in this scope
   11 |   ll n;
      |   ^~
a.cc:12:10: error: 'n' was not declared in this scope
   12 |   cin >> n;
      |          ^
Language: C++

using namespace std;

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

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

    int n;
    for (cin >> n; n--;) {
        int x;
        cin >> x;
        a[x]++;
    }
    for (int i = 1; i < N; i++) if (a[i]) {
        for (int j = i * 2; j < N; j += i)
            a[j] = 0;
    }
    cout << count(a + 1, a + N, 1) << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: 'ios_base' has not been declared
    7 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin.tie(nullptr);
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:20:5: error: 'cout' was not declared in this scope
   20 |     cout << count(a + 1, a + N, 1) << '\n';
      |     ^~~~
a.cc:20:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:13: error: 'count' was not declared in this scope
   20 |     cout << count(a + 1, a + N, 1) << '\n';
      |             ^~~~~
Language: C++

#include <vector>
#include <iostream>

using namespace std;

int main()
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  int N;
  cin >> N;
  vector<int> A(N, 0);
  for (int i = 0; i < N; ++i) {
    cin >> A.at(i);
  }

  const int max = *std::max_element(A.begin(), A.end());

  vector<bool> check(max+1, true);

  for (int i = 1; i < N; ++i) {
    if(!check[A[i]]) {
      continue;
    }
    if (max / 2 < A[i]) {
      continue;
    }
    for (int k = 2 * A[i]; k <= max; k+=A[i]) {
      check[k] = false;
    }
  }
  int count = 0;
  for (int i = 0; i < N; ++i) {
    if (i < N - 1 && A[i+1] == A[i]) {
      check.at(A[i]) = false;
    }
    if (check[A[i]]) {
      ++count;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'?
   18 |   const int max = *std::max_element(A.begin(), A.end());
      |                         ^~~~~~~~~~~
      |                         tuple_element
Language: C++

#include <bits/stdc++.h>
using namespace std;
const int m=1000005;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++)cin>>a[i];
  sort(a.begin(),a.end());
  vector<int> cnt(m);
  for(auto x:a){
    if(cnt[x]!=0){
      cnt[x]=2;
    }else{
      for(int i=x;i<m;i+=x;)cnt[i]++;
    }
  }
  int ans=0;
  for(auto x:a){
    if(cnt[x]==1)ans++;
  }
  cout<<ans<<endl;
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: expected ')' before ';' token
   15 |       for(int i=x;i<m;i+=x;)cnt[i]++;
      |          ~                ^
      |                           )
a.cc:15:28: error: expected primary-expression before ')' token
   15 |       for(int i=x;i<m;i+=x;)cnt[i]++;
      |                            ^
Language: C


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

int main() {

	int n;
	cin >> n;

	vector<int> a(n);
	map<int,int> count;
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		count[a[i]]++ ;
	}

	int res = 0;
	for(int i = 0; i < n; i++) {
		count[a[i]]--;
		bool flag = true;
		for(int j = 1 ; j*j <= a[i]; j++) {
			if((a[i]%j == 0)) {
				if((count[j] > 0) or (count[a[i]/j] > 0)) {
					flag = false;
					break;
				}
			}
		}
		if(flag) {
			res++;
		}
		count[a[i]]++;
	}

	cout << res <<"\n";
}



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

#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[200010];
bool f[1000010];
vector<int>p;
signed main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	for(int i=0;i<n;i++){
		if(i&&a[i]==a[i-1]&&p.size()&&p[p.size()-1]==a[i])p.pop_pack();
		if(!f[a[i]]){
			p.push_back(a[i]);
			for(int j=a[i];j<=1000000;j+=a[i]){
				f[j]=true;
			}
		}
	}
	cout<<p.size();
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:69: error: 'class std::vector<long long int>' has no member named 'pop_pack'; did you mean 'pop_back'?
   15 |                 if(i&&a[i]==a[i-1]&&p.size()&&p[p.size()-1]==a[i])p.pop_pack();
      |                                                                     ^~~~~~~~
      |                                                                     pop_back
Language: C++

#include<bits/stdc++.h>
using namespace std;
int m[1000005],s[1000005];
int main(){
	int a;
	cin>>a;
	for(int i=1;i<=a;i++){
		cin>>m[i];
		s[m[i]]++;
	}
	int ans=0;
	for(int i=1;i<=a;i++){
		int k=1;
		for(int j=1;j*j<=a;j++)
			if((!(a[i]%j))&&(s[m[i]]<2||s[m[i]]/j){
				k=0;
				break;
			}
		ans+=k;
	}
	cout<<ans;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: invalid types 'int[int]' for array subscript
   15 |                         if((!(a[i]%j))&&(s[m[i]]<2||s[m[i]]/j){
      |                                ^
a.cc:19:23: error: expected ')' before ';' token
   19 |                 ans+=k;
      |                       ^
      |                       )
a.cc:15:27: note: to match this '('
   15 |                         if((!(a[i]%j))&&(s[m[i]]<2||s[m[i]]/j){
      |                           ^
Language: C++

#include<iostream>
#include<vector>
#include<queue>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
#include<cstring>
#include<iomanip>
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define INF = 1000000100;
#define rep(i,n) for (int i=0;i<n;i++)

const int M=1000005;

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:11: error: 'n' was not declared in this scope
   23 |     rep(i,n) cin >> a[i];
      |           ^
a.cc:15:33: note: in definition of macro 'rep'
   15 | #define rep(i,n) for (int i=0;i<n;i++)
      |                                 ^
Language: C++

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

int main() {
  int n;
  cin>>n;
  vector<int>a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  sort(a.begin(),a.end());
  int amax=a[n-1]+1;
  bool dp[a[n-1]+1];
  for(int i=0;i<amax;i++) dp[i]=true;
  int i=0;
  int now=0;
  while(i<n){
    if(now!=a[i]){
      now=a[i];
      int bound=a[n-1]/now;
      for(int j=2;j<=bound;j++){
        bool[now*j]=false;
      }
    }
    else{
      bool[now]=false;
    }
  }
  int ans=0;
  for(int i=1;i<=a[n-1];i++){
    if(bool[i]) ans++;
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: expected ']' before '*' token
   20 |         bool[now*j]=false;
      |                 ^
      |                 ]
a.cc:20:13: error: structured binding declaration cannot have type 'bool'
   20 |         bool[now*j]=false;
      |             ^
a.cc:20:13: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:20:13: error: cannot decompose non-array non-class type 'bool'
a.cc:24:11: error: structured binding declaration cannot have type 'bool'
   24 |       bool[now]=false;
      |           ^~~~~
a.cc:24:11: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:24:11: error: cannot decompose non-array non-class type 'bool'
a.cc:29:12: error: expected unqualified-id before '[' token
   29 |     if(bool[i]) ans++;
      |            ^
Language: C++

#include <bits/stdc++.h>


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

    std::vector<unsigned int> b(1000000);
    for (int x : a) {
        if(b[x] == 1) {
            b[x]]++;
        }
        else {
            for(int j = x; j < 1000000; j += x) {
                b[j]++;
            }
        }
    }
    int count = 0;
    for(int i = 0;i<1000000;i++) {
        if(b[i] == 1) {
            count++;
        }
    }

    std::cout << count << std::endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: expected ';' before ']' token
   16 |             b[x]]++;
      |                 ^
      |                 ;
a.cc:16:16: warning: ignoring return value of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = unsigned int; _Alloc = std::allocator<unsigned int>; reference = unsigned int&; size_type = long unsigned int]', declared with attribute 'nodiscard' [-Wunused-result]
   16 |             b[x]]++;
      |                ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h:1128:7: note: declared here
 1128 |       operator[](size_type __n) _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
Language: C++

#include <bits/stdc++.h>


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

    std::vector<unsigned int> b(1000000);
    for (int x : a) {
        if(b[x] == 1) {
            b[j]++;
        }
        else {
            for(int j = x; j < 1000000; j += x) {
                b[j]++;
            }
        }
    }
    int count = 0;
    for(int i = 0;i<1000000;i++) {
        if(b[i] == 1) {
            count++;
        }
    }

    std::cout << count << std::endl;
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'j' was not declared in this scope
   16 |             b[j]++;
      |               ^
Language: C++

#include <bits\stdc++.h>
using namespace std;
const int INF=0x3f3f3f3f,maxn=2e5+10;
//vector<int>v[maxn];
//map<int,string>mp[maxn];
//queue<int>q[maxn];
int used[maxn],a[maxn],n,m;
int main()
{
	int i,j,k,ans=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	a[0]=-19999;
	for(i=1;i<=n;i++)
	{
		if(used[a[i]]==0)
		{
			if(a[i]!=a[i+1])
			{
				ans++;
			}
			for(j=1;j<=maxn/a[i];j++)
				used[a[i]*j]=1;
		}
	}
	cout<<ans<<endl;
	return 0;
}


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

#include <bits/stdc++.h>

#include <algorithm>
using namespace std;
struct Fast {
    Fast() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} fast;

long long mod = 1000000007;

long long modpow(long long m, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) {
        long long t = modpow(m, n / 2);
        return t * t;
    } else {
        return modpow(m, n - 1) * m;
    }
}
typedef long long ll;
typedef pair<ll, ll> P;

void yes() {
    cout << "Yes" << endl;
    exit(0);
}
void no() {
    cout << "No" << endl;
    exit(0);
}
#define REP(i, n) for (long long i = 0; i < (n); i++)
vector<long long> dijkstra(vector<vector<pair<long long, long long>>> graph, long long s) {
    vector<long long> ans(graph.size(), -1);
    priority_queue<pair<long long, long long>, vector<pair<long long, long long>>, greater<pair<long long, long long>>>
        pq;
    pq.push({0, s});
    while (pq.size() > 0) {
        ll cur1 = 0;
        ll cur2 = 0;
        if (ans[pq.top().second] != -1) {
            pq.pop();
        } else {
            cur1 = pq.top().first;
            cur2 = pq.top().second;
            pq.pop();
            ans[cur2] = cur1;
            for (long long i = 0; i < graph[cur2].size(); i++) {
                pq.push({cur1 + graph[cur2][i].second, graph[cur2][i].first});
            }
        }
    }
    return ans;
}
signed main() {
    long long n;
    cin >> n;
    vector<int> as(n);
    vector<int> cnt(1e6 + 23);
    REP(i, n) {
        cin >> as[i];
        cnt[as[i]]++;
    }
    sort(as.begin(), as.end());
    int ans = 0;
    REP(i, n) {
        if (cnt[as[i]] > 1) {
            // cout << as[i] << endl;
            continue;
        }
        bool div = false;
        for (int j = 1; (long long)j * j <= as[i]; j++) {
            // cout << as[j] << endl;
            if (as[i] % j == 0 && j != as[i]) {
                if (cnt[j] > 0) {
                    div = true;
                }
                if (cnt[(as[i] / j)] > 0 as[i] / j != as[i]) {
                    div = true;
                }
            }
        }
        if (div == false) {
            // cout << endl;
            ans++;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:81:41: error: expected ')' before 'as'
   81 |                 if (cnt[(as[i] / j)] > 0 as[i] / j != as[i]) {
      |                    ~                    ^~~
      |                                         )
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  vector<int> cnt(n);
  for(int i=0;i<n;i++){
     if(cnt[x]!=0){
       cnt[x]=2;
       continue;
     }
    for(int i=x;i<1000005;i+=x) cnt[i]++;
  }
  int ans=0;
  for(int x:a){
    if(cnt[x]==1) ans++;
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:13: error: 'x' was not declared in this scope
   11 |      if(cnt[x]!=0){
      |             ^
a.cc:15:15: error: 'x' was not declared in this scope
   15 |     for(int i=x;i<1000005;i+=x) cnt[i]++;
      |               ^
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++) cin>>a[i];
  vector<int> a(n);
  for(int i=0;i<n;i++){
     if(cnt[x]!=0){
       cnt[x]=2;
       continue;
     }
    for(int i=x;i<1000005;i+=x) cnt[i]++;
  }
  int ans=0;
  for(int x:a){
    if(cnt[x]==1) ans++;
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: redeclaration of 'std::vector<int> a'
    9 |   vector<int> a(n);
      |               ^
a.cc:7:15: note: 'std::vector<int> a' previously declared here
    7 |   vector<int> a(n);
      |               ^
a.cc:11:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   11 |      if(cnt[x]!=0){
      |         ^~~
      |         int
a.cc:11:13: error: 'x' was not declared in this scope
   11 |      if(cnt[x]!=0){
      |             ^
a.cc:15:15: error: 'x' was not declared in this scope
   15 |     for(int i=x;i<1000005;i+=x) cnt[i]++;
      |               ^
a.cc:15:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
   15 |     for(int i=x;i<1000005;i+=x) cnt[i]++;
      |                                 ^~~
      |                                 int
a.cc:19:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   19 |     if(cnt[x]==1) ans++;
      |        ^~~
      |        int
Language: C++

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
     if(cnt[x]!=0){
       cnt[x]=2;
       continue;
     }
    for(int i=x;i<1000005;i+=x) cnt[i]++;
  }
  int ans=0;
  for(int x:a){
    if(cnt[x]==1) ans++;
  }
  cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> a(n);
      |          ^~~
a.cc:8:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
    8 |      if(cnt[x]!=0){
      |         ^~~
      |         int
a.cc:8:13: error: 'x' was not declared in this scope
    8 |      if(cnt[x]!=0){
      |             ^
a.cc:12:15: error: 'x' was not declared in this scope
   12 |     for(int i=x;i<1000005;i+=x) cnt[i]++;
      |               ^
a.cc:12:33: error: 'cnt' was not declared in this scope; did you mean 'int'?
   12 |     for(int i=x;i<1000005;i+=x) cnt[i]++;
      |                                 ^~~
      |                                 int
a.cc:15:13: error: 'a' was not declared in this scope
   15 |   for(int x:a){
      |             ^
a.cc:16:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   16 |     if(cnt[x]==1) ans++;
      |        ^~~
      |        int
Language: C++

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

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

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

    vector<bool> dp(N, true);

    for (int i=0; i<N; i++){
        if (dp[i] == false){
            continue;
        }else if(count(A.begin(), A.end(), A[i]) > 1){
            dp[i] = false;
            continue;
        }
        for (int j=0; i+j+1<N; j++){
            if (A[i+j+1] % A[i] == 0){
                dp[i+j+1] = false;
            }
        }
    }

    int count = 0;
    for (int i=0; i<N; i++){
        if (dp[i] == true){
            count += 1;
        }
    }
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   13 |     sort(A.begin(), A.end());
      |     ^~~~
      |     short
a.cc:20:18: error: 'count' was not declared in this scope
   20 |         }else if(count(A.begin(), A.end(), A[i]) > 1){
      |                  ^~~~~
Language: C++

#include <bits/stdc++.h>
#define INF 1e18
#define Rep(i, a, n) for (ll i = (a); i < (n); i++)
#define rep(i, n) Rep(i, 0, n)
#define all(a) (a).begin(), (a).end()
#define MAX 100000*2
#define ll long long
#define P pair<int,int>
#define cout_set(n) cout << setprecision(10) << (n) << endl; 
const double PI=3.14159265358979323846;
using namespace std;
const int mod = 1000000007; 
int vy[4] ={1,-1,0,0}, vx[4] = {0,0,-1,1}; //up,down,left,right 
 ll list[MAX+1];
signed main(){
    ll n; cin >> n;
    vector<ll> a; rep(i,MAX+1) list[i] = 0;  
    rep(i,n){
        ll p;cin >> p;
        a.push_back(p);
    }
    //cout << 1 << endl;
    sort(a.begin(),a.end());
    vector<ll> b;
    ll t=0;
    while(t < n){
        ll k = a[t];
        b.push_back(k);
        while(t != n){
            if(a[t] != k) break;
            t++;
        }
    }

    ll cnt=0;
    rep(i,b.size()){
        ll k = b[i],p = 1;
        while(p*k <= MAX){
            list[p*k] ++;
            p++;
        }
    }
    
    rep(i,n){
        ll u = b[i];
        if(list[u] == 1) cnt++;
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:17:32: error: reference to 'list' is ambiguous
   17 |     vector<ll> a; rep(i,MAX+1) list[i] = 0;
      |                                ^~~~
In file included from /usr/include/c++/14/list:65,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:150,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:14:5: note:                 'long long int list [200001]'
   14 |  ll list[MAX+1];
      |     ^~~~
a.cc:39:13: error: reference to 'list' is ambiguous
   39 |             list[p*k] ++;
      |             ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:14:5: note:                 'long long int list [200001]'
   14 |  ll list[MAX+1];
      |     ^~~~
a.cc:46:12: error: reference to 'list' is ambiguous
   46 |         if(list[u] == 1) cnt++;
      |            ^~~~
/usr/include/c++/14/bits/stl_list.h:633:11: note: candidates are: 'template<class _Tp, class _Alloc> class std::__cxx11::list'
  633 |     class list : protected _List_base<_Tp, _Alloc>
      |           ^~~~
a.cc:14:5: note:                 'long long int list [200001]'
   14 |  ll list[MAX+1];
      |     ^~~~
Language: C

#include <stdio.h>
const int N = 1000001;
int c[N],a[200000],n, p[N],ans;
int main(void){
    scanf("%d",&n);
    for(int i=0;i<n;++i){
        scanf("%d",&a[i]);
        ++c[a[i]];
    }
    for(int i=2;i<N;++i){
        if(!p[i]){
            for(int j=i+i;j<N;j+=i) p[j] = 1;
        }
    }
    for(int i=2;i<N;++i){
        if(!p[i]){
            for(int j=1,jj=i;jj<N;++j,jj+=i) c[jj]+=c[j];
        }
    }
    for(int i=0;i<n;++i) if(c[a[i]] == 1) ++ans;
    printf("%d",ans);
}




Compiler output:
main.c:3:5: error: variably modified 'c' at file scope
    3 | int c[N],a[200000],n, p[N],ans;
      |     ^
main.c:3:23: error: variably modified 'p' at file scope
    3 | int c[N],a[200000],n, p[N],ans;
      |                       ^
Language: Java

import java.util.*;
public class Atcodepro4{

     public static void main(String []args){
        
        Scanner sc=new Scanner(System.in);
        
               int x=sc.nextInt();
               int arr[]=new int[x];
               for(int i=0;i<x;i++){
                 arr[i]=sc.nextInt();
                 }
               
               int count=0;
               for(int i=0;i<x;i++)
               {
                   for(int j=0;j<x;j++)
                   {
                       if(arr[i]!=arr[j] && arr[i]%arr[j]==0)
                       {




                           count++;
                           break;
                       }
                   }
               }
               if(count>0)
               System.out.println(x-count);
               else
               System.out.print("0");
        }

     }


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

#include <bits/stdc++.h>

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

    int count = 0;
    int flag = 0
    for (int i = 0;i<N-1;i++) {
        for(int j = i+1;j < N;j++) {
            if (a[i] % a[j] == 0) {
                flag = 1;
                break;
            }
        }
        if (flag == 0) {
            count++;
        }
        flag = 0;
    }
    std::cout << count << std::endl;
    return 0;

}

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

#include<bits/stdc++.h>
using namespace std;
#define ff                first
#define ss                second
#define int              long long
#define pb                push_back
#define mp                make_pair
#define li                list<int>
#define pii               pair<int,int>
#define vit                vector<int>
#define mii               map<int ,int>
#define setbits(x)        __builtin_popcountll(x)
#define zrobits(x)        _builtin_ctzll(x)
#define mod               1000000007
#define inf               1e18
#define ln                cout<<'\n'
#define ps(x,y)           fixed<<setprecision(y)<<x
#define mk(arr,n,type)    type *arr=new type(n);
#define w(x)              int x; cin>>x; while(x--)
#define all(x)            (x).begin(), (x).end()
#define PI                3.14159265358979
#define p_sieve           100000
const ll MAX = 1e9 + 7, MAXL = 1LL << 61, dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1}, dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

void c_p_c()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("g.txt", "r", stdin);
	freopen("b.txt", "w", stdout);
#endif
}

int  d[1111111], c[1111111];
void solve()
{
	int n; cin >> n;
	int  a[n];
	for (ll i = 0; i < n; i++)
	{
		cin >> a[i];
		d[a[i]]++;
	}
	int counter = 0;
	for (int i = 1; i <= 1111111; i++)
	{
		if (d[i])
			for (int j = i * 2; j <= 1111111; j += i)c[j]++;
	}
	for (int i = 0; i < n; i++)
	{
		if (d[a[i]] == 1 && !c[a[i]])counter++;
	}
	cout << counter;
}

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

}


Compiler output:
a.cc:23:7: error: 'll' does not name a type; did you mean 'ln'?
   23 | const ll MAX = 1e9 + 7, MAXL = 1LL << 61, dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1}, dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
      |       ^~
      |       ln
a.cc:23:79: error: expected unqualified-id before ',' token
   23 | const ll MAX = 1e9 + 7, MAXL = 1LL << 61, dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1}, dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
      |                                                                               ^
a.cc:23:87: error: expected constructor, destructor, or type conversion before '=' token
   23 | const ll MAX = 1e9 + 7, MAXL = 1LL << 61, dx[8] = { -1, 0, 1, 0, -1, -1, 1, 1}, dy[8] = {0, 1, 0, -1, -1, 1, 1, -1};
      |                                                                                       ^
a.cc: In function 'void solve()':
a.cc:40:14: error: 'll' was not declared in this scope; did you mean 'ln'?
   40 |         for (ll i = 0; i < n; i++)
      |              ^~
      |              ln
a.cc:40:24: error: 'i' was not declared in this scope
   40 |         for (ll i = 0; i < n; i++)
      |                        ^
Language: C++

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

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

    int M = a[n - 1];
    int d[200000] = {0};

    for(int i = 0;i < n;i++){
        for(int j = 1;j*a[i] <= M;j++){
            d[a[i]*j]++;
        }
    }

    /*
    for(int i = 1;i <= M;i++){
        cout << d[i] << " ";
    }

    cout << endl;
    */

    int ans = 0;
    for(int i = 0;i < n;i++){
        if(d[a[i]] == 1){
            ans += 1;
        }
    }

    cout << ans << endl;

    
}

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

#include <bits/stdc++.h>

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

    int count = 0;
    for (int i = 0;i<N-1;i++) {
        for(int j = i+1;j < N;j++) {
            if (a[i] % a[j] = 0) {
                break;
            }
            count++;
        }
    }
    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: lvalue required as left operand of assignment
   15 |             if (a[i] % a[j] = 0) {
Language: C++

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

using namespace std;

#define MAX_N 200000
#define MAX_A 1000000

int A[MAX_N + 1];   // array
bool dp[MAX_A + 1]; // when any divisor of `n` which is less than `n` does'nt
                    // exist in `A`, `dp[i] = true`

int main( int argc, char **argv )
{
    // handling inputs
    int N; // number of array
    cin >> N;

    int a_max = 0;
    for ( int i = 0; i < N; i++ )
    {
        cin >> A[i];
        a_max = max( a_max, A[i] );
    }

    // initialize
    memset( dp, true, a_max + 1 );
    sort( A, ( A + N ) );

    for ( int i = 0; i < N; i++ )
    {
        auto a = A[i];
        if ( i > 1 && a == A[i - 1] ) dp[a] = false;
        if ( dp[a] )
            for ( int b = 2 * a; b <= a_max; b += a ) dp[b] = false;
    }

    int ans = 0;
    for ( int i = 0; i < N; i++ )
    {
        auto a = A[i];
        if ( dp[a] ) ans++;
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:28:5: error: 'memset' was not declared in this scope
   28 |     memset( dp, true, a_max + 1 );
      |     ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include <vector>
  +++ |+#include <cstring>
    4 |
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cctype>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

int main(){
	int n;
	cin>>n;
	vector<int>a(n);
	rep(i,n)cin>>a[i];
	sort(a.begin(),a.end());
	int cnt=0,tar;
	while(a.size()>0){
		tar=a[0];
		a.erase(std::remove_if(a.begin(),a.end(),[](int n)->bool{return n%tar==0;}),a.end());
		//a.erase(std::remove_if(a.begin(),a.end(),[]{return true;}),a.end());
		cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

Compiler output:
a.cc: In lambda function:
a.cc:18:83: error: 'tar' is not captured
   18 |                 a.erase(std::remove_if(a.begin(),a.end(),[](int n)->bool{return n%tar==0;}),a.end());
      |                                                                                   ^~~
a.cc:18:59: note: the lambda has no capture-default
   18 |                 a.erase(std::remove_if(a.begin(),a.end(),[](int n)->bool{return n%tar==0;}),a.end());
      |                                                           ^
a.cc:15:19: note: 'int tar' declared here
   15 |         int cnt=0,tar;
      |                   ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll mod=1000000007;
const int MAX_N = 1000;         // n の最大値
 
int main() {
ll n;
cin>>n;
ll f=0;
ll counter=0;
ll a[n]={};
ll ans=0;
ll dp[1000010]={};
set <ll> q;
for(ll i=0; i<n; i++){
cin>>a[i];}
sort(a,a+n);
if(a[0]==1){
if(a[1]==1){
cout<<0<<endl;}
else
cout<<1<<endl;}
else{
for(ll i=0; i<n; i++){
f=a[i];
if(q.count(f))continue;
q.insert(f);
for(ll k=1; k*f<=1000000; k++){
dp[f*k]=-1;
}}
for(ll i=0; i<n; i++){
if(dp[a[i]]!=-1)
counter++;}
cout<<counter<<endl;}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:22: error: expected '}' at end of input
   36 | cout<<counter<<endl;}
      |                      ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=2147483647;
const double pi=3.1415926535897932384626;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
const int maxn=1e6+5;
int n,ans;
int main(){
	n=read();
	vecotr<int> a(n);
	vector<int> vis(maxn);
	for(int i=1;i<=n;i++) a[i]=read(),++vis[a[i]];
	for(int i=1;i<=n;i++){
		int x=a[i],num=(x<<1);
		if(vis[x]==1) ++ans;
		while(num<maxn){
			++vis[num];
			num+=x;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:9: error: 'vecotr' was not declared in this scope
   23 |         vecotr<int> a(n);
      |         ^~~~~~
a.cc:23:16: error: expected primary-expression before 'int'
   23 |         vecotr<int> a(n);
      |                ^~~
a.cc:25:31: error: 'a' was not declared in this scope
   25 |         for(int i=1;i<=n;i++) a[i]=read(),++vis[a[i]];
      |                               ^
a.cc:27:23: error: 'a' was not declared in this scope
   27 |                 int x=a[i],num=(x<<1);
      |                       ^
a.cc:29:23: error: 'num' was not declared in this scope; did you mean 'enum'?
   29 |                 while(num<maxn){
      |                       ^~~
      |                       enum
Language: C++

#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){ 
  int n; cin >> n;
  vector<ll> A(n), judge(n+10);
  vector<vector<ll>> yaku(n); 
  rep(i, n){
    cin >> A[i];
    cnt[A[i]]++;
  }
  sort(all(A));
  int res = 0;
  rep(i, n){
    if(i<n-1 && A[i] == A[i+1]) continue;
    if(judge[A[i]] == false) res++;
    for(int num = A[i]; num <= n; num += A[i]){
	judge[num] = true;
    }
  }

  cout << res << ln;

Compiler output:
a.cc: In function 'int main()':
a.cc:23:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   23 |     cnt[A[i]]++;
      |     ^~~
      |     int
a.cc:35:21: error: expected '}' at end of input
   35 |   cout << res << ln;
      |                     ^
a.cc:17:11: note: to match this '{'
   17 | int main(){
      |           ^
Language: C

#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define PI acos(-1)
typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;

/*
 * 素数 prime なら 1 を返す
*/
int isPrime(int n) {
  int sqrtn;

  sqrtn = (int)sqrt((double)n);
  if (n < 2) {
    return (0);
  } else if (n == 2) {
    return (1);
  }

  for (int i = 2; i <= sqrtn + 1; i++) {
    if (n % i == 0) {
      return (0);
    }
  }
  return (1);
}

int main(void) {
  /* 標準入力フラグ */
  int   scan;

  /* 数入力 */
  int    answer;
  int    n;
  int    *a;
  answer = 0;
  scan = scanf("%d", &n);
  a = (int *)malloc(sizeof(int) * n);
  for (int i = 0; i < n; i++) {
    scan = scanf("%d", &a[i]);
  }

  int   *result;
  result = (int *)malloc(sizeof(int) * n);
  /* プログラムを書く */

  for (int i = 0; i < n; i++) {
    result[i] = 1;
    // Ai が素数なら 1 固定
    // Ai が素数でなければ割り算する
    if (!is_prime(a[i])) { 
      for (int j = 0; j < n; j++) {
        if (i != j && a[i] >= a[j]) { 
          if (a[i] % a[j] == 0) {
            result[i] = 0;
          }
        }
      }
    }
  }


  for (int i = 0; i < n; i++) {
    answer += result[i];
  }
  printf("%d", answer);

  return (0);
}



Compiler output:
main.c: In function 'main':
main.c:55:10: error: implicit declaration of function 'is_prime'; did you mean 'isPrime'? [-Wimplicit-function-declaration]
   55 |     if (!is_prime(a[i])) {
      |          ^~~~~~~~
      |          isPrime
Language: Java

import java.util.*;

public class Main {

	private static List<Integer> getStrings(Scanner sc, int num) {
		List<Integer> stringList = new ArrayList<>();
		while(num>0) {
			int nextInt = sc.nextInt();
			stringList.add(nextInt);
			num--;
		}
		return stringList;
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		List<Integer> array = getStrings(sc, n);
		array.sort(Integer::compareTo);
		Set<Integer> set = new HashSet<>();
		int max = array.get(array.size()-1);
		int count = 0;
		for (int i = 0; i < array.size(); i++) {
			for (int j = 2; j <= max/array.get(i) + 1; j++) {
				set.add(array.get(i) * j);
			}
			if (i != array.size()-1 && array.get(i).intValue() == array.get(i+1).intValue()) {
				continue;
			} else if (i != 0 && array.get(i).intValue() == array.get(i-1).intValue()) {
				continue;
			}
			if (!set.contains(array.get(i))) {
				count++;
//				System.out.print(array.get(i) + ", ");
			}
		}
		System.out.println(count);
		return;
		Integer
	}

}
//12, 18, 28, 44, 47, 61, 76, 81, 86, 102, 105, 158, 159, 201, 205, 219, 236, 238, 239, 253, 254, 257, 261, 268, 272, 275, 283, 285, 298, 299, 314, 350, 398, 406, 421, 454, 455, 473, 513, 520, 548, 556, 565, 590, 613, 617, 641, 677, 697, 699, 734, 749, 755, 772, 834, 851, 866, 871, 873, 877, 885, 916, 921, 938, 951, 965, 994,
//12, 18, 28, 44, 47, 61, 76, 81, 86, 102, 105, 158, 159, 201, 205, 219, 236, 238, 239, 253, 254, 257, 261, 268, 272, 275, 283, 285, 298, 299, 314, 350, 398, 406, 421, 454, 455, 473, 513, 520, 548, 556, 565, 590, 613, 617, 641, 677, 697, 699, 734, 749, 755, 772, 814, 814, 834, 851, 866, 871, 873, 877, 885, 913, 913, 916, 921, 938, 951, 965, 994, 999, 999

Compiler output:
Main.java:39: error: not a statement
		Integer
		^
Main.java:39: error: ';' expected
		Integer
		       ^
2 errors
Language: C++

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

using namespace std;

int SetInput( vector<int>& vec )
{
    int size;
    cin >> size;
    for(int i = 0; i < size; ++i )
    {
        int value;
        cin >> value;
        vec.emplace_back( value );
    }
}

int Calc( vector<int>& input )
{
    // ふるい
    const int max = 1000000;
    int sieve[max] = { 0 };

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

    for( const int& i : input )
    {
        sieve[i]++;
    }

    int count = 0;

    auto iter = input.begin();
    for( ; iter != input.end(); ++iter )
    {
        const int& i = *iter;
        const int& s = sieve[i];

        if( s == 1 ) {
            ++count;

            const int maxMul = max / s;
            for( int mul = 2; mul < maxMul; ++mul )
            {
                ++sieve[s * mul];
            }
        }
    }

    return count;
}

int main()
{
    const int N = 2000000;
    
    vector<int> input;
    input.reserve(N);

    SetInput( input );

    int ans = Calc( input );

    cout << ans << endl;


Compiler output:
a.cc: In function 'int SetInput(std::vector<int>&)':
a.cc:17:1: warning: no return statement in function returning non-void [-Wreturn-type]
   17 | }
      | ^
a.cc: In function 'int main()':
a.cc:65:25: error: expected '}' at end of input
   65 |     cout << ans << endl;
      |                         ^
a.cc:55:1: note: to match this '{'
   55 | {
      | ^
Language: C++

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

const int M = 1000005;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: 'N' was not declared in this scope
   18 |     for (int i = x; i < N; i+= x) cnt[i]++;
      |                         ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'M' was not declared in this scope
   10 |   vector<int> cnt(M);
      |                   ^
a.cc:16:25: error: 'N' was not declared in this scope
   16 |     for (int i = x; i < N; i+= x) cnt[i]++;
      |                         ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i,n) cin >> a[i];
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i,n) cin >> a[i];
      |   ^~~
a.cc:9:19: error: 'M' was not declared in this scope
    9 |   vector<int> cnt(M);
      |                   ^
a.cc:15:25: error: 'N' was not declared in this scope
   15 |     for (int i = x; i < N; i+= x) cnt[i]++;
      |                         ^
Language: C++

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


bool can_devid[2e5+11];
//bool can_devid[100];

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

    set<long long> s;
    set<long long> ng;

    for(long long i=0; i<N; ++i){
        long long a;
        cin >> a;
        if(ng.count(a) > 0) continue;

        if( s.count(a) > 0 ){
            s.erase(a);
            ng.insert(a);
        }else{
            s.insert(a);
        }
    }

    set<long long> ans;
    for(auto i: s){
        if(can_devid[i] == false){
            ans.insert(i);
            for(long long j=2; i*j<=200010; j++){
                can_devid[i*j] = true;
            }
        }
    }

        cout << ans.size() << endl;
}

Compiler output:
a.cc:8:19: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    8 | bool can_devid[2e5+11];
      |                ~~~^~~
a.cc:8:19: error: could not convert '(2.0e+5 + (double)11)' from 'double' to 'long unsigned int'
    8 | bool can_devid[2e5+11];
      |                ~~~^~~
      |                   |
      |                   double
a.cc:8:19: error: size of array 'can_devid' has non-integral type 'double'
Language: C

    #include <bits/stdc++.h>
    #define rep(i,n) for (int i = 0; i < (n); ++i)
    using namespace std;
    using ll = long long;
    using P = pair<int,int>;
     
    const int M = 1000005;
     
    int main() {
      int n;
      cin >> n;
      vector<int> a(n);
      rep(i,n) cin >> a[i];
      vector<int> cnt(M);
      for (int x : a) {
        if (cnt[x] != 0) {
          cnt[x] = 2;
          continue;
        }
        for (int i = x; i < M; i += x) cnt[i]++;
      }
      int ans = 0;
      for (int x : a) {
        if (cnt[x] == 1) ans++;
      }
      cout << ans << endl;
      return 0;
    }

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

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

using namespace std;
typedef long long ll;

int main() {
    ll N;
    cin >> N;
    ll B[1000001];
    for(ll i=0;i<1000001;i++) B[i] = 0;
    ll A[N];
    for(ll i=0;i<N;i++){
        cin >> A[i];
        B[A[i]]++;
    }
    ll out = N;
    for(ll i=0;i<N;i++){
        for(ll j=1;j<=sqrt(A[i]);j++){
            if(A[i]%j==0){
                if(j==1){
                    if(B[A[i]/j]>1){
                        out--;
                        break;
                    }
                }else if(B[j]>0||B[A[i]/j]>0){
                    out--;
                    break;
                }else if(){
                    out--;
                    break;
                }
            }
        }
    }
    cout << out << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:26: error: expected primary-expression before ')' token
   30 |                 }else if(){
      |                          ^