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

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


// vectorからindex番目の要素を削除する
template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
int main()
{
    int n, a;
    vector<int>A;
    cin >> n;

    for (int i = 0; i < n; i++) {
        scanf_s("%d", &a);
        A.emplace_back(a);
    }
    bool chofuku = false;
 //   sort(A.begin(), A.end());
    //auto itrr = A.begin();
    int i = 0;
    //while (itrr != A.end()) {//
    while(i<A.size()){
        chofuku = false;
        //for (auto itr = ++itrr; itr != A.end(); itr++) {
        //    int youso = *itrr;
        //    if (youso == (*itr)) {
        //        chofuku = true;
        //        A.erase(itr);
        //    }
        //    else if ((*itr) % youso == 0) {
        //        A.erase(itr);
        //    }
        //    
        //}
        for (int j = 0; j < A.size(); j++) {
            if (i != j) {
                int youso = A[i];
                if (youso == A[j]) {
                    chofuku = true;
                    remove(A, j);
                    if(i>j)i--;
                    j--;
                }
                else if (A[j] % youso == 0) {
                    remove(A, j);
                    if(i>j)i--;
                    j--;
                }
            }
        }

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

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




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

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

int main() {
  vector<long long> A;
  long long N;
  cin >> N;
  for (long long i = 0; i < N; i++) {
    long long Ai;
    cin >> Ai;
    A.push_back(Ai);
  }
  long long count = 0;
  for (long long i = 0; i < N; i++) {
    bool flag = false;
    for (long long j = 0; i < N; i++) {
      if (i == j) continue;
      if (A[i] % A[j] == 0) {
        flag = true;
        break;
      }
    }
    if (!flag) count++;
  }
  cout << count << endl;
}

Compiler output:
a.cc:3:1: error: 'std' does not name a type
    3 | std namespace std;
      | ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<long long> A;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'long'
    6 |   vector<long long> A;
      |          ^~~~
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   cin >> N;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:5: error: 'A' was not declared in this scope; did you mean 'Ai'?
   12 |     A.push_back(Ai);
      |     ^
      |     Ai
a.cc:19:11: error: 'A' was not declared in this scope
   19 |       if (A[i] % A[j] == 0) {
      |           ^
a.cc:26:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |   cout << count << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:26:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   26 |   cout << count << endl;
      |                    ^~~~
      |                    std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <map>
#include <math.h>
#include <vector>
using namespace std;
struct cww { cww() { ios::sync_with_stdio(false); cin.tie(0); } }star;
map<int, int> ct;
map<int, int> ct2;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vpii;
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vll;
#define INF 0x3f3f3f3f
#define MOD 998244353LL
#define EPS 0.00001
#define f first
#define s second
#define pb push_back
#define mp make_pair

#define FOR(i, a, b) for (int i=(a); i<=(signed)(b); i++)
#define AFOR(i, a) for (int i=0; i<(signed)(a); i++)
#define RFOR(i, a, b) for (int i=(a); i >= b; i--)

#define MN 100005
int n, m, l;
int a, b, c;
string s[MN];
string str;
int dx[4] = { 1,0,-1,0 };
int dy[4] = { 0,1,0,-1 };

/*
int N;
cin >> N;
vi vect(N);
FOR(i,N) cin >> vec.at(i);*/
//sort(vec.begin(),vec.end());
//vvi data(N,vi(4));

std::vector<int> Eratosthenes(const int N)
{
	std::vector<bool> is_prime(N + 1);
	for (int i = 0; i <= N; i++)
	{
		is_prime[i] = true;
	}
	std::vector<int> P;
	for (int i = 2; i <= N; i++)
	{
		if (is_prime[i])
		{
			for (int j = 2 * i; j <= N; j += i)
			{
				is_prime[j] = false;
			}
			P.emplace_back(i);
		}
	}
	return P;
}
/*	int bfs(int x, int y,vvi &A,vvi flag) {
		queue<pii> que;
		que.push(pii(x, y));
		while (que.size()) {
			pii p = que.front(); que.pop();
			AFOR(i, 4) {
				int nx = p.first + dx[i]; int ny = p.second + dy[i];
				if (0 <= nx && nx < N && 0 <= ny && ny < N) {
					if (A.at(p.first).at(p.second) + flag.at(p.first).at(p.second) < A.at(nx).at(ny)) {
						A.at(nx).at(ny) = A.at(p.first).at(p.second) + flag.at(p.first).at(p.second);
						que.push(pii(nx, ny));
					}
				}
			}
		}
		return 0;
	}
	*/
	/*int gcd(int p, int q){
		while(q != 0){
		int r = p % q;
		p = q;
		q = r;
		}
	return p;
	}*/
ll K;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int N;
	cin >> N;
	vi A(N), B(N);
	int B[200100];
	int count = 0;
	AFOR(i, N) {
		cin >> A.at(i);
		B[i] = 1;
	}
	sort(A.begin(), A.end());
	AFOR(i, N) {
		if (B[i] == 1) {
			if (A.at(i) == A.at(i + 1)) B.at[i] = 0;
			FOR(j, i + 1, N - 1) {
				if (B[j] == 1) {
					if (A.at(j) % A.at(i) == 0) {
						B[j] = 0;
					}
				}
			}
		}
	}
	AFOR(i, N) {
		count += B[i];
	}
	cout << count << endl;
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:103:13: error: conflicting declaration 'int B [200100]'
  103 |         int B[200100];
      |             ^
a.cc:102:18: note: previous declaration as 'vi B'
  102 |         vi A(N), B(N);
      |                  ^
a.cc:112:57: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
  112 |                         if (A.at(i) == A.at(i + 1)) B.at[i] = 0;
      |                                                         ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<double> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	bool flg = false;
	int number = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (!(i < n)) {
				break;
			}
			if (i != j) {
				double div = a[i] / a[j];
				if (div == floor(div)) {
					flg = true;
					break;
				}
			}
		}
		if (flg) {
			flg = false;
			continue;
		}
		number++;
	}
	cout << number;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:44: error: 'floor' was not declared in this scope
   23 |                                 if (div == floor(div)) {
      |                                            ^~~~~
Language: C++

#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>


int main(){
  int N; cin >> N;
  vector<int> A(N);
  map<int, int> s;
  rep(i,N) {
    cin >> A[i];
    s[A[i]]++;
  }
 
  sort(all(A),greater<int>());
  if (N==1){
    cout << 1 << endl;
    return 0;
  }
  if (s[1]==1){
    cout << 1 << endl;
    return 0;
  }
  else (s[1]>1){
    cout << 0 << endl;
    return 0;
  } 
  
  int retval = 0;
  rep(i,N){
    bool flag = false;
    if (s[1]>0 || s[A[i]]>1) flag = true;

    for (int j=2;j<=(int)sqrt(A[i]);j++){
      if (A[i]%j==0){
        if (s[j]>0 || s[A[i]/j]>0) flag = true;
      }
    }
    if (flag==false) retval++;
  }
  cout << retval << endl;






  // cout << fixed << setprecision(10);
  
  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:31:16: error: expected ';' before '{' token
   31 |   else (s[1]>1){
      |                ^
      |                ;
Language: C++

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

int main() {
  ll n, tmp; cin >> n;
  vector<ll> A(n);

  for(ll i = 0; i < n; ++i) {
    cin >> tmp;
    A[i] = tmp;
  }

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

  vector<ll> doub(1000001);
  for(ll i = 0; i < n; ++i) {
    doub[A[i]]++;
  }
  ll doubcnt = 0;
  for(ll i = 1; i <= 1000000; ++i) {
    if(doub[i] >= 2) doubcnt++;
  }

  unique()

  ll era[1000001] = {};
  ll cnt = 0;

  for(ll i = 0; i < n; ++i) {
    if(era[A[i]] == 0) {
      for(ll j = 1; A[i] * j < 1000001; ++j) {
        era[A[i] * j] = 1;
      }
      cnt++;
    }
  }

  cout << cnt - doubcnt << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: no matching function for call to 'unique()'
   27 |   unique()
      |   ~~~~~~^~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:891:5: note: candidate: 'template<class _FIter> _FIter std::unique(_FIter, _FIter)'
  891 |     unique(_ForwardIterator __first, _ForwardIterator __last)
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:891:5: note:   candidate expects 2 arguments, 0 provided
/usr/include/c++/14/bits/stl_algo.h:922:5: note: candidate: 'template<class _FIter, class _BinaryPredicate> _FIter std::unique(_FIter, _FIter, _BinaryPredicate)'
  922 |     unique(_ForwardIterator __first, _ForwardIterator __last,
      |     ^~~~~~
/usr/include/c++/14/bits/stl_algo.h:922:5: note:   candidate expects 3 arguments, 0 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:230:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator, class _BinaryPredicate> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::unique(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator, _BinaryPredicate)'
  230 | unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:230:1: note:   candidate expects 4 arguments, 0 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:234:1: note: candidate: 'template<class _ExecutionPolicy, class _ForwardIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, _ForwardIterator> std::unique(_ExecutionPolicy&&, _ForwardIterator, _ForwardIterator)'
  234 | unique(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last);
      | ^~~~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:234:1: note:   candidate expects 3 arguments, 0 provided
a.cc:33:8: error: 'era' was not declared in this scope; did you mean 'erf'?
   33 |     if(era[A[i]] == 0) {
      |        ^~~
      |        erf
Language: C

#include <stdio.h>
int main(){
int N;
int count=0;
int i=0;
scanf("%d",&N);
int a[N];
for(i=0;i<N;i++)
	scanf("%d",a[i]);

while(k<N){
for(k = 0;k != i;k++){
	if((a[i] % a[k]) == 0) {
	  i++;
          continue;}
        else count += 1;}
	count /= k;
}
printf("%d",count);
}

Compiler output:
main.c: In function 'main':
main.c:11:7: error: 'k' undeclared (first use in this function)
   11 | while(k<N){
      |       ^
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,x,n,j,p,q;
  int ans=0;
  int a[200001];
scanf("%d",&n);
  for(i=0;i<n;i++){
   scanf("%d ",&a[i]); 
  }
  
  for(p=0;p<n;p++){
   for(q=p;q<n;q++){
    if(a[p]<a[q]){
     tmp=a[p];
      a[p]=a[q];
      a[q]=tmp;
    }
   }
  }
  
  
  
  for(i=0;i<n;i++){
    for(j=i;j<n;j++){
   		if(a[i]%a[j]==0&&i!=j){
         ans++;
          j=n;
        }
  
    }
  }
  printf("%d",n-ans);
  
 return 0; 
}






Compiler output:
main.c: In function 'main':
main.c:15:6: error: 'tmp' undeclared (first use in this function)
   15 |      tmp=a[p];
      |      ^~~
main.c:15:6: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n];
  map<int,vector<int>> m;
  set<int> s;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  for(int i=0;i<n;i++){
    int flag=0;
    for(auto it=m.begin();it!=m.end();it++){
	  int k=it->first;
      if(a[i]%k==0){
        if(a[i]==k)s.insert(i);
        flag=1;
        m[k].push_back(a[i]);
      }
    }
    if(flag==0){
      vector<int> ans;
      m.push_back(ans);
    }
  }
  printf("%d",m.size()-s.size());
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:9: error: 'class std::map<int, std::vector<int> >' has no member named 'push_back'
   25 |       m.push_back(ans);
      |         ^~~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
  int i,x,n,j;
  int ans=0;
  int a[200001];
scanf("%d",&n);
  for(i=0;i<n;i++){
   scanf("%d ",&a[i]); 
  }
  
  for(p=0;p<n;p++){
   for(q=p;q<n;q++){
    if(a[p]<a[q]){
     tmp=a[p];
      a[p]=a[q];
      a[q]=tmp;
    }
   }
  }
  
  
  
  for(i=0;i<n;i++){
    for(j=i;j<n;j++){
   		if(a[i]%a[j]==0&&i!=j){
         ans++;
          j=n;
        }
  
    }
  }
  printf("%d",n-ans);
  
 return 0; 
}






Compiler output:
main.c: In function 'main':
main.c:12:7: error: 'p' undeclared (first use in this function)
   12 |   for(p=0;p<n;p++){
      |       ^
main.c:12:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:8: error: 'q' undeclared (first use in this function)
   13 |    for(q=p;q<n;q++){
      |        ^
main.c:15:6: error: 'tmp' undeclared (first use in this function)
   15 |      tmp=a[p];
      |      ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  int a[n];
  map<int,vector<int>> m;
  set<int> s;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  for(int i=0;i<n;i++){
    int flag==0;
    for(auto it=m.begin();it!=m.end();it++){
	  int k=it->first;
      if(a[i]%k==0){
        if(a[i]==k)s.insert(i);
        flag=1;
        m[k].push_back(a[i]);
      }
    }
    if(flag==0){
      vector<int> ans;
      m.push_back(ans);
    }
  }
  printf("%d",m.size()-s.size());
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected initializer before '==' token
   14 |     int flag==0;
      |             ^~
a.cc:19:9: error: 'flag' was not declared in this scope
   19 |         flag=1;
      |         ^~~~
a.cc:23:8: error: 'flag' was not declared in this scope
   23 |     if(flag==0){
      |        ^~~~
a.cc:25:9: error: 'class std::map<int, std::vector<int> >' has no member named 'push_back'
   25 |       m.push_back(ans);
      |         ^~~~~~~~~
Language: C++

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

int main(){
  int n;cin>>n;
  if(n==1){cout<<0;return 0;}
  vector<int>A(n);
  rep(i,n)cin>>A[i];
  reverse(sort(all(A)));
  int ans=0;
  if(n>1&&A[n-1]==A[n-2])ans--;
  rep(i,n){
    bool ok=1;
    for(int j=n-1;j>i;j--){
      if(A[i]%A[j]==0){
        ok=0;
        break;
      }
    }
    cout<<ok<<" "<<A[i]<<endl;
    if(ok)ans++;
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: invalid use of void expression
   12 |   reverse(sort(all(A)));
      |           ~~~~^~~~~~~~
Language: C++

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#include <utility>
#include <string>
#include <queue>
#include <cmath>
#include <array>

bool is_prime(int x) {
    for(int i = 2; i * i <= x; i++) {
        if(x % i == 0) {return false};
    }
    return true;
}

int main(int argc, char *argv[])
{
    int n;
    std::vector<int> a;
    std::vector<int> b;

    std::cin >> n;

    a.resize(n);
    b.reserve(n);

    std::vector<bool> dup(n, false);

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

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

    // 重複チェック
    for (int i = 0; i < n - 1; i++) {
        if (a[i] == a[i + 1]) {
            dup[i] = true;
            dup[i + 1] = true;
        }
    }

    int count = 0;
    for (int i = 0; i < n; i++) {
        const int a_i = a[i];
        const int b_size = b.size();
        if (b_size > 0 && a_i == b.back()) {continue;} // dupならskip
        bool ok = true;
        if (!is_prime(a_i)) {
            for (int j = 0; j < b_size; j++) {
                if (a_i % b[j] == 0) {
                    ok = false;
                    break;
                }

                const int a_half = a_i / 2;
                if (a_half <= b[j]) {
                    break;
                }
            }
        }

        if (ok) {
            if (!dup[i]) {count++;}
            b.push_back(a[i]);
        }
    }

    std::cout << count << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'bool is_prime(int)':
a.cc:17:37: error: expected ';' before '}' token
   17 |         if(x % i == 0) {return false};
      |                                     ^
      |                                     ;
Language: C++

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

int scanCheck = 0;
int a[200000];
int n;
int cnt = 0, flag = 0;

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

Compiler output:
a.cc:9:1: error: '::main' must return 'int'
    9 | void main()
      | ^~~~
Language: C++

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

int main() {
    int N, count;
    cin >> N;
    vector<int> A(N);
    count = 0;

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

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

    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            if(i == j){
            }else if(A[i] % A[j] == 0){
                count++;
                break;
            }
        }
    }

    cout << N - count << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:29: error: expected ';' before 'for'
   14 |     sort(A.begin(), A.end())
      |                             ^
      |                             ;
   15 | 
   16 |     for(int i = 0; i < N; i++){
      |     ~~~                      
a.cc:16:20: error: 'i' was not declared in this scope
   16 |     for(int i = 0; i < N; i++){
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  cin>>n;
  int a[n];
  map<int,vector<int>> m;
  set<int> s;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  sort(a,a+n);
  for(int i=0;i<n;i++){
    int flag==0;
    for(auto it=m.begin();it!=m.end();it++){
	  int k=it->first;
      if(a[i]%k==0){
        if(a[i]==k)s.insert(i);
        flag=1;
        m[k].push_back(a[i]);
      }
    }
    if(flag==0){
      vector<int> ans;
      m.push_back(ans);
    }
  }
  printf("%d",m.size()-s.size());
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:8: error: 'n' was not declared in this scope; did you mean 'yn'?
    4 |   cin>>n;
      |        ^
      |        yn
a.cc:9:10: error: 'a' was not declared in this scope
    9 |     cin>>a[i];
      |          ^
a.cc:11:8: error: 'a' was not declared in this scope
   11 |   sort(a,a+n);
      |        ^
a.cc:13:13: error: expected initializer before '==' token
   13 |     int flag==0;
      |             ^~
a.cc:18:9: error: 'flag' was not declared in this scope
   18 |         flag=1;
      |         ^~~~
a.cc:22:8: error: 'flag' was not declared in this scope
   22 |     if(flag==0){
      |        ^~~~
a.cc:24:9: error: 'class std::map<int, std::vector<int> >' has no member named 'push_back'
   24 |       m.push_back(ans);
      |         ^~~~~~~~~
Language: Java

import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
      Scanner sc=new Scanner(System.in);
      int n=sc.nextInt();
      int[] a=new int[n];
      for(int i=0;i<n;i++){
      a[i]=sc.nextInt();
      }
      int count=0;
      int xcount=0;
       for(int j=0;j<n;j++){
        for(int k=0;k<n;k++){
        if(a[i]%a[j]!=0)
          count++;
        }
         if(count==n)
          xcount+=1; 
         else
           xcount=0;
       }
      System.out.println(xcount);
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
        if(a[i]%a[j]!=0)
             ^
  symbol:   variable i
  location: class Main
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(),ans=0;
    int[] a=new int[n];
    for(int i=0;i<n;i++){
      a[i]=sc.nextInt();
    }
    Arrays.sort(a);
    for(int i=0;i<n;i++){
      if(i==0){
        if(a[0]<a[1]){
          ans++;
        }
      }else{
        for(int j=0;j<i;j++){
          int f=0;
          if(a[i]%a[j]==0){
            f++;
            break;
          }
          if(f==0){
            ans++;
          }
        }
      }
    }
    System.out.pirntln(ans);
  }
}


Compiler output:
Main.java:31: error: cannot find symbol
    System.out.pirntln(ans);
              ^
  symbol:   method pirntln(int)
  location: variable out of type PrintStream
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N;
  int x=0;
  int y=0;
  cin>>N;
  vector<int> A(N);
  for(int i=0;i<N;i++)
  {
    cin>>A.at(i);
  }
  for(int j=0;j<N;j++)
  {
    for(int k=0;k<N;k++)
    {
      y=0;
      if(A.at(j)%A.at(k)==0)
      {
        y++;
      }
      if(y==1)
      {
        x++;
    }
  }
  cout<<x<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
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;
  
  set<int> kouho;
  set<int> waru;
  
  int a1;
  cin >> a1;
  
  kouho.insert(a1);
  waru.insert(a1);
  
  for(){
    int A;
    cin >> A;
    
    bool x = true;
    for(int w: waru){
      if(A%w==0){
        x = false;
        break;
      }
    }
    
    if(x){
      for(int k: kouho){
        if(k%A){
          kouho.erase(k);
          waru.erase(k);
        }
      }
      kouho.insert(A);
      waru.insert(A);
    }
  }
  
  cout << kouho.size() << endl;
}
      
        
    
    
  
  
  
  

  
  
 



  
 

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: expected primary-expression before ')' token
   19 |   for(){
      |       ^
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
a.cc:43:32: error: expected ')' before '}' token
   43 |   cout << kouho.size() << endl;
      |                                ^
      |                                )
   44 | }
      | ~                               
a.cc:19:6: note: to match this '('
   19 |   for(){
      |      ^
a.cc:44:1: error: expected primary-expression before '}' token
   44 | }
      | ^
Language: Java

import java.util.*;

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

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

Compiler output:
Main.java:26: error: ';' expected
				int c = list.get(j)
				                   ^
1 error
Language: C++

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

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

import java.util.Arrays;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n =sc.nextInt();
        Integer arr [] = new Integer[n];

        int cn=n;
        for (int i = 0; i < n; i++) {
            arr[i] =sc.nextInt();
        }
        Arrays.sort(arr);
        if(n>1) {
            if(arr[0]%arr[1]==0) cn--;}
        else {
            System.out.println(1); return;
        }
        for (int i = 1; i <n ; i++) {
            for (int j = i-1; j >=0 ; j--) {
                if( arr[i]%arr[j]==0){
                    cn--;
                    break;
                }
            }
        }
        System.out.println(cn);


    }
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:3:1: error: expected unqualified-id before 'public'
    3 | public class Main {
      | ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define xrep(i, a, b) for (int i = int(a); i < int(b); ++i)
int main() {
    int N;
    cin >> N;
    int a;
    vector<int> A;
    rep(i ,N) {
        cin >> a;
        A.push_back(a);
    }
    int plus = 1;
    int counter = 0;
    set<int> ans;

    for(int ai: A) {
        for(int aj: A) {
            if (ai==aj) {
                continue;
            }
            else if(ai%aj==0) {
                plus *= 0;
            }
            else {
                continue;
            }
        }
        if(plus!=0) {
            ans.insert(ai);
        }
        plus=1;

    }

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


    return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:40:14: error: expected '}' at end of input
   40 |     return 0;
      |              ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C++

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

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

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


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

#include <iostream>

using namespace std;

int main()
{
  int N;
  scanf("%d", &N);
  vector <int> a(N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i]);
  }
  
  int count = 0;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < N; ++j) {
      if (i == j) continue;
      if (a[i] % a[j] == 0) {
        count++;
        break;
      }
    }
  }
  
  printf("%d\n", N - count);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   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 | 
a.cc:9:11: error: expected primary-expression before 'int'
    9 |   vector <int> a(N);
      |           ^~~
a.cc:11:18: error: 'a' was not declared in this scope
   11 |     scanf("%d", &a[i]);
      |                  ^
a.cc:18:11: error: 'a' was not declared in this scope
   18 |       if (a[i] % a[j] == 0) {
      |           ^
Language: C

#include <algorithm>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <math.h>
using namespace std;

vector< long long > divisor(long long n) {
  vector< long long > ret;
  for(long long i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int main(){
    long long N;
    cin >> N;
    vector<long long> a_list(N);
    vector<long long> n_list(1000000);
    for(long long i=0;i<N;i++){
        long long a;
        cin >> a;
        a_list[i]=a;
        n_list[a-1]++;
    }
    long long cnt =0;
    for (long long i =0;i<N;i++){
        vector<long long> y_list=divisor(a_list[i]);
        int flag=0;
        for(long long j=0;j<y_list.size()-1;j++){
            if(n_list[y_list[j]-1]>=1){
                flag=1;
                continue;
            }
        }
        if (n_list[a_list[i]-1]>=2){
            flag=1;
        }
        if (flag==0){
            cnt++;
        }

    }
	
    cout << cnt;

}

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

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const ll INF = (ll)1e18+1;
const ll DIV = 1000000007;
//#define TEST

bool isPrime(ll x){
    if(x < 2)return false;
    else if(x == 2) return true;
    if(x%2 == 0) return false;
    for(ll i = 3; i*i <= x; i += 2) if(x%i == 0) return false;
    return true;
}

vector<ll> all_divs(ll n){
    vector<ll> ret;
    for(ll i = 1 ; i*i <= n ; ++i){
        if(n%i == 0){
            ret.push_back(i);
            if(i*i != n){
                ret.push_back(n/i);
            }
        }
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    ll N;
    cin >> N;
    ll count=0;
    vector<ll> A(N);
    for(size_t i=0;i<N; i++)
    {
        cin >> A[i];
        //if(isPrime(A[i])) count++;
    }
    sort(A.rbegin(), A.rend()); //O(log(N))
    for(size_t i=0;i<N; i++)// O(N)
    {
        bool divide=false;
        if(A[i]==A[i-1]) continue;
        for(ll j=N-1;j>=i+1; j--)
        {
            //cerr << A[i] << ":" << A[j] << endl;
            if(A[i] % A[j] == 0)
            {
                divide = true;a
                break;
            }
            if(isPrime(A[i])) break;
        }
        if(!divide)
        {
            //cerr << "\t" << A[i] << endl;
            count++;
        }
    }
    cout << count << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:68:31: error: 'a' was not declared in this scope
   68 |                 divide = true;a
      |                               ^
Language: C++

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

const int max_A=1e6+10;
int K[max_A];

int main(){
    fill(K[0], max_A, 0);
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    for(int i=0; i<n-1; i++){
        int j=1;
        while(j*a[i]<=max_A-1){
            K[j*a[i]]==1;
        }
    }
    int res=0;
    for(int i=0; i<n; i++){
        if(K[a[i]==0]){
            res+=1;
        }
    }
    cout << res << endl;
    return 0;
    
}

Compiler output:
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:2:
/usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int; typename __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type = void]':
/usr/include/c++/14/bits/stl_algobase.h:998:21:   required from 'void std::__fill_a(_FIte, _FIte, const _Tp&) [with _FIte = int; _Tp = int]'
  998 |     { std::__fill_a1(__first, __last, __value); }
      |       ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:1029:20:   required from 'void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&) [with _ForwardIterator = int; _Tp = int]'
 1029 |       std::__fill_a(__first, __last, __value);
      |       ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:9:9:   required from here
    9 |     fill(K[0], max_A, 0);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:952:9: error: invalid type argument of unary '*' (have 'int')
  952 |         *__first = __tmp;
      |         ^~~~~~~~
Language: C++

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

int main(void) 
{
   int n;
   cin >> n;
   vector<int> a(n);
   int ans = 0;
   rep(i,n) cin >> a[i];
   sort(a.begin(), a.end());
   vector<int> ans = a;
   queue<int> que;
    que.push(a[0]);
    int ret = 0;
   while(!que.empty())
   {
       int target = que.front(); que.pop();
        vector<int> rem;
       for(int i = 1,ans.size() i++)
       {
           if(ans[i]%target ==0) continue;
           else rem.push_back(ans[i]);
       }
       if(ans[0] != target) ret++;
       if(rem.size() == 0)
       {
           ans++;
           break;
       }
       ans = rem;
       que.push(ans[0]);
   }

   cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: conflicting declaration 'std::vector<int> ans'
   16 |    vector<int> ans = a;
      |                ^~~
a.cc:13:8: note: previous declaration as 'int ans'
   13 |    int ans = 0;
      |        ^~~
a.cc:24:25: error: expected ';' before '.' token
   24 |        for(int i = 1,ans.size() i++)
      |                         ^
      |                         ;
a.cc:24:25: error: expected primary-expression before '.' token
a.cc:24:32: error: expected ';' before 'i'
   24 |        for(int i = 1,ans.size() i++)
      |                                ^~
      |                                ;
a.cc:26:18: error: invalid types 'int[int]' for array subscript
   26 |            if(ans[i]%target ==0) continue;
      |                  ^
a.cc:27:34: error: invalid types 'int[int]' for array subscript
   27 |            else rem.push_back(ans[i]);
      |                                  ^
a.cc:29:14: error: invalid types 'int[int]' for array subscript
   29 |        if(ans[0] != target) ret++;
      |              ^
a.cc:35:14: error: cannot convert 'std::vector<int>' to 'int' in assignment
   35 |        ans = rem;
      |              ^~~
      |              |
      |              std::vector<int>
a.cc:36:20: error: invalid types 'int[int]' for array subscript
   36 |        que.push(ans[0]);
      |                    ^
Language: C++

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


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

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

typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n)   for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;
#define dpair pair<double,double>

template <typename Val>
Val gcd(Val a, Val b) {
//use ll or int for gcd
    if (b==0) return a;
    else return gcd(b, a%b);
}
template <typename Val>
Val vec_max(vector<Val> v){
  return *max_element(v.begin(),v.end());
}
template <typename Val>
Val vec_min(vector<Val> v){
  return *min_element(v.begin(),v.end());
}
template <typename Val>
void show_vec(vector<Val> *v){
  cout<<endl;
  rep(i,v->size()){
    cout<<v->at(i)<<" ";
  }
  cout<<endl;
}
//---------------------------------------------------------------
int main(){

  int N,ans;
  cin>>N;
  vec A(N);
  int c = 0;
  rep(i,N){
    cin>>A.at(i);
    if(i>0){
      if(A.at(i)==A.at(i-1))c++;
    }
  }

  sort(A.begin(),A.end());
  if(A.at(0)==1){
    if(i>1&&A.at(1)==1){
      cout<<0<<endl;
      return 0;
    }
    cout<<1<<endl;
    return 0;
  }

  vec B;
  ans = 0;
  REP(i,1,N){

    if(A.at(i)==A.at(i-1)){
      ans+=0;
    }else if(i==1){
      B.push_back(A.at(0));
      ans++;
      if(A.at(i)%A.at(i-1)!=0){
        ans++;
        B.push_back(A.at(i));
      }
    }else{

    int f = 0;
    rep(j,B.size()){
      if(A.at(i)%B.at(j)==0){
        f= 1;
        break;
      }
      if(B.at(j)*2>A.at(i))break;
    }

    if(f==0){
      ans++;
      B.push_back(A.at(i));
      }
    }
  }


  cout<<ans<<endl;




}


Compiler output:
a.cc: In function 'int main()':
a.cc:52:8: error: 'i' was not declared in this scope
   52 |     if(i>1&&A.at(1)==1){
      |        ^
Language: C++

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

AtCoder Beginner Contest 170
 English 
 peter2010 (Contestant) 
Contest Duration: 2020-06-14(Sun) 20:00 ~ 2020-06-14(Sun) 21:40 (local time) (100 minutes)Back to Home
 Top
 Tasks
 Clarifications 1
 Submit
 Results
 Standings
 Custom Test
 Discuss
Submission #14335962

Source Code 

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

Compiler output:
a.cc:36:12: error: stray '#' in program
   36 | Submission #14335962
      |            ^
a.cc:24:1: error: 'AtCoder' does not name a type
   24 | AtCoder Beginner Contest 170
      | ^~~~~~~
a.cc:44:5: error: redefinition of 'int m [1000005]'
   44 | int m[1000005];
      |     ^
a.cc:3:5: note: 'int m [1000005]' previously declared here
    3 | int m[1000005];
      |     ^
a.cc:45:5: error: redefinition of 'int main()'
   45 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
a.cc:66:5: error: redefinition of 'int m [1000005]'
   66 | int m[1000005];
      |     ^
a.cc:3:5: note: 'int m [1000005]' previously declared here
    3 | int m[1000005];
      |     ^
a.cc:67:5: error: redefinition of 'int main()'
   67 | int main(){
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main(){
      |     ^~~~
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
#include <stack>
#include <set>
#include <bitset>
#include <functional>
#include <cassert>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  int n;cin>>n;
  bool b[1000001];
  REP(i,1000001){
    b[i] = false;
  }
  b[0] = true;
  vector<int> v;
  REP(i,n){
    int t;cin>>t;
    v.pb(t);
  }
  VSORT(v);

  REP(i,v.size()){
    if(v[i+1] == v[i]){
      int j = i+1;
      int tmp = v[i];
      int p = v[i]
      if(b[v[i]] == false){
        while(tmp<1000001){
          b[tmp] = true;
          tmp += p;
        }
      }
      
      while(j<v.size()){
        j++;
        if(v[j] != v[i]){
          v.erase(v.begin()+i,v.begin()+j);
          break;
        }
      }
      i--;
    }
  }

  int ans = 0;

  REP(i,v.size()){
    if(b[v[i]]==false){
      ans++;
      int tmp = v[i];
      int p = v[i]
      while(tmp<1000001){
        b[tmp] = true;
        tmp += p;
      }
    }
  }

  cout<<ans<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:7: error: expected ',' or ';' before 'if'
   73 |       if(b[v[i]] == false){
      |       ^~
a.cc:98:7: error: expected ',' or ';' before 'while'
   98 |       while(tmp<1000001){
      |       ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
using Graph = vector<vector<int>>;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

int main (){
  int N,ans=0;
  cin>>N;
  vector<int>A(N);
  rep(i,N) cin>>A[i];
  sort(A.begin(),A.end(),gready());
  rep(i,N){
    int task=0;
    rep(j,N){
      if(i!=j){
        if(A[i]%A[j]!=0) task++;
        else break;
      }
    }
    if(task==N-1) ans++;
  }
  cout<<ans;
}


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

/* include c++ libraries */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <queue>
#include <set>

/* include c-lang libraries */
#include <climits>
#include <cmath>

/* include my libraries */
#include <show_vec.hh>

using namespace std;
#define LINE DEBUG printf("LINE : %d\n", __LINE__);

#define DEBUG if(false)

using ll = long long;
#define loop(i, n) for(i = 0; i < n; i++)
template<class T> using vec = vector<T>;

const int MOD = 1000000007;

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

  sort(A.begin(), A.end());
  set<int> Duplication;
  for(int i = N-2; i >= 0; i--){
    // 重複削除
    // O(n)
    if(A[i] == A[i+1]){
      A.erase(A.begin() + i+1);
      Duplication.insert(A[i]);
    }
  }
  LINE;
  int i = 0;
  while(true){
    if(i == (A.size()-1)){
      break;
    }

    int a = A[i];
    // A[j] % A[i]
    for(int j = A.size()-1; j > i; j--){
      if(A[j] % a == 0){
        A.erase(A.begin()+j);
      }
    }

    i++;
  }
  DEBUG LINE;
  vec<int> dupli;
  DEBUG printf("size : %d\n", Duplication.size());
  for(auto itr = Duplication.begin(); itr != Duplication.end(); itr++){
    if(Duplication.size() == 0) break;
    DEBUG LINE;
    DEBUG cout << *itr << endl;
    dupli.push_back(*itr);

  }
  DEBUG LINE;
  if(dupli.size() > 0){
    // 尺取り
    LINE;
    sort(dupli.begin(), dupli.end());
    int a = A.size()-1;
    int d = dupli.size()-1;
    while(a >= 0 && d >= 0){
      LINE;
      if(dupli[d] == A[a]){
        A.erase(A.begin()+a);
        a--;
        continue;
      }
      if(dupli[d] < A[a]){
        a--;
        continue;
      }
      if(dupli[d] > A[a]){
        d--;
      }
    }
  }
  cout << A.size() << endl;


  return 0;
}


Compiler output:
a.cc:16:10: fatal error: show_vec.hh: No such file or directory
   16 | #include <show_vec.hh>
      |          ^~~~~~~~~~~~~
compilation terminated.