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

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

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

template <typename T=long long>
T gcd(T a, T b)
{
    if(b == 0) return a;
    else return gcd<T>(b, a % b);
}

int main()
{
    int N;
    cin >> N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];

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

    vector<int> num(1e+6+1, 0);
    REP(i, N) ++num[A[i]];

    int ans = 0;
    vector<bool> divide(1e+6+1, false);
    REP(i, N){
        int tmp = A[i];
        if(!divide[tmp] and num[A[i]] == 1){
            ++ans;
            for(int j = 1; tmp <= 1e+6; ++j){
                tmp = A[i]*j;
                if(divide[tmp]) break;
                divide[tmp] = true;
            }
        }
    }
    cout << ans << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:42:25: error: expected '}' at end of input
   42 |     cout << ans << endl;
      |                         ^
a.cc:18:1: note: to match this '{'
   18 | {
      | ^
Language: Java

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 c = 0;
		for(int i=0; i<n; i++) {
			boolean flg = false; 
			for(int j=0; j<n; j++) {
				if(i == j ) continue;
				if(a[i]%a[j]==0){
					flg = true;
					break;
				}
			}
			if (flg == false) c++;
		}
			
		System.out.println(c);
	}	
}

Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

void main(){
    int N;
    cin >> N;
    int vec[N];
    for(int i=0; i<N; i++) cin >> vec[i];
    sort(vec, vec + N);
    int count = 0;
    int flag = 1;
    
    for (int i = 0; i < N; i++) {
        flag = 1;
        if (i!=N-1){
            if (vec[i]==vec[i+1]){
                flag = 0;
                continue;
            }
        }
        for (int j = 0; j < i; j++) {
            if (vec[i]%vec[j]==0){
                flag=0;
                break;
            }
        }
        count+=flag;
    } 
    cout << count << endl;
}

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

#incude<iostream>
using namespace std;
int main(){
  vector <int> a;
  int n,cnt=0;
  cin>>n;
  
  for(int i=0;i<n;i++){
    for (int j=0;j<n;j++){
      if(i!=j){
        if((a[j] % a[i])!=0)
        {
          cnt++;
        }
      }
    }
  }
  return 0;
}
        

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incude; did you mean #include?
    1 | #incude<iostream>
      |  ^~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:3: error: 'vector' was not declared in this scope
    4 |   vector <int> a;
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #incude<iostream>
a.cc:4:11: error: expected primary-expression before 'int'
    4 |   vector <int> a;
      |           ^~~
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incude<iostream>
a.cc:11:13: error: 'a' was not declared in this scope
   11 |         if((a[j] % a[i])!=0)
      |             ^
Language: C

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


int sort(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}

int main(){
  int ans=n,n,k=0;
  scanf("%d",&n);
  int a[n+1],b[n+1];
  for(int i=0;i<=n-1;i++){scanf("%d",&a[i]);b[i]=1;}
  
  qsort(a, n, sizeof(int), sort);
  
  
  for(int i=0;i<n;i++){
    for(int j=n-1;a[i]*a[i-1]<=a[j];j--){
      if(a[j]%a[i]==0 && b[j]==1){b[j]=0;ans-=1;}
    }
  }
  
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:11: error: 'n' undeclared (first use in this function)
   10 |   int ans=n,n,k=0;
      |           ^
main.c:10:11: 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;
  vector<int> v(n);
  for(int i=0;i<n;i++) cin>>v[i];
  sort(v.begin(),v.end());
  vector<int> vv(n);
  //for(int i=0;i<n;i++) 
  int ans=0;
  for(int i=1;i<n;i++){
    for(int j=0;j<i-1;j++){
      if(v[i]%v[j]==0){
        ans++;
        break;
      }
    }
  }
  cout<<ans;
}

Compiler output:
a.cc:1:10: error: #include expects "FILENAME" or <FILENAME>
    1 | #include bits/stdc++.h>
      |          ^~~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>n;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #include bits/stdc++.h>
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> v(n);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #include bits/stdc++.h>
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> v(n);
      |          ^~~
a.cc:8:29: error: 'v' was not declared in this scope
    8 |   for(int i=0;i<n;i++) cin>>v[i];
      |                             ^
a.cc:9:8: error: 'v' was not declared in this scope
    9 |   sort(v.begin(),v.end());
      |        ^
a.cc:9:3: error: 'sort' was not declared in this scope; did you mean 'short'?
    9 |   sort(v.begin(),v.end());
      |   ^~~~
      |   short
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> vv(n);
      |          ^~~
a.cc:21:3: error: 'cout' was not declared in this scope
   21 |   cout<<ans;
      |   ^~~~
a.cc:21:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: Java


import java.util.*;

public class D {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        final int N = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        for(int i=0;i<N;i++){
            a.add(sc.nextInt());
        }
        Collections.sort(a);

        int count = 0;
        int last = 0;
        List<Integer> a_buffer = new ArrayList<>();
        while(a.size() != 0 && last < 1000){
            int x = a.get(0);
            last = x;
            a.remove(0);
            boolean flag = true;
            while(a.size() != 0 && a.get(0) == x){
                flag = false;
                a.remove(0);
            }
            if(flag){
                count++;
            }
            for(int i=0;i<a.size();i++){
                if(a.get(i) % x != 0){
                    a_buffer.add(a.get(i));
                }
            }
            a.clear();
            a.addAll(a_buffer);
            a_buffer.clear();
        }

        while(a.size() != 0) {
            int x = a.get(0);
            a.remove(0);
            boolean flag = true;
            while (a.size() != 0 && a.get(0) == x) {
                flag = false;
                a.remove(0);
            }
            if (flag) {
                count++;
            }
        }

        System.out.println(count);
    }
}

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

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

int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    vector<int> a;
    for (int i = 0; i < n; i++) {
        int ai;
        cin >> ai;
        a.push_back(ai);
    }

    sort(a.begin(), a.end());
    int counter = 0;
    for (int i = 0; i < a.size(); i++) {
        bool f = false;
        if (i+1 < a.size() && a[i]==a[i+1]) continue;
        for (int j = 0; j < i; j++) {
            if (a[i]%a[j] == 0) {
                f = true;
                break;
            }
        }
        if (!f) {
            counter++;
        }
    }

    cout << counter << endl;
    return 0;
}


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

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

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

vll A;
ll B;
ll C;
ll N;
ll M;
ll K[base10_6];
vll ans;
vll A2;

ll ltmp;
string stmp;
double dtmp;

/*
max 448,000,000
map<string,ll> count_map;
count_map['0']=0;
for(auto x : count_map) {
    string key = x.first;
    ll value = x.second;
}
*/

vector<ll> prime_numbers;
void getPrimeNumbers(ll n_max){
    bool is_prime[n_max+1];
    for( int ni = 0 ; ni <=n_max ; ni++ ){
        is_prime[ni]=true;
    }
    is_prime[0]=is_prime[1]=false;
    for( int number = 2 ; number <=n_max ; number++ ){
        if(is_prime[number]){
            prime_numbers.push_back(number);
            for( int ni = number*2 ; ni <=n_max ; ni+=number ){
                is_prime[ni]=false;
            }
        }
    }
}
int main(){

    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    getPrimeNumbers(base10_6);
    map<ll,ll> count_map;


    cin >> N;
    rep(ni,N){
        cin >> ltmp;
        A.push_back(ltmp);
        count_map[ltmp]++;
    }
    sort(A.begin(),A.end());

    if(N==1){
        cout << A[0] << endl;        
    }else if(count_map.count(1)>0){
        if(count_map[1]==1){
            cout << 1 << endl;
        }else{
            cout << 0 << endl;
        }
    }else{
        if(count_map[0]==1) ans.push_back(A[0]);
        comp.push_back(A[0]);
        for( int ni = 1 ; ni <N ; ni++ ){
            bool flag = true;
            ll target = A[ni];
            rep(mi,comp.size()){
                ll compV = comp[mi];
                if(target % compV == 0){
                    flag = false;
                    break;
                }
            }
            if(flag){
                if(count_map[target]==1) ans.push_back(target);
                if(target*A[0] <= A[N-1]) comp.push_back(target);
            }
        }



    }



}

Compiler output:
a.cc: In function 'int main()':
a.cc:101:9: error: 'comp' was not declared in this scope
  101 |         comp.push_back(A[0]);
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  vector<int> arr;
  int n;
  cin>>n;
  int h;
  for(int i=0;i<n;i++)
  {
    cin >>h;
    arr.push_back(h);
  }
  sort(arr.begin(),arr.end());
  int sum =0;
  for(int i=0;i<arr.size();i++)
  {
      int flag =0;
      for(int j=0;j<i;j++)
      {
        if(i!=j&&arr[arr.size()-i-1]%arr[arr.size-j-1]==0)
        {
          flag =1;
          break;
        }     
      }   
    if(flag==0)
      sum++;
  }
  cout <<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:46: error: invalid use of member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = int; _Alloc = std::allocator<int>; size_type = long unsigned int]' (did you forget the '()' ?)
   21 |         if(i!=j&&arr[arr.size()-i-1]%arr[arr.size-j-1]==0)
      |                                          ~~~~^~~~
      |                                                  ()
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:8: error: 'arr' was not declared in this scope
    8 |   cin>>arr[i];
      |        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  vector<int> arr;
  int n;
  cin>>n;
  int h;
  for(int i=0;i<n;i++)
  {
    cin >>h;
    arr.push_back(h);
  }
  sort(arr.begin(),arr.end());
  int sum =0;
  for(int i=0;i<arr.size();i++)
  {
      int flag =0;
      for(int j=0;j<i;j++)
      {
        if(i!=j&&arr[arr.size()-i-1]%arr[arra.size-j-1]==0)
        {
          flag =1;
          break;
        }     
      }   
    if(flag==0)
      sum++;
  }
  cout <<sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:42: error: 'arra' was not declared in this scope; did you mean 'arr'?
   21 |         if(i!=j&&arr[arr.size()-i-1]%arr[arra.size-j-1]==0)
      |                                          ^~~~
      |                                          arr
Language: C++

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

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

int main() {
    int n;
    int res=0;
    cin >> n;
    int a[n];
    int b[n];
    rep(i,n){
        cin >> a[i];
        b[i]=0;
    }

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

    for (int i=0; i<n; ++i){
        for (int j=j+1; j<n; ++j){
            if(i==j) continue;
            if(a[i]%a[j]!=0){
                ++b[i];
            }else{
                break;
            }
        }
    }

    rep(i,n){
        //cout << b[i] << "\n";
        if(b[i]==n-1) ++res;
    }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: request for member 'begin' in 'a', which is of non-class type 'int [n]'
   17 |     sort(a.begin(),a.end());
      |            ^~~~~
a.cc:17:22: error: request for member 'end' in 'a', which is of non-class type 'int [n]'
   17 |     sort(a.begin(),a.end());
      |                      ^~~
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
//#include <stack>
//#include <queue>
//#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <list>
#include <iomanip>

using namespace std;

#define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define prec std::cout << std::fixed << std::setprecision(15);
#define endl "\n"
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
#define rep(i,a,n) for(Int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(Int (i)=(a); (i)<=(n); (i)++)
const int MAX_N = 1000000;
const Int MAX_N_Int = 1000000000000;

vector<int>A(1000000+5);
Int cnt=0;
int divisor(int64_t n) {
    bool has=false;
    for(int64_t i = 1; i * i <= n; i++) {
        if(n % i == 0) {
            if(A[i]!=0){
                if(n!=i){
                has=true;
                //cout<<n<<" "<<i<<endl;}
            }
            //A.push_back(i);
            if(i * i != n) {
                //A.push_back(n / i);
                if(A[n / i]!=0){
                    if(n!=n/i){
                    has=true;
                    //cout<<n<<" "<<n/i<<"q"<<endl;}
                }
            }
        }
    }
    if(has)cnt++;
    return 0;
}

int main() {
    //COMinit();
    IOS;
    prec;
    Int a,b,v,w,c,n,t,m,k,x,y=0,ans=1;
    string str,s="",u;
    cin>>n;
    vector<int>l(n);

    for (int i = 0; i < n; ++i) {
        cin>>a;
        l[i]=a;
        A[a]=1;
    }
    for (int j = 0; j < n; ++j) {
        divisor(l[j]);
    }
    cout<<n-cnt;





    cout<<endl;
    return 0;
}




Compiler output:
a.cc: In function 'int divisor(int64_t)':
a.cc:57:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   57 | int main() {
      |         ^~
a.cc:57:9: note: remove parentheses to default-initialize a variable
   57 | int main() {
      |         ^~
      |         --
a.cc:57:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:57:12: error: a function-definition is not allowed here before '{' token
   57 | int main() {
      |            ^
a.cc:82:2: error: expected '}' at end of input
   82 | }
      |  ^
a.cc:35:41: note: to match this '{'
   35 |     for(int64_t i = 1; i * i <= n; i++) {
      |                                         ^
a.cc:82:2: error: expected '}' at end of input
   82 | }
      |  ^
a.cc:33:24: note: to match this '{'
   33 | int divisor(int64_t n) {
      |                        ^
a.cc:82:2: warning: control reaches end of non-void function [-Wreturn-type]
   82 | }
      |  ^
Language: C++

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

int main(){
    int N;
    cin >> N;
    vector<int> vec(N);
    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }
    sort(vec.begin(),vec.end());
    int count = 0;
    for (int i = 0; i < N; i++) {
        int flag = 1;
        for (int j = 0; j < i+1; j++) {
            if (j==i || j=N){
                continue;
            }
            if (vec.at(i)%vec.at(j)==0){
                flag=0;
                break;
            }
        }
        count+=flag;
    } 
    cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:22: error: lvalue required as left operand of assignment
   17 |             if (j==i || j=N){
      |                 ~~~~~^~~~
Language: C++

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

using namespace std;

using ll = long long;

template <class T>
using grid = vector<vector<T>>;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define input(...) __VA_ARGS__; in(__VA_ARGS__)

void print() {
  std::cout << std::endl;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  std::cout << head << " ";
  print(std::forward<Tail>(tail)...);
}

void in() { }

template <class Head, class... Tail>
void in(Head&& head, Tail&&... tail) {
  cin >> head;
  in(std::forward<Tail>(tail)...);
}

ll is_prime(ll x) {
  if (x <= 2) return true;

  FOR(i, 2, (int)sqrt(x) + 1) {
    if (x % i == 0) return false;
  }

  return true;
}

int main() {
  int MAX = 2 * pow(10, 5) + 1;
  vector<bool> erat(MAX, false);
  ll input(n);
  vector<ll> a(n);
  REP(i, n) cin >> a[i];
  sort(a.begin(), a.end());

  vector<ll> dup(MAX, 0);

  ll ans = 0;
  for (auto v: a) {
    if (!erat[v]) {
      ans += 1;
      fill_erat(erat, v);
      dup[v] += 1;
    } else {
      if (dup[v] == 1) {
        ans -= 1;
        dup[v] += 1;
      }
    }
  }
  print(ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:7: error: 'fill_erat' was not declared in this scope
   63 |       fill_erat(erat, v);
      |       ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define endl  "\n"
#define ll long long
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cin.exceptions(cin.failbit);cout.tie(NULL);
using namespace std;
bool isPrime(int n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i += 6)
    {
        if ((n % i == 0) || (n % (i + 2) == 0))
            return false;
    }
    return true;
}
int32_t main()
{
	ll n;
	cin >> n;
	ll a[n];
	set<ll> s;
	unordered_map<ll,ll> mp;
	for(ll i=0;i<n;i++)
	{
		cin >> a[i]; 
		s.insert(a[i]);
		mp[a[i]]++;
	}	
	ll c=0;
	for(ll i=0;i<n;i++)
	{
		
		if(mp[a[i]]>1)
		{
			continue;
		}
		ll x=a[i];
		ll raj=0;
		for(ll j=1;j<=sqrt(x);j++)
		{
			if(x%j==0)
			{
				if(x/j == j)
				{
					if(j!=x && s.find(j)!=s.end())
					{
						raj=1;
						break;
					}
				}
				else
				{
					if(j!=x && s.find(j)!=s.end())
					{
						raj=1;
						break;
					}
					if(x/j!=x && s.find(x/j)!=s.end())
					{
						raj=1;
						break;
					}
				}
			}
		}
		if(raj==0)
		c++;
	}
	cout << c;
}
#include<bits/stdc++.h>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define endl  "\n"
#define ll long long
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cin.exceptions(cin.failbit);cout.tie(NULL);
using namespace std;
bool isPrime(int n)
{
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i += 6)
    {
        if ((n % i == 0) || (n % (i + 2) == 0))
            return false;
    }
    return true;
}
int32_t main()
{
  	fast;
	ll n;
	cin >> n;
	ll a[n];
	set<ll> s;
	unordered_map<ll,ll> mp;
	for(ll i=0;i<n;i++)
	{
		cin >> a[i]; 
		s.insert(a[i]);
		mp[a[i]]++;
	}	
	ll c=0;
	for(ll i=0;i<n;i++)
	{
		
		if(mp[a[i]]>1)
		{
			continue;
		}
		ll x=a[i];
		ll raj=0;
		for(ll j=1;j<=sqrt(x);j++)
		{
			if(x%j==0)
			{
				if(x/j == j)
				{
					if(j!=x && s.find(j)!=s.end())
					{
						raj=1;
						break;
					}
				}
				else
				{
					if(j!=x && s.find(j)!=s.end())
					{
						raj=1;
						break;
					}
					if(x/j!=x && s.find(x/j)!=s.end())
					{
						raj=1;
						break;
					}
				}
			}
		}
		if(raj==0)
		c++;
	}
	cout << c;
}


Compiler output:
a.cc:95:6: error: redefinition of 'bool isPrime(long long int)'
   95 | bool isPrime(int n)
      |      ^~~~~~~
a.cc:13:6: note: 'bool isPrime(long long int)' previously defined here
   13 | bool isPrime(int n)
      |      ^~~~~~~
a.cc:110:9: error: redefinition of 'int32_t main()'
  110 | int32_t main()
      |         ^~~~
a.cc:28:9: note: 'int32_t main()' previously defined here
   28 | int32_t main()
      |         ^~~~
Language: Java

import sun.reflect.generics.tree.Tree;

import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;

public class Main {
    static Input in = new Input(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        int N = in.nextInt();
        List<Integer> A = new ArrayList<>();
        HashMap<Integer, Integer> count = new HashMap<>();
        for (int n = 0; n < N; n++) {
            int i = in.nextInt();
            A.add(i);
            count.put(i, count.getOrDefault(i, 0) + 1);
        }

        boolean[] b = new boolean[1000001];
        for (int a : A) {
            if (b[a]) continue;
            for (int i = a + a; i < 1000001; i += a)
                b[i] = true;
        }
        
        int ans = 0;
        for (int a : A) {
            if (!b[a] && count.get(a) == 1)
                ans++;
        }
        out.println(ans);

        out.flush();
    }

    static class Input {
        private BufferedReader br;
        private String[] buff;
        private int index = 0;

        Input(InputStream is) {
            br = new BufferedReader(new InputStreamReader(is));
        }
        String nextLine() {
            try {
                return br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return null;
        }
        String next() {
            while (buff == null || index >= buff.length) {
                buff = nextLine().split(" ");
                index = 0;
            }
            return buff[index++];
        }
        byte nextByte() {
            return Byte.parseByte(next());
        }
        short nextShort() {
            return Short.parseShort(next());
        }
        int nextInt() {
            return Integer.parseInt(next());
        }
        long nextLong() {
            return Long.parseLong(next());
        }
        float nextFloat() {
            return Float.parseFloat(next());
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
        BigInteger nextBigInteger() {
            return new BigInteger(next());
        }
        BigDecimal nextBigDecimal() {
            return new BigDecimal(next());
        }
    }
}



Compiler output:
Main.java:1: error: package sun.reflect.generics.tree is not visible
import sun.reflect.generics.tree.Tree;
                           ^
  (package sun.reflect.generics.tree is declared in module java.base, which does not export it)
1 error
Language: C++

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

// {
#define debug(var)  do{ std::cout << #var << " : "; view(var); }while(0)
using ll = long long;
using ld = long double;
inline int num (const std::string& S, int idx) noexcept { return S.at(idx) - '0'; }
inline int ctoi(char c) noexcept { return c - '0'; }
inline bool isNumber(char c) noexcept { return ('0'<c && c<'9'? true : false); }
inline int safeCtoi(char c) { if(isNumber(c)) { return ctoi(c); } else { throw 1; } }
inline char itoc(int i) noexcept { return i + '0'; }
inline unsigned int bitMask(int i) noexcept { return (1 << i); }
inline bool isTrue(unsigned int bit, int i) noexcept { return bit & bitMask(i); }
inline bool isEven(int num) noexcept { return !num%2; }
inline bool isOdd(int num) noexcept { return num%2; }
template<typename T> inline short sgn(T num) noexcept { return (num==0? 0 : (num>0? 1 : -1) ); }
template<typename T> inline bool isZero(T num) noexcept { return (num==0? true : false); }
template<typename T> inline bool isPositive(T num) noexcept { return (num>0? true : false); }
template<typename T> inline bool isNegative(T num) noexcept { return (num<0? true : false); }
template<typename T> void view(T e) noexcept { cout << e; }
template<typename T> void view(std::vector<T> v) noexcept { for(const auto& e : v) cout << e << " "; }
template<typename T> void view(std::vector<std::vector<T>> vv) noexcept { for(const auto& v : vv) view(v); }
//}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> a(n);
	for(auto& e : a) cin >> e;
	sort(a.begin(), a.end());
	int notDivisibles = 0;
	for(int i=0; i<n; ++i){
		bool isDivisible = false;
		for(int j=0; j<n; ++j){
			if( i==j ) continue;
			if( a[j] > a[i] ) break;
			if( a[i] % a[j] == 0 ){
				isDivisible = true;
				break;
			}
		}
		if( !isDivisible ){
			notDivisibles ++;
		}
	}
	cout << notDivisibles << endl;
	return 0;
}

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

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

#define deb(var) cout << "[" << (#var) << " : " << var <<"]" << " "
#define debv(v) cout << "[" << (#v) << " : {";for(int i = 0; i < v.size() - 1; ++i)\
					cout << v[i] <<", ";cout << v.back() << "}] "
#define deba(a,n) cout << "[" << (#a) << " : {";for(int i = 0; i < n - 1; ++i)\
					cout << a[i] << ", ";cout << a[n - 1] << "}] "
#define debp(p) cout << "[" << (#p) << " : {" << p.first << ", " << p.second << "}] "
#define debs(s) cout << "[" << (#s) << " : {";auto _itr = s.begin();\
					for(int k = s.size(); k > 1; --k) {cout << *_itr << ", "; ++_itr;} cout << *_itr << "}] "

typedef long long ll;

/*LETS BEGIN WITH THE NAME OF LORD MAHADEV*/
const int mxN = 2e5;
int ar[mxN];

int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; ++i){
		cin >> ar[i];
	}

	int ans = 0;
	sort(ar, ar + n);
	for(int i = 0; i < n; ++i){
		f = true;
		for(int j = 0; j < i; ++j){
			if(i != j){
				if(ar[i] % ar[j] == 0){
					f = false;
					break;
				}
			}
		}
		if(f){
			++ans;
		}
	}
	cout << ans << endl;
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
#define int long long
int INF = 1e9+7;
int main() {
    int N;
    cin >> N;
    vector<int>A(N);
    vector<int> is_prime(1000005,1);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(),A.end());
    int ans = 0;
    if(N > 1) {
        if(A[0] != A[1]) {
            ans++;
        }
    }
    if(N == 1) {
        cout << 1 << endl;
        return 0;
    }
    is_prime[A[0]] = 0;
    for(int i = A[0]*2; i < 1000005; i+=A[0]) {
        is_prime[i] = 0;
    }
    for (int i = 1; i < N; i++) {
        if (!is_prime[A[i]]) {
            continue;
        }
        ans++;
        for (int j = A[i]*2; j < 1000005; j+=A[i]) {
            is_prime[j] = 0;
        }
    }
    cout << ans << endl;
}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <algorithm>
#define MOD1 1000000007
#define MOD2 998244353
#define LIMIT1 200002
#define LIMIT2 500002
typedef long long ll;
typedef long double ld;
typedef const void cv;
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define per(i,n) for((i)=(n)-1;(i)>=0;(i)--)
#define max(a,b) ((a)>(b) ? (a) : (b))
#define min(a,b) ((a)<(b) ? (a) : (b))
#define zt(a,b) (max((a),(b))-min((a),(b)))
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll nPr(int n,int r){ll i,result=1;rep(i,r){result*=(ll)(n-i);}return result;}
ll nCr(int n,int r){ll i,result=1;if(n<r) return 0;rep(i,min(r,n-r)){result*=(ll)(n-i);result/=(ll)(i+1);}return result;}
#define nHr(n,r) nCr((int)((n)+(r)+1),(int)(r))
#define sankaku(x) (((x)*((x)+1))/2)
int dx[8]={1,0,-1,0,1,-1,-1,1},dy[8]={0,1,0,-1,1,1,-1,-1};
int upint(cv *a, cv *b) { return *(int *)a < *(int *)b ? -1 : *(int *)a > *(int *)b ? 1 : 0; }
int downint(cv *a, cv *b) { return *(int *)a < *(int *)b ? 1 : *(int *)a > *(int *)b ? -1 : 0; }
int upchar(cv *left, cv *right) {return strcmp((char *)left,(char *)right);}
int downchar(cv *left, cv *right) {return strcmp((char *)right,(char *)left);}
void tmpInit(int *c,ll m) {ll i;rep(i,m) c[i]=i;}
ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1){
      res *= a; if(mod>=1) res %= mod;
    }
    a *= a; if(mod>=1) a %= mod;
    n >>= 1;
  }
  return res;
}
void initialize(){
  
}
int main(void){
  initialize();
  ll n,m,i,j,k,result=0,tmp;
  int a[LIMIT2]={0},b[LIMIT1]={0};
  char s[LIMIT1];
  
  scanf("%lld",&n);
  k=0;
  rep(i,n){
    scanf("%d",&a[i]);
    b[a[i]]++;
    if(i==0) m = a[i];
    else m = min(m,a[i]);
    k = max(k,a[i]);
  }
  qsort(a,n,sizeof(int),upint);
  
  result = n;
  for(i=1;i<=k;i++){
    if(b[i]==0) continue;
    if(b[i]>=2){
      result -= b[i];
      b[i]=0;
    }
    for(j=2*i;j<=k;j+=i){
      result -= b[j];
      b[j]=0;
    }
  }
  
  printf("%lld\n",result);
  return 0;
}

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

#include <iostream>
using namespace std;

const int MAX_N = 2 * 100000;
int N, A[MAX_N];

int solve() {
	std::sort(A, A+N);
	int cnt = 0;
	for (int i=0; i<N; i++) {
		bool chek = false;
		for (int j=0; j<N; j++) {
			if (i == j) {
				continue;
			}
			if (A[i] < A[j]) {
				break;
			}

			if (A[i] % A[j] == 0) {
				chek = true;
				break;
			}
		}
		if (!chek) {
			cnt++;
		} 
	}
	return cnt;
}

int main() {
	scanf("%d", &N);
	for (int i=0; i<N; i++) {
		scanf("%d", &A[i]);
  }
	printf("\n%d", 	solve());
	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:8:14: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
    8 |         std::sort(A, A+N);
      |              ^~~~
      |              qsort
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
typedef long long ll;
typedef double dd;
#define pb push_back
#define mp make_pair
#define endl "\n"
ll const M = 1000000007;
dd const pi = acos(-1);
ll const inf = 2e18;
ll const N = 200001;
int main()
{
    fast;
    ll i,j,t,n,cnt = 0;
    cin >> n;
    vector<ll> a(n),freq(1e6 + 1,0);
    map<ll,bool> m;
    for(i = 0; i < n; i++)
    {
    	cin >> a[i];
    	m[a[i]] = true;
    	freq[a[i]]++;
    }
    for(i = 0; i < n; i++)
    {
    	bool ok = false;
    	if(freq[a[i]] > 1)
    	{
    		a[i] = 0;
    		continue;
    	}
    	for(j = 2; j*j <= a[i]; j++)
    	{
    		if(a[i] % j == 0 && (m[j] || m[a[i] / j]))
    		{
    			ok = true;
    			break;
    		}
    	}
    	if(ok || m[1])
    		a[i] = 0;
    }
    for(i = 0; i < n; i++)
    	if(a[i] != 0)
    		cnt++;
    cout<<cnt<<endl;
    return 0;

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

#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define modul 998244353
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,a[200005],ans[2000005],viz[2000005];
int32_t main(){
CODE_START;
cin>>n;
for(ll i=1;i<=n;i++)
{
    cin>>a[i];
    viz[a[i]]++;
    if(viz[a[i]]==1){
        v.pb(a[i]);
    }
    if(viz[a[i]]>=2){
        ans[a[i]]=-1;
    }
}
for(ll k=0;k<v.size();k++)
{
    ll x=v[k];
    for(ll j=2*x;j<=1000000;j=j+x)
    {
        if(viz[j]>=1){
            ans[j]=-1;
        }
    }
}
ll rs=0;
for(ll i=1;i<=n;i++)
{
    if(ans[a[i]]==0){
        rs++;
    }
}
cout<<rs<<endl;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:30:9: error: 'v' was not declared in this scope
   30 |         v.pb(a[i]);
      |         ^
a.cc:36:14: error: 'v' was not declared in this scope
   36 | for(ll k=0;k<v.size();k++)
      |              ^
Language: C++

#define int long long

using namespace std;

const int N = 1e6 + 10;

int a[N];
int m[N];

int32_t main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);    
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
        ++m[a[i]];
    }
    int ans = 0;
    map<int, bool> nope;
    for (int i = 0; i < n; ++i)
    {
        if (m[a[i]] > 1) nope[a[i]] = 1;   
        for (int j = 2; a[i] * j <= 1000000; ++j)
        {
            if (m[a[i] * j]) nope[a[i] * j] = 1;
        }
    }
    int c = 0;
    for (auto &i : nope) c += m[i.first];
    cout << n - c;
    return 0;
}

Compiler output:
a.cc:10:1: error: 'int32_t' does not name a type
   10 | int32_t main()
      | ^~~~~~~
a.cc:1:1: note: 'int32_t' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
  +++ |+#include <cstdint>
    1 | #define int long long
Language: C++

#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
int arr[200005],n,ans;
bool d[1000006];
int main(){
	cin>>n;
	for(int i =1;i<=n;i++){
		cin>>arr[i];
		
	}
	sort(arr+1,arr+n+1);
	for(int i =1;i<=n;i++){
		// if()
		for(int j =arr[i];j<=1000000;j+=arr[i]){
			if(d[j]>=2)break;
			d[j]++;
			// d[j]=1;
		}
	}
	for(int i =1;i<=n;i++){
		if(!d[arr[i]])ans++;
	}
	cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:28: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   19 |                         d[j]++;
      |                         ~~~^
Language: C++

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

const int sz = 1e6+5;
int cnt[sz];
int hit[sz];
int pos[sz];

int main() {
  int N;
  cin >> N;
  memset(pos, -1, sizeof pos);
  int dat[N];
  for (int i = 0; i < N; ++i) {
    cin >> dat[i];
    pos[dat[i]] = i;
    ++cnt[dat[i]];
  }
  for (int i = 1; i < sz; ++i) {
    if (cnt[i]) {
      hit[i] += cnt[i] - 1;
      for (int j = i + i; j < sz; j += i) {
        hit[j] += cnt[i];
      }
    }
  }
  for (int i = 1; i < sz; ++i) {
    if (pos[i] != -1) {
      cout << pos[i] << '\n';
      return 0;
    }
  }
  cout <<
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:1: error: expected primary-expression before '}' token
   34 | }
      | ^
Language: C++

/**
 *    author:  morato
 *    created: 29.08.2020 18:14:06
**/
#include <bits/stdc++.h>

using namespace std;

struct Info {
  int strikes, dir, tam;
  int x, y;
  Info(int a, int b, int c, int d, int e): strikes(a), dir(b), tam(c), x(d), y(e) {}
  bool operator>(const Info& other) const {
    if (strikes == other.strikes) {
      return tam < other.tam;
    }
    return strikes < other.strikes;
  }
};

int vx[] = {0, 0, -1, 1};
int vy[] = {1, -1, 0, 0};
int H, W, K;

bool valid(int x, int y) {
  return (x > 0 && x <= H && y > 0 && y <= W);
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> H >> W >> K;
  int x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  vector<vector<int>> grid(H + 1, vector<int>(W + 1, 1));
  vector<vector<int>> vis(H + 1, vector<int>(W + 1, 0));
  for (int i = 1; i <= H; i++) {
    for (int j = 1; j <= W; j++) {
      char ch;
      cin >> ch;
      if (ch == '@') {
        grid[i][j] = 0;
      }
    }
  }
  priority_queue<Info, vector<Info>, greater<Info>> pq;
  pq.push(Info(0, -1, 0, x1, y1));
  while (!pq.empty()) {
    Info lugar = pq.top();
    pq.pop();
    if(vis[lugar.x][lugar.y]) {
      continue;
    }
    vis[lugar.x][lugar.y] = 1;
    if (nx == x2 && ny == y2) {
      cout << lugar.strikes << '\n';
      return 0;
    }
    for (int i = 0; i < 4; i++) {
      int nx = lugar.x + vx[i];
      int ny = lugar.y + vy[i];
      if (valid(nx, ny) && grid[nx][ny] && !vis[nx][ny]) {
        int new_strikes = 0;
        int new_tam = 0;
        if (i == lugar.dir) {
          if (lugar.tam == K) {
            new_strikes = lugar.strikes + 1;
            new_tam = 1; 
          } else {
            new_strikes = lugar.strikes;
            new_tam = lugar.tam + 1;
          }
        } else {
          new_strikes = lugar.strikes + 1;
          new_tam = 1;
        }
        pq.push(Info(new_strikes, i, new_tam, nx, ny));
      }
    }
  }
  cout << -1 << '\n';
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:9: error: 'nx' was not declared in this scope; did you mean 'vx'?
   55 |     if (nx == x2 && ny == y2) {
      |         ^~
      |         vx
a.cc:55:21: error: 'ny' was not declared in this scope; did you mean 'yn'?
   55 |     if (nx == x2 && ny == y2) {
      |                     ^~
      |                     yn
Language: C++

//Shariful Islam(1804011)
//Chittagong University of Engineering & technology
#include<bits/stdc++.h>
#define pb push_back
#define fin(i,arr,n) for(i=0;i<n;i++)cin>>arr[i]
#define fout(i,arr,n) for(i=0;i<n;i++)cout<<arr[i]<<" "
#define inf 9223372036854775807
#define vi vector<ll>
#define init ll n,m,a,i,b,j,k,t,x,y,z,tc,u,v,w
#define pi acos(-1.00)
#define mod 1000000007
using namespace std;
typedef long long ll;
struct node{ll r,c;}n1;
ll dr[]={-1,0,1,0};
ll dc[]={0,-1,0,1};
ll R,C,a,b,x,y,k;
ll visited[1000005]={0};
char ch[1000005];
ll f(ll i,ll j)
{
    return i*C+j+1;
}
bool valid(ll r,ll c)
{
    if(f(r,c)<1||f(r,c)>R*C) return 0;
  return (r>=0&&c>=0&&r<R&&c<C&&visited[f(r,c)]==0);

}

node inv(ll t)
{
    node n1;
    if(t%C==0)
        {n1.r=t/C-1;n1.c=C-1;}
    else {n1.r= t/C;n1.c=(t%C)-1;}
    return n1;


}

ll bfs(ll r1,ll c1,ll r2,ll c2)
{  ll dist[1000005]={0};

   ll i,j;
   queue<ll>Q;
   Q.push(f(r1,c1));
   visited[f(r1,c1)]=1;
   dist[f(r1,c1)]=0;
   while(!Q.empty())
   {
       ll u=Q.front();Q.pop();
        if(u<1||u>R*C) continue;
       n1=inv(u);
       for(i=0;i<4;i++)
       {  ll flag=0;
          for(j=1;j<=k;j++)
          {   ll v=f(n1.r+dr[i]*j,n1.c+dc[i]*j);

             if(valid(n1.r+dr[i]*j,n1.c+dc[i]*j)&&flag==0)
             {

              visited[v]=1;
              dist[v]=dist[u]+1;
              if(f(r2,c2)==v)
                return dist[v];
              Q.push(v);

             }
             else if(v>=1&&v<=R*C)
                 {   if(ch[v]=='@')
                     flag=1,break;

                 }
          }
        
       }

   }
return -1;
}
int main()
{  ios_base::sync_with_stdio(false);  cin.tie(NULL); cout.tie(0);
      //freopen("read.txt","r",stdin);
      //freopen("write.txt","w",stdout);
      ll i,j;
     cin>>R>>C>>k>>a>>b>>x>>y;

      for(i=0;i<R;i++)
      {
          for(j=0;j<C;j++)
          {    char c;

             cin>>c;
              ch[i*C+j+1]=c;
              if(c=='@')
                visited[f(i,j)]=1;



          }
      }
      /*f(i,R)
      {
          f(j,C)
          cout<<visit[i*C+j+1];
          cout<<endl;
      }*/
     /* for(i=0;i<R;i++)
      {
          for(j=0;j<C;j++)
          {
              cout<<rsum[f(i,j)]<<" ";
          }
          cout<<endl;
      }
      cout<<"__________"<<endl;
      for(i=0;i<R;i++)
      {
          for(j=0;j<C;j++)
          {
              cout<<csum[f(i,j)]<<" ";
          }
          cout<<endl;
      }*/
      cout<<bfs(a-1,b-1,x-1,y-1)<<endl;
     // cout<<inv(12).r<<" "<<inv(12).c<<endl;



}


Compiler output:
a.cc: In function 'll bfs(ll, ll, ll, ll)':
a.cc:72:29: error: expected primary-expression before 'break'
   72 |                      flag=1,break;
      |                             ^~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<stdlib.h>
#include<queue>
#include<string.h>
#include<map>
#include<set>
#define maxn 1000005
#define lson (now<<1)
#define rson ((now<<1)|1)
#define mid ((nl+nr)>>1)
using namespace std;
typedef long long ll;
struct nod
{
	int f;
	int id;
	ll dis;
	nod(int o,int a,ll b)
	{
		f=o;
		id=a;
		dis=b;
	}
	nod(){}
};

bool operator<(nod a,nod b)
{
	return a.dis>b.dis;
}

int n,m,k;
int xx1,yy1,xx2,yy2;
string ss[maxn];
int vis[4][maxn];
ll dis[4][maxn];
priority_queue<nod> q;
int getid(int x,int y)
{
	return x*m+y;
}

int fx[maxn]={0,0,1,-1};
int fy[maxn]={1,-1,0,0};

void dijkstra(int s)
{
	for(int o=0;o<=3;o++)
	{
		for(int i=0;i<=n*m;i++)
			dis[o][i]=-1,vis[o][i]=0;
		dis[o][s]=0;
		q.push(nod(o,s,0));
	}
		
	
	while(!q.empty())
	{
		int now=q.top().id; 
		int no=q.top().f;
		q.pop();
		if(vis[no][now]) continue;
		vis[no][now]=1;
		int xx=now/m,yy=now%m;
		
		int nx=xx+fx[no];
		int ny=yy+fy[no];
		
		if(0<=nx && nx<n && 0<=ny && ny<m && ss[nx][ny]!='@')
		{
			int nex=getid(nx,ny);
			if(dis[no][nex]==-1 || dis[no][nex]>dis[no][now]+1)
			{
				dis[no][nex]=dis[no][now]+1;
				q.push(nod(no,nex,dis[no][nex]));
			}
		}
		
		for(int i=0;i<=3;i++)
		if(i!=no)
		{
			ll nexdis=dis[no][now];
			if(dis[no][now]%k)
				nexdis+=(k-(dis[no][now]%k));
			if(dis[i][now]==-1 || dis[i][now]>nexdis)
			{
				dis[i][now]=nexdis;
				q.push(nod(i,now,dis[i][now]));
			}
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d%d",&xx1,&yy1,&xx2,&yy2);
	xx1--; yy1--; xx2--; yy2--;
	for(int i=0;i<n;i++)
		cin>>ss[i];
	dijkstra(getid(xx1,yy1));
	
	
	if(dis[0][getid(xx2,yy2)]==-1)
		printf("-1\n");
	else
	{
		ll maxx=LONG_LONG_MAX;
		for(int i=0;i<3;i++)
		{
			ll d=dis[i][getid(xx2,yy2)];
			if(d%k)
				d+=(k-d%k);
			maxx=min(maxx,d);
		}
		printf("%lld\n",maxx/k);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:110:25: error: 'LONG_LONG_MAX' was not declared in this scope
  110 |                 ll maxx=LONG_LONG_MAX;
      |                         ^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<string.h>
#include<map>
#include<set>
#define maxn 1000005
#define lson (now<<1)
#define rson ((now<<1)|1)
#define mid ((nl+nr)>>1)
using namespace std;
typedef long long ll;
struct nod
{
	int f;
	int id;
	ll dis;
	nod(int o,int a,ll b)
	{
		f=o;
		id=a;
		dis=b;
	}
	nod(){}
};

bool operator<(nod a,nod b)
{
	return a.dis>b.dis;
}

int n,m,k;
int xx1,yy1,xx2,yy2;
string ss[maxn];
int vis[4][maxn];
ll dis[4][maxn];
priority_queue<nod> q;
int getid(int x,int y)
{
	return x*m+y;
}

int fx[maxn]={0,0,1,-1};
int fy[maxn]={1,-1,0,0};

void dijkstra(int s)
{
	for(int o=0;o<=3;o++)
	{
		for(int i=0;i<=n*m;i++)
			dis[o][i]=-1,vis[o][i]=0;
		dis[o][s]=0;
		q.push(nod(o,s,0));
	}
		
	
	while(!q.empty())
	{
		int now=q.top().id; 
		int no=q.top().f;
		q.pop();
		if(vis[no][now]) continue;
		vis[no][now]=1;
		int xx=now/m,yy=now%m;
		
		int nx=xx+fx[no];
		int ny=yy+fy[no];
		
		if(0<=nx && nx<n && 0<=ny && ny<m && ss[nx][ny]!='@')
		{
			int nex=getid(nx,ny);
			if(dis[no][nex]==-1 || dis[no][nex]>dis[no][now]+1)
			{
				dis[no][nex]=dis[no][now]+1;
				q.push(nod(no,nex,dis[no][nex]));
			}
		}
		
		for(int i=0;i<=3;i++)
		if(i!=no)
		{
			ll nexdis=dis[no][now];
			if(dis[no][now]%k)
				nexdis+=(k-(dis[no][now]%k));
			if(dis[i][now]==-1 || dis[i][now]>nexdis)
			{
				dis[i][now]=nexdis;
				q.push(nod(i,now,dis[i][now]));
			}
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d%d",&xx1,&yy1,&xx2,&yy2);
	xx1--; yy1--; xx2--; yy2--;
	for(int i=0;i<n;i++)
		cin>>ss[i];
	dijkstra(getid(xx1,yy1));
	
	
	if(dis[0][getid(xx2,yy2)]==-1)
		printf("-1\n");
	else
	{
		ll maxx=LONG_LONG_MAX;
		for(int i=0;i<3;i++)
		{
			ll d=dis[i][getid(xx2,yy2)];
			if(d%k)
				d+=(k-d%k);
			maxx=min(maxx,d);
		}
		printf("%lld\n",maxx/k);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:109:25: error: 'LONG_LONG_MAX' was not declared in this scope
  109 |                 ll maxx=LONG_LONG_MAX;
      |                         ^~~~~~~~~~~~~
Language: C++

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<string.h>
#include<map>
#include<set>
#define maxn 1000005
#define lson (now<<1)
#define rson ((now<<1)|1)
#define mid ((nl+nr)>>1)
using namespace std;
typedef long long ll;
struct nod
{
	int f;
	int id;
	ll dis;
	nod(int o,int a,ll b)
	{
		f=o;
		id=a;
		dis=b;
	}
	nod(){}
};

bool operator<(nod a,nod b)
{
	return a.dis>b.dis;
}

int n,m,k;
int x1,y1,x2,y2;
string ss[maxn];
int vis[4][maxn];
ll dis[4][maxn];
priority_queue<nod> q;
int getid(int x,int y)
{
	return x*m+y;
}

int fx[maxn]={0,0,1,-1};
int fy[maxn]={1,-1,0,0};

void dijkstra(int s)
{
	for(int o=0;o<=3;o++)
	{
		for(int i=0;i<=n*m;i++)
			dis[o][i]=-1,vis[o][i]=0;
		dis[o][s]=0;
		q.push(nod(o,s,0));
	}
		
	
	while(!q.empty())
	{
		int now=q.top().id; 
		int no=q.top().f;
		q.pop();
		if(vis[no][now]) continue;
		vis[no][now]=1;
		int xx=now/m,yy=now%m;
		
		int nx=xx+fx[no];
		int ny=yy+fy[no];
		
		if(0<=nx && nx<n && 0<=ny && ny<m && ss[nx][ny]!='@')
		{
			int nex=getid(nx,ny);
			if(dis[no][nex]==-1 || dis[no][nex]>dis[no][now]+1)
			{
				dis[no][nex]=dis[no][now]+1;
				q.push(nod(no,nex,dis[no][nex]));
			}
		}
		
		for(int i=0;i<=3;i++)
		if(i!=no)
		{
			ll nexdis=dis[no][now];
			if(dis[no][now]%k)
				nexdis+=(k-(dis[no][now]%k));
			if(dis[i][now]==-1 || dis[i][now]>nexdis)
			{
				dis[i][now]=nexdis;
				q.push(nod(i,now,dis[i][now]));
			}
		}
	}
}
int main()
{
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
	x1--; y1--; x2--; y2--;
	for(int i=0;i<n;i++)
		cin>>ss[i];
	dijkstra(getid(x1,y1));
	
	
	if(dis[0][getid(x2,y2)]==-1)
		printf("-1\n");
	else
	{
		ll maxx=LONG_LONG_MAX;
		for(int i=0;i<3;i++)
		{
			ll d=dis[i][getid(x2,y2)];
			if(d%k)
				d+=(k-d%k);
			maxx=min(maxx,d);
		}
		printf("%lld\n",maxx/k);
	}
}

Compiler output:
a.cc:35:8: warning: built-in function 'y1' declared as non-function [-Wbuiltin-declaration-mismatch]
   35 | int x1,y1,x2,y2;
      |        ^~
a.cc: In function 'int main()':
a.cc:109:25: error: 'LONG_LONG_MAX' was not declared in this scope
  109 |                 ll maxx=LONG_LONG_MAX;
      |                         ^~~~~~~~~~~~~