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

#ifdef _MSC_VER
#include <__msvc_all_public_headers.hpp>
#undef min
#undef max
#else
#define NDEBUG
#include <bits/stdc++.h>
#endif

using namespace std;
using large = long long;

int main() {
    int x, n;
    cin >> x >> n;
    auto p = unordered_set<int>(n);
    for (auto i = 0; i < n; ++i) {
        auto x = 0;
        cin >> x;
        p.insert(x);
    }

    auto ans = 0;
    for (auto dist = 0;; ++dist) {
        auto smaller = x - dist;
        auto larger = x + dist;
        if (!p.contains(smaller)) {
            ans = smaller;
            break;
        }
        if (!p.contains(larger)) {
            ans = larger;
            break;
        }
    }

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


Compiler output:
a.cc: In function 'int main()':
a.cc:27:16: error: 'class std::unordered_set<int>' has no member named 'contains'
   27 |         if (!p.contains(smaller)) {
      |                ^~~~~~~~
a.cc:31:16: error: 'class std::unordered_set<int>' has no member named 'contains'
   31 |         if (!p.contains(larger)) {
      |                ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const ll MOD = (ll)1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

ll fac[1] = {1}, inv[1] = {1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
ll cmb(ll r, ll c) {return fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

priority_queue<int, vector<int>, greater<int>> pq;
vector<int> v;

char visit[201];

int main() {
    int n, x;
    scanf("%d %d", &x, &n);

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

    int mav = 1e9;
    int mavi;
    for (int i = -100; i <= 0; i++) {
        if (mav > abs(i-x)) {
            mav = abs(i-x);
            mavi = i;
        }

    }
    for (int j = 1; j <= 200; j++) {
        if (!visit[j] && mav > abs(j-x)) {
            mav = abs(j-x);
            mavi = j;
        }
        else if (!visit[j] && mav == abs(j-x))
            mavi =min(mavi, j);
    }

    printf("%d", mavi);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:9: error: reference to 'visit' is ambiguous
   36 |         visit[t]++;
      |         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:27:6: note:                 'char visit [201]'
   27 | char visit[201];
      |      ^~~~~
a.cc:49:14: error: reference to 'visit' is ambiguous
   49 |         if (!visit[j] && mav > abs(j-x)) {
      |              ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:27:6: note:                 'char visit [201]'
   27 | char visit[201];
      |      ^~~~~
a.cc:53:19: error: reference to 'visit' is ambiguous
   53 |         else if (!visit[j] && mav == abs(j-x))
      |                   ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:27:6: note:                 'char visit [201]'
   27 | char visit[201];
      |      ^~~~~
Language: C++

#include <cstdio>

using namespace std;

int x, n;
bool used[105];

int main() {
  scanf("%d%d", &x, &n);
  for (int i = 0; i < n; i++) {
    int p; scanf("%d", &p);
    used[p] = true;
  }
  for (int i = 0; i < 100; i++) {
    if (used[x - i]) {
      printf("%d\n", x - i);
      return 0;
    if (used[x + i]) {
      printf("%d\n", x + i);
      return 0;
    }
  }
}

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

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


#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)

 
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

void mod_print(ll k){
    ll P=1000;
    rep(y,1,P){
        ll x=mod(y*k);
        if(x+P>=i_7){
            x-=i_7;
        }
        if(abs(x)<=P){
            cout<<x<<"/"<<y<<endl;
            return;
        }
    }
    cout<<"nun"<<endl;
}
#define all(c) c.begin(),c.end()
//////////////////////////

ll N=1000;
bool a[N];
int main(){fastio
    
    ll x,n;cin>>x>>n;
    rep(i,0,n-1){
        ll c;cin>>c;
        a[c]=true;
    }
    ll mi=0;
    rep(i,1,N-1){
        if(a[i])continue;
        if(abs(i-x)<abs(mi-x))mi=i;
    }
    cout<<mi;
    
    return 0;
}


Compiler output:
a.cc:7:10: fatal error: boost/multiprecision/cpp_int.hpp: No such file or directory
    7 | #include "boost/multiprecision/cpp_int.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>
#include <fstream>
#include <cassert>
#pragma region ACL
#include <atcoder/fenwicktree>
//#include <atcoder/math>
#include <atcoder/string>
#pragma endregion

using namespace std;
using namespace atcoder;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	int n; cin >> n;
	vector<int> a(n); rep(i, n)cin >> a[i];
	sort(all(a));
	vector<bool> used(1001001);
	int res = 0;
	rep(i, n)
	{
		if (used[a[i]])continue;
		if (i + 1 < n && a[i] != a[i + 1])++res;
		else if (i == n - 1)++res;
		for (int j = a[i]; j <= 1000000; j += a[i])used[j] = true;
	}
	cout << res << endl;
}

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


	#ifndef ONLINE_JUDGE
	    freopen("input.txt","r",stdin);
	    freopen("output.txt","w",stdout);
	#endif


Compiler output:
a.cc:3:20: error: expected constructor, destructor, or type conversion before '(' token
    3 |             freopen("input.txt","r",stdin);
      |                    ^
a.cc:4:20: error: expected constructor, destructor, or type conversion before '(' token
    4 |             freopen("output.txt","w",stdout);
      |                    ^
Language: C++

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

int main(){
  int N;cin>>N;
  vector<int> A(N);
  vector<int> B(1000010,0);
  set<int> S;
  for(int i=0;i<N;i++){
    cin>>A.at(i);
    B.at(A.at(i))++;
    S.insert(A.at(i));
  }
  bool flag(1000010,false);
  for(int i:S){
    for(int j=2;j<1000001;j++){
      if(i*j>=1000001) break;
      flag.at(i*j)=true;
    }
  }
  int ans=0;
  for(int i=0;i<N;i++){
    if(B.at(A.at(i))==1 && !flag(A.at(i))) ans++;
  }
  cout<<ans<<"\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:26: error: expression list treated as compound expression in initializer [-fpermissive]
   14 |   bool flag(1000010,false);
      |                          ^
a.cc:18:12: error: request for member 'at' in 'flag', which is of non-class type 'bool'
   18 |       flag.at(i*j)=true;
      |            ^~
a.cc:23:33: error: 'flag' cannot be used as a function
   23 |     if(B.at(A.at(i))==1 && !flag(A.at(i))) ans++;
      |                             ~~~~^~~~~~~~~
Language: C++

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

int main(){
  int N;cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++) cin>>A.at(i);
  sort(A.begin(),A.end());
  vector<bool> prime(A.at(N-1)+1,true);
  for(int i=0;i<N;i++){
    if(prime.at(A.at(i))){
      for(int j=A.at(i)*2;j<A.at(N-1);j+=A.at(i)){
        if(prime.at(j)) prime.at(j)=false;
      }
    }
    if(N>1){
      if(i==0 && A.at(i)==A.at(i+1)) prime.at(i)=false;
      else if(i==N-1 && A.at(i)==A.at(i-1)) prime.at(i)=false;
      else if(N>2){
        if(A.at(i)==A.at(i-1) || A.at(i)==A.at(i-1))) prime.at(i)=false;
      }
    }
  }
  int ans=0;
  for(int i=0;i<N;i++) if(prime.at(i)) ans++;
  cout<<ans<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:53: error: expected primary-expression before ')' token
   20 |         if(A.at(i)==A.at(i-1) || A.at(i)==A.at(i-1))) prime.at(i)=false;
      |                                                     ^
Language: C++

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

int main(){
  int N;cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++) cin>>A.at(i);
  sort(A.begin(),A.end());
  //set<int> B;
  vector<int> C;
  for(int i=0;i<N;i++){
    if(i==0){
      if(A.at(i)!=A.at(i+1)){
       // B.insert(A.at(i));
        C.push_back(A.at(i));
      }
    }
    else if(i==N-1){
      if(A.at(i-1)!=A.at(i)){
        //B.insert(A.at(i));
        C.push_back(A.at(i));  
        }
    }
    else{
      if(A.at(i-1)!=A.at(i) && A.at(i)!=A.at(i+1)){
        //B.insert(A.at(i));
        C.push_back(A.at(i));
        }
    }
  }
  int l=C.size();
  int ans=0;
  if(l>0){
   // vector<bool> D(l,true);
    set<int> E;
    for(int j=0;j<l;i++) E.insert(j);
    for(int i=0;i<l;i++){
      if(!E.count(i)) continue;
      int X=A.at(i);//これはsetの中に存在する
      for(auto value:E){
        if(value==i) continue;
        if(C.at(value)%X==0){
         // B.erase(C.at(value));
          E.erase(value);
        }
      }
    }
    ans=E.size();
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: 'i' was not declared in this scope
   36 |     for(int j=0;j<l;i++) E.insert(j);
      |                     ^
Language: C

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#define rep(i, n) for(long long int i = 0; i < (n); i++)
using namespace std;
using P = pair<long long int, long long int>;
long long int mod = (long long int) 1e9 + 7;

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

    vector<long long int> a(n, 0);
    vector<long long int> b(1000001, 0);
    vector<long long int> c(1000001, 1);
    

    rep(i, n){
        long long int x;
        cin >> x;
        a[i] = x;
        b[x]++;
    }
    
    sort(a.begin(), a.end());
    
    rep(i, n){
        
        if(c[a[i]] == 0) continue;
        
        for(long long int j = 2; j < 1000001; j++){
            if (j * a[i] > 1000000) continue;
            c[a[i] * j] = 0;
        }
    }

    long long int count = 0;

    rep(i, n) if(b[a[i]] == 1 && c[a[i]] == 1) count++;
    
    cout << count << "\n";

    return 0;
}




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

#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using P = pair<int, int>;
int mod = (int) 1e9 + 7;

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

    vector<int> a(n, 0);
    vector<int> b(1145140, 0);
    vector<int> c(1145140, 1);
    

    rep(i, n){
        int x;
        cin >> x;
        a[i] = x;
        b[x]++;
    }
    
    sort(a.begin(), a.end());
    
    rep(i, n){
        
        if(c[a[i]] == 0) continue;
        
        for(int j = 2; j < 100001; j++){
            if (j * a[i] > 100001) continue;
            c[a[i] * j] = 0;
        }
    }

    int count = 0;

    rep(i, n) if(b[a[i]] == 1 && c[a[i]] == 1) count++;
    
    cout << count << "\n";

    return 0;
}




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

#include <bits/stdc++.h>

using namespace std;

using llong = long long int;

#define rep(i, n) for (int i = 0; i < n; ++i)
#define stl_rep(itr, x) for (auto itr = x.begin(); itr != x.end(); ++itr)
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()

const static int MOD = 1000000007;
const static int INF = 1<<30;
const static int dx[4] = {1, 0, -1, 0};
const static int dy[4] = {0, 1, 0, -1};

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    vector<int> A(n);
    map<int, int> M;
    rep(i, n) {
        cin >> A[i];
        ++M[A[i]];
    }

    sort(all(A));

    int maxA = A[n - 1] + 100;
    vector<bool> check_table(maxA + 1, false);
    int k;
    rep(i, n) {
        k = 2;
        while (A[i]*k <= maxA) {
            check_table[A[i]*k] = true;
            ++k;
        }
    }

    // A.erase(unique(all(A)), A.end());
    // int ans = 0;
    rep(i, (int)A.size()) {
        if (! check_table[A[i]] && M[A[i]] == 1) ++ans;
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:46:52: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |         if (! check_table[A[i]] && M[A[i]] == 1) ++ans;
      |                                                    ^~~
      |                                                    abs
a.cc:49:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   49 |     cout << ans << endl;
      |             ^~~
      |             abs
Language: C++

n=int(input())
a=list(sorted(map(int,input().split())))
d=[0 for i in range(a[-1]+1)]
c=0
for i in range(len(a)):
  if d[a[i]]:
    continue
  if i==len(a)-1 or a[i]!=a[i+1]:
    c+=1
  for j in range(a[i],a[-1]+1,a[i]):
    d[j]=1
print(c)

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n=int(input())
      | ^
Language: C++

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

template<class T> inline bool chmin(T& a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmax(T& a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
struct Unionfind {
    vector<int> par;

    Unionfind(int n) : par(n) {
        for(int i = 0; i < n; ++i) par[i] = i;
    }

    int root(int x) {
        if(par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if(rx == ry) return;
        par[rx] =ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

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

    int n;
    cin >> n;

    const int num = 200010;
    vector<int> cnt(num, 0);
    vector<int> a(n);
    rep(i, n) {
        cin >> a[i];
        for(int j = a[i]; j <= num; j += a[i]) {
            ++cnt[j];
            
    }

    int ans = 0;
    rep(i, n) {
        if(cnt[a[i]] == 1) ++ans;
    }
    cout << ans << endl;
    return 0;
}



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

#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define rrep(i, n) for (int i = (int)n-1; i >= 0; --i)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
const int mod = 1e9+7;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;

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; }

__attribute__ ((constructor))
void init() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
}

signed main(){
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    vector<int> div(1000100,0);
    rep(i,n){
        div[v[i]]++;
    }
    int ans = 0;
    rep(i,n){
        bool ok = 1;
        //cout << v[i] << "tern" << endl;
        for(auto u : calc_divisor(v[i])){
            if(div[u]>0 && u != v[i]){
                //cout << u << endl;
                ok = 0;
                break;
            }
        }
        if(div[v[i]] > 1) ok = 0;
        if(ok) ans++;
    }
    cout << ans << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:22: error: 'calc_divisor' was not declared in this scope
   37 |         for(auto u : calc_divisor(v[i])){
      |                      ^~~~~~~~~~~~
Language: C++

//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
const int mod =1e+9+7;

const int dy[4]={0,1,0,-1};
const int dx[4]={1,0,-1,0};
const ll INF=1e10;
int main(){
    ll n; cin>>n;
    vector<ll>a(n);
    rep(i,n)cin>>a[i];
    vector<ll>cnt(1e6+10,0);

    for(auto x:a){
               if(cnt[x]!=0){
            cnt[x]=2;
            continue;
        
            for(ll i=x;i<1e6+10;i+=x){
                cnt[i]++;

        }
    }
    ll ans=0;
    for(auto x:a){
        if(cnt[x]==1){
            //cout<<x<<" ";
            ans++;
    }
    }
    //cout<<endl;
    cout<<ans<<endl;
}














































































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

import java.util.*;
 
public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> aList = new ArrayList<Integer>();
    for (int i=0; i<n; i++) {
      aList.add(sc.nextInt());
    }
    
    int cnt = n;
    Collections.sort(aList);
    HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();
    
    for (int i=0; i<n; i++) {
      Integer ai = aList.get(i);
      if (map.contains(ai)) {
        if (map.get(ai)) {
          cnt--;
        }
        break;
      } else {
        map.put(ai, false);
        for (int j=0; j<n; j++) {
          Integer aj = aList.get(j);
          if ( i!=j && (ai%aj==0) ) {
            cnt--;
            map.put(ai, true);
            break;
          }
        }
      }
    }
    System.out.println(cnt);
  }
}


Compiler output:
Main.java:19: error: cannot find symbol
      if (map.contains(ai)) {
             ^
  symbol:   method contains(Integer)
  location: variable map of type HashMap<Integer,Boolean>
1 error
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> aList = new ArrayList<Integer>();
    for (int i=0; i<n; i++) {
      aList.add(sc.nextInt());
    }
    
    int cnt = n;
    Collections.sort(aList);
    HashMap<Integer, Boolean> map = new HashMap<Integer, Boolean>();
    
    for (int i=0; i<n; i++) {
      int ai = aList.get(i);
      if (map.contains(ai)) {
        if (map.get(ai)) {
          c--;
        }
        break;
      } else {
        map.put(ai, false);
        for (int j=0; j<n; j++) {
          int aj = aList.get(j);
          if ( i!=j && (ai%aj==0) ) {
            cnt--;
            map.put(ai, true);
            break;
          }
        }
      }
    }
    System.out.println(cnt);
  }
}


Compiler output:
Main.java:19: error: cannot find symbol
      if (map.contains(ai)) {
             ^
  symbol:   method contains(int)
  location: variable map of type HashMap<Integer,Boolean>
Main.java:21: error: cannot find symbol
          c--;
          ^
  symbol:   variable c
  location: class Main
2 errors
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> aList = new ArrayList<Integer>();
    for (int i=0; i<n; i++) {
      aList.add(sc.nextInt());
    }
    
    int cnt = n;
    Arrays.sort(aList);
    HashMap<int, boolean> map = new HashMap<int, boolean>();
    
    for (int i=0; i<n; i++) {
      int ai = aList.get(i);
      if (map.contains(ai)) {
        if (map.get(ai)) {
          c--;
        }
        break;
      } else {
        map.put(ai, false);
        for (int j=0; j<n; j++) {
          if ( i!=j && ( % aList.get(j) == 0) ) {
            cnt--;
            map.put(ai, true);
            break;
          }
        }
      }
    }
    System.out.println(cnt);
  }
}


Compiler output:
Main.java:27: error: illegal start of expression
          if ( i!=j && ( % aList.get(j) == 0) ) {
                         ^
1 error
Language: Java

import java.util.*;
 
public class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    ArrayList<Integer> aList = new ArrayList<Integer>();
    for (int i=0; i<n; i++) {
      pList.add(sc.nextInt());
    }
    
    int cnt = n;
    for (int i=0; i<n; i++) {
      for (int j=0; j<n; j++) {
        if ( i!=j && (aList.get(i) % aList.get(j) == 0) ) {
          cnt--;
          break;
        }
      }
    }
    
    System.out.println(cnt);
  }
}


Compiler output:
Main.java:10: error: cannot find symbol
      pList.add(sc.nextInt());
      ^
  symbol:   variable pList
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define MAX 1e6+1

vector<int> nums;
bool canDiv[MAX] = {};
void eratos() {
  canDiv[nums[0]] = true;
  for (int i = 1; i<n;i++) {
    int base = nums[i];
    if (canDiv[base]) {
      break;
    }
    for (int val = base*2; val < MAX; val+=base) {
      canDiv[val] = true;
    }
  }
}

int main(){
  int n;
  for (int i=0; i<n;i++) {
    int a;
    cin >> a;
    nums.push_back(a);
  }
  sort(nums.begin(), nums.end());
  eratos();
  for (int i=0; i<n;i++) {
    if (!canDiv[nums[i]]) {
      cnt++;
    }
  }
  cout << cnt << endl;
}

Compiler output:
a.cc:5:16: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    5 | #define MAX 1e6+1
      |             ~~~^~
a.cc:8:13: note: in expansion of macro 'MAX'
    8 | bool canDiv[MAX] = {};
      |             ^~~
a.cc:5:16: error: could not convert '(1.0e+6 + (double)1)' from 'double' to 'long unsigned int'
    5 | #define MAX 1e6+1
      |             ~~~^~
      |                |
      |                double
a.cc:8:13: note: in expansion of macro 'MAX'
    8 | bool canDiv[MAX] = {};
      |             ^~~
a.cc:5:16: error: size of array 'canDiv' has non-integral type 'double'
    5 | #define MAX 1e6+1
      |             ~~~^~
a.cc:8:13: note: in expansion of macro 'MAX'
    8 | bool canDiv[MAX] = {};
      |             ^~~
a.cc: In function 'void eratos()':
a.cc:11:21: error: 'n' was not declared in this scope
   11 |   for (int i = 1; i<n;i++) {
      |                     ^
a.cc: In function 'int main()':
a.cc:33:7: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |       cnt++;
      |       ^~~
      |       int
a.cc:36:11: error: 'cnt' was not declared in this scope; did you mean 'int'?
   36 |   cout << cnt << endl;
      |           ^~~
      |           int
Language: C++

#if __has_include("debug.h")
    #include "debug.h"
#else  
#include <bits/stdc++.h>
using namespace std;
#define d(...) 2;
#endif

#define int long long int

#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"      

#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define ff first
#define ss second
#define eps 1e-10

#define gcd(a,b)            __gcd((a),(b))
#define lcm(a,b)            ((a*b)/gcd(a,b))

void solve();

vector<int>mp(1e6+1,0);


const int N=1e6+1;
vector<int>isnumber(N,1);

void sieve()
{

	for(auto it:mp)
	{
		if(it.ss>1)
		{
			isnumber[it.ff]=0;
		}
	}
	for(auto it:mp)
	{
		d(it.ff);
		for(int j=2*it.ff;j<=N;j+=it.ff)
		{
			if(mp[j])
			{
				d(j);
				isnumber[j]=0;
			}
		}
	}
}

int32_t main()
{
    #ifdef DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
    #endif 

    fast
    
    int t = 1;
	// cin>>t;
	
	while(t--)
	    solve();
	return 0;  
}

void solve()
{
	int i,j;
	int n;
	cin>>n;

	vector<int>a(n);

	for(i=0;i<n;i++)
	{
		cin>>a[i];
		mp[a[i]]++;
	}

	d(mp);

	sieve();

	int ans=0;

	for(i=0;i<n;i++)
	{
		if(isnumber[a[i]])
		{
			d(a[i]);
			ans++;
		}
	}
	cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'void sieve()':
a.cc:17:12: error: request for member 'second' in 'it', which is of non-class type 'long long int'
   17 | #define ss second
      |            ^~~~~~
a.cc:36:23: note: in expansion of macro 'ss'
   36 |                 if(it.ss>1)
      |                       ^~
a.cc:16:12: error: request for member 'first' in 'it', which is of non-class type 'long long int'
   16 | #define ff first
      |            ^~~~~
a.cc:38:37: note: in expansion of macro 'ff'
   38 |                         isnumber[it.ff]=0;
      |                                     ^~
a.cc:16:12: error: request for member 'first' in 'it', which is of non-class type 'long long int'
   16 | #define ff first
      |            ^~~~~
a.cc:44:32: note: in expansion of macro 'ff'
   44 |                 for(int j=2*it.ff;j<=N;j+=it.ff)
      |                                ^~
a.cc:16:12: error: request for member 'first' in 'it', which is of non-class type 'long long int'
   16 | #define ff first
      |            ^~~~~
a.cc:44:46: note: in expansion of macro 'ff'
   44 |                 for(int j=2*it.ff;j<=N;j+=it.ff)
      |                                              ^~
Language: C++

#include <iostream>

using namespace std;

int main()
{
  int N ;
  int b = 1;
  int ans = 0;
  cin >> N;
  int a[N]
    for(int i = 0;i< N;i++)
    {
      cin >> a[i];
    }
  for (int i = 0; i< N;i++)
  {
    for(int j=0;j < N;j++)
    {
      if(i != j)
      {
        b = a[i]%a[j];
        if(b == 0)
        {
          ans++;
          break;
        }
      }
    }
  }
  cout << ans << endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected initializer before 'for'
   12 |     for(int i = 0;i< N;i++)
      |     ^~~
a.cc:12:19: error: 'i' was not declared in this scope
   12 |     for(int i = 0;i< N;i++)
      |                   ^
a.cc:22:13: error: 'a' was not declared in this scope
   22 |         b = a[i]%a[j];
      |             ^
Language: C++

n = int(input())
a = list(map(int, input().split()))

f = [0 for i in range(10**6+5)]
for x in a:
    f[x] += 1
for i in range(1, len(f)):
    if f[i] == 0:
        continue
    for j in range(2*i, len(f), i):
        f[j] = 0
ans = 0
for v in f:
    if v == 1:
        ans += 1
print(ans)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_map>
//O(n^2)
void stupid(){
    int N;
    int cnt;
    std::cin>>N;
    std::vector<unsigned int>A(N);
    for(int i=0;i<N;++i){
        std::cin>>A[i];
    }
    cnt=0;
    for(int i=0;i<N;++i){
        bool flag=1;
        for(int j=0;j<N;++j){
            if(i!=j && A[i]%A[j]==0){
                flag=0;
                break;
            }
        }
        if(flag==1){
            cnt++;
        }
    }
    std::cout<<cnt;
}

//O(n^2)
void stupid1(){
    int N;
    int cnt;
    std::cin>>N;
    std::vector<unsigned int>A(N);
    for(int i=0;i<N;++i){
        std::cin>>A[i];
    }
    std::sort(A.begin(),A.end());
    cnt=0;
    for(int i=0;i<N;++i){
        bool flag=1;
        for(int j=0;A[j]<=A[i];++j){
            if(i!=j && A[i]%A[j]==0){
                flag=0;
                break;
            }
        }
        if(flag==1){
            cnt++;
        }
    }
    std::cout<<cnt;
}

void correct(){
    int N;
    int cnt;
    std::cin>>N;
    std::vector<unsigned int>A(N);
    // std::vector<bool>flags(N,1);
    int startVal;
    for(int i=0;i<N;++i){
        std::cin>>A[i];
    }
    std::sort(A.begin(),A.end());
    std::unordered_map<int,bool> maps;
    for(int i=*(A.begin());i<=A.back();++i){
        maps[i]=1;
    }
    int cnt=0;
    for(int i=0;i<N;++i){
        if(maps[A[i]]==1)
            cnt++;

        for(int j=A[i];j<=A.back();j=j+A[i]){
            maps[j]=0;
        }
    }
    std::cout<<cnt;
}

int main(){
    // stupid();
    // stupid1();
    correct();
    return 0;
}

Compiler output:
a.cc: In function 'void correct()':
a.cc:71:9: error: redeclaration of 'int cnt'
   71 |     int cnt=0;
      |         ^~~
a.cc:58:9: note: 'int cnt' previously declared here
   58 |     int cnt;
      |         ^~~
Language: C++

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

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

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

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

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


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

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

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

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


vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}



int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(all(a));
    map<ll, ll> mp(1000005);
    ll ans = 0;
    rep(i, n){
        if(mp[a[i]] != 0){
            mp[a[i]] = 2;
            continue;
        }
        for(int j = a[i]; j <= 1000000; j += a[i]){
            mp[j]++;
        }
    }
    rep(i, n){
        if(mp[a[i]] == 1) ans++;
    }
    print(ans);

}



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

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int b[inf];

int main() {

    int n;
    cin >> n;
    vector<int> a(n);
    set<int> st;

    REP(i, n) {
        cin >> a[i];
        b[a[i]]++;
        st.insert(a[i]);
    }

    bool flag[inf];

    for (int i : st) {
        for(int j = 2; j < inf; j++) {
            if (i * j >= inf) break;
            flag[i*j] = true;
        }
    }

    int res = 0;
    for(int i = 0; i < n; i++) {
        if (b[a[i]] == 1 && !flag[A[i]]) res++;
    }

    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:35: error: 'A' was not declared in this scope
   42 |         if (b[a[i]] == 1 && !flag[A[i]]) res++;
      |                                   ^
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); i++)
#define RREP(i, s, n) for (int i = s; i < (n); i++)
#define ALL(a) a.begin(), a.end()
#define RALL(a) a.rbegin(), a.rend()
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; }
using namespace std;
using ll = long long;
typedef pair<int, int> pint;
typedef pair<ll, ll> pll;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1<<29);

int b[inf];

int main() {

    int n;
    cin >> n;
    vector<int> a(n);
    set<int> st;

    REP(i, n) {
        cin >> a[i];
        b[A[i]]++;
        st.insert(A[i]);
    }

    bool flag[inf];

    for (int i : s) {
        for(int j = 2; j < inf; j++) {
            if (i * j >= inf) break;
            flag[i*j] = true;
        }
    }

    int res = 0;
    for(int i = 0; i < n; i++) {
        if (b[A[i]] == 1 && !flag[A[i]]) res++;
    }

    cout << res << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:11: error: 'A' was not declared in this scope
   27 |         b[A[i]]++;
      |           ^
a.cc:33:18: error: 's' was not declared in this scope
   33 |     for (int i : s) {
      |                  ^
a.cc:42:15: error: 'A' was not declared in this scope
   42 |         if (b[A[i]] == 1 && !flag[A[i]]) res++;
      |               ^
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:
a.cc: In function 'int main()':
a.cc:18:15: error: expected ';' before '}' token
   18 |       continue
      |               ^
      |               ;
   19 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
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; }
//(a+b-1)/b

signed main(){
	ll n; cin>>n;
	vl vec(n);
	ll m=0;
	ll cnt=0;
	map<ll,ll> mp;
	rep(i,0,n){
		ll a; cin>>a;
		mp[a]++;
		chmax(m,a);
		vec[i]=a;
	}
	for(auto c:mp){
		if(c.second!=1)cnt+=c.second;
	}
	vector<bool> ok(m+2);
	rep(i,0,n){
		ll k=vec[i];
		k+=vec[i];
		while(k<=m){
			ok[k]=true;
			k+=vec[i];
		}
	}
	ll ans=0;
	rep(i,0,n){
		if(ok[vec[i]])continue;
		ans++;
	}
	cout<<max(ans-cnt,0)<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:18: error: no matching function for call to 'max(ll, int)'
   45 |         cout<<max(ans-cnt,0)<<endl;
      |               ~~~^~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:45:18: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   45 |         cout<<max(ans-cnt,0)<<endl;
      |               ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:45:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   45 |         cout<<max(ans-cnt,0)<<endl;
      |               ~~~^~~~~~~~~~~
Language: C++

int main(){
    int N;
    cin >> N;
    vi a(N);
    for(int i=0;i<N;i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    vb rem(a[N-1]+1,true);
    for(int i=0;i<N;i++){
        int j=2;
        while(a[i]*j<=a[N-1]){
            //if(!rem[a[i]*j]) break;
            rem[a[i]*j]=false;
            j++;
        }
        if(i!=0){
            if(a[i]==a[i-1])
                rem[a[i]] = false;
        }
    }

    int count=0;
    for(int i=0;i<N;i++){
        if(rem[a[i]]){
            count++;
        }
    }
    cout << count << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:5: error: 'vi' was not declared in this scope
    4 |     vi a(N);
      |     ^~
a.cc:6:16: error: 'a' was not declared in this scope
    6 |         cin >> a[i];
      |                ^
a.cc:8:10: error: 'a' was not declared in this scope
    8 |     sort(a.begin(),a.end());
      |          ^
a.cc:8:5: error: 'sort' was not declared in this scope; did you mean 'short'?
    8 |     sort(a.begin(),a.end());
      |     ^~~~
      |     short
a.cc:9:5: error: 'vb' was not declared in this scope
    9 |     vb rem(a[N-1]+1,true);
      |     ^~
a.cc:14:13: error: 'rem' was not declared in this scope
   14 |             rem[a[i]*j]=false;
      |             ^~~
a.cc:19:17: error: 'rem' was not declared in this scope
   19 |                 rem[a[i]] = false;
      |                 ^~~
a.cc:25:12: error: 'rem' was not declared in this scope
   25 |         if(rem[a[i]]){
      |            ^~~
a.cc:29:5: error: 'cout' was not declared in this scope; did you mean 'count'?
   29 |     cout << count << endl;
      |     ^~~~
      |     count
a.cc:29:22: error: 'endl' was not declared in this scope
   29 |     cout << count << endl;
      |                      ^~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    bool a[1000001];
    for(int i=0;i<=1000000;i++)
    {
        a[i]=true;
    }
    int in;
    map<int,int> m;
    for(int i=0;i<n;i++)
    {
        cin>>in;
        m[in]++;
    }
    for(auto j:m)
    {
        if(j.second>1) 
        {
            a[j.first]=false;
            continue;
        }
        in=j.first;
        for(int j=in;j<=1000000;j+=in)
        {
            a[j]=false;
        }
    }
    int ans=0;
    for(int i=0;i<n;i++)
    {
        if(a[b[i]]) ans++;
    }
    cout<<ans;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:14: error: 'b' was not declared in this scope
   38 |         if(a[b[i]]) ans++;
      |              ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   10 |     bool a[1e6+1];
      |            ~~~^~
a.cc:10:15: error: could not convert '(1.0e+6 + (double)1)' from 'double' to 'long unsigned int'
   10 |     bool a[1e6+1];
      |            ~~~^~
      |               |
      |               double
a.cc:10:15: error: size of array 'a' has non-integral type 'double'
Language: C++

#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

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




// ***************************************


int main(){

    int N;
    cin >> N;
    vll A(N);
    ll mx = 0;
    ll cnt1 = 0;
    REP(i, N){
        cin >> A[i];
        if (A[i] == 1) cnt1++;
        chmax(mx, A[i]);
    }

    if(cnt1 == 1){
        cout << 1 << endl;
        return 1;
    } else (cnt1 == 0){
        cout << 0 << endl;
        return 0;
    }

    vll B(mx + 1, 0);
    for (ll a: A){
        ll i = a;
        while(i <= mx){
            B[i] += 1;
            i += a;
        }
    }

    ll ans = 0;
    for (ll x: B){
        if (x == 1) ans++;
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:63:23: error: expected ';' before '{' token
   63 |     } else (cnt1 == 0){
      |                       ^
      |                       ;