criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.*;

public class agco11A
{
	public static void main(String args[])
	{
		int n,c,k;
		
		Scanner sc=new Scanner(System.in);
		
		n=sc.nextInt();
		c=sc.nextInt();
		k=sc.nextInt();
		
		int[] t=new int[n];
		for(int i=0;i<n;i++)
			t[i]=sc.nextInt();
		
		Arrays.sort(t);
		
		int i=0,start,bus=1,people=0;
		start=t[0];
		while(i<n)
		{
			if(t[i]-start>k)
			{
				bus++;
				people=0;
			}
			people++;
			if(people==1)
				start=t[i];
			if(people==c)
			{
				bus++;
				people=0;
			}
			i++;
		}
		System.out.print(bus);
	}
}

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

#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>
#include <algorith>

using namespace std;
#define int long long
#define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl;
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define REPP(i,y) for(int i=1;i<=(int)(y);i++)
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
typedef long long ll;
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }


signed main() {
  int N,C,K;
  cin >> N >> C >> K;
  vector<int> T(N);
  ll max=-10;
  REP(i,N) {
    cin >> T[i];
  }
  sort(T.begin(),T.end());
  int cur=0;
  int ans=0;  // 時刻T[i]に到着する全員を乗せるのに必要な最小時間を計算する
  while(cur<N) {
    int nex = cur;
    // ans番目のバスが次の客を乗せられるのは以下の条件を満たすときと同値．
    while (nex<N && (nex - cur < C) && T[nex] - T[cur] <= K)
      nex++;
    ans++;
    cur=nex;
  }
  cout << ans << endl;
}

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

#include <cstdio>
#include <cstring>
#include <iostream>
#include <vector>

using namespace std;
#define int long long
#define DEBUG(X) cerr<<__LINE__<<" "<<#X<<": "<<X<<endl;
#define REP(i,y) for(int i=0;i<(int)(y);i++)
#define REPP(i,y) for(int i=1;i<=(int)(y);i++)
#define sci(x) int x;scanf("%d",&x);
#define scii(x, y) int x,y;scanf("%d%d",&x,&y);
typedef long long ll;
template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }


signed main() {
  int N,C,K;
  cin >> N >> C >> K;
  vector<int> T(N);
  ll max=-10;
  REP(i,N) {
    cin >> T[i];
  }
  sort(T.begin(),T.end());
  int cur=0;
  int ans=0;  // 時刻T[i]に到着する全員を乗せるのに必要な最小時間を計算する
  while(cur<N) {
    int nex = cur;
    // ans番目のバスが次の客を乗せられるのは以下の条件を満たすときと同値．
    while (nex<N && (nex - cur < C) && T[nex] - T[cur] <= K)
      nex++;
    ans++;
    cur=nex;
  }
  cout << ans << endl;
}

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

// 簡易競プロテンプレ
#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n, c, k;
ll t[114514];
int main(void){
 cin >> n >> c >> k;
 for(int i=0;i<n;i++) cin >> t[i];
 sort(&t[0], &t[n]);
 ll ans = 0, offs = 0;
 for(int i=1;i<n;i++){
  if (t[offs]+k>t[i] && i+1<n) continue;
  offs = min(offs+c, i); ans++;
  if (i+1<n) i--;
 }
 cout << ans << endl;
 return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: no matching function for call to 'min(long long int, int&)'
   14 |   offs = min(offs+c, i); ans++;
      |          ~~~^~~~~~~~~~~
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:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:14:13: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   14 |   offs = min(offs+c, i); ans++;
      |          ~~~^~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:14:13: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   14 |   offs = min(offs+c, i); ans++;
      |          ~~~^~~~~~~~~~~
Language: Java

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int c = sc.nextInt();
		int k = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0;i < n; i++){
		a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		int cnt = 1;
		int wait = a[0];
		int ans = 1;
		for(int i = 1; i < n; i++){
			if(cnt == c||a[i] - wait > k){
				ans++;
				cnt = 1;
				wait = a[i];
			}
			cnt++;
		}
		System.out.println(ans);
 
	}
 
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
Main.java:11: error: cannot find symbol
		Arrays.sort(a);
		^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include <algorithm>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>

#ifdef PRINTERS
#include "printers.hpp"
using namespace printers;
#define tr(a)		cerr<<#a<<": "<<a<<endl;
#else
#define tr(a)    
#endif
#define int       long long
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b)	for(int i=a;i<b;i++)
using namespace std;

signed solve(){
	int N;
	cin>>N;
	int n=N;
	vi x(N);
	vi y(N);
	rep(i,0,N)cin>>x[i];
	sort(all(x));
	partial_sum(all(x),y.begin());
	int ans=0;
	for(int i=n-1;i>=0;i--){
		if(i==n-1 or y[i]*2>=y[i+1])ans++;
		else break;
	}
	cout<<ans;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
//	cin>>t;
	while(t--){
		solve();
	}
	return 0;
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:56:1: warning: no return statement in function returning non-void [-Wreturn-type]
   56 | }
      | ^
At global scope:
cc1plus: error: '::main' must return 'int'
Language: Java


import java.util.Arrays;
import java.util.Scanner;

public class AirportBus {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int c = s.nextInt();
		int k = s.nextInt();
		int a[] = new int[n];
		int b[] = new int[n];
		int d[] = new int[n];
		int x = 0, y = 0;
		for (int i = 0; i < n; i++) {
			a[i] = s.nextInt();

		}
		Arrays.sort(a);
		for (int j = 0; j < n; j++) {
			d[j] = a[j] + k;

		}
		int i = 0;
		while (i < n) {
			x = 0;
			int j = i;
			int flag = 0;
			while (j < n) {
				if (d[i] >= a[j]  && a[j] >= a[i] && (x<c)) {
					x++;
					flag = 1;
				}
				
				
				j++;
			}
			if (flag == 1) {
				y++;
			}
			
			i = i + x;
		}
		System.out.println(y);

	}

}


Compiler output:
Main.java:5: error: class AirportBus is public, should be declared in a file named AirportBus.java
public class AirportBus {
       ^
1 error
Language: Java


import java.util.Arrays;
import java.util.Scanner;

public class airportbus {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int c = s.nextInt();
		int k = s.nextInt();
		int ans = 0, count = 0;
		int curr = Integer.MIN_VALUE;
		int[] arr = new int[n];
		for (int i = 0; i < n; i++) {
			arr[i] = s.nextInt();
		}
		Arrays.sort(arr);
		for (int i = 0; i < n; i++) {
			if (curr + k < arr[i] || count >= c) {
				curr = arr[i];
				count = 1;
				ans++;
			}
			else{
				count++;
			}
			
		}
		System.out.println(ans);
	}

}

Compiler output:
Main.java:5: error: class airportbus is public, should be declared in a file named airportbus.java
public class airportbus {
       ^
1 error
Language: Java

import java.util.*;

public class A {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int C = sc.nextInt();
		int K = sc.nextInt();
		int a[] = new int[N];
		for (int i = 0; i < N; i++)
			a[i] = sc.nextInt();
		Arrays.sort(a);
		int ans = 0, cnt = 0, st = 0;
		for (int i = 0; i < N;) {
			if (cnt == C) {
				ans++; cnt = 0;
			} else if (cnt == 0) {
				st = a[i++] + K;
				cnt++;
			} else {
				if (a[i] <= st) {
					cnt++; i++;
				} else {
					ans++; cnt = 0;
				}
			}
		}
		if (cnt > 0) {
			ans++;
		}
		System.out.println(ans);
	}
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,c,k,ans=0;bool t=true;
  scanf("%d %d %d", &n, &c,&k);
  vector<int>v(n);
  for(int i=0;i<n;++i)scanf("%d",&v[i]);
  sort(v.begin(),v.end());
  for(auto it=v.cbegin();t;++ans){
    const int x=*it+k;
    for(int i=0;*it<=x&&i<c&&t=it!=v.cend();++i,++it);
  }
  printf("%d\n",ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:28: error: lvalue required as left operand of assignment
   11 |     for(int i=0;*it<=x&&i<c&&t=it!=v.cend();++i,++it);
      |                 ~~~~~~~~~~~^~~
Language: C++

// ALLAH \\
whoishussain.org
#include<bits/stdc++.h>
using namespace std;
main(){
int n, t = 0, sum = 0;
cin >>n;
for(int i = 0;i < n;i ++){
int a;cin >> a;
if( sum * 2 < a ) t = i;
sum += a;
}
cout << n - t << endl;

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:13:23: error: expected '}' at end of input
   13 | cout << n - t << endl;
      |                       ^
a.cc:5:7: note: to match this '{'
    5 | main(){
      |       ^
Language: C++

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

int main()
{
    /*freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);*/
    int n,c,k;
    cin>>n>>c>>k;
    int t[n];
    for(int i=0;i<n;i++)
    {
       cin>>t[i];
    }
    sort(t,t+n);
    int j=0,b=0,cpt=0;
    for(int i=0;i<n;i++)
    {
        if(t[i]>t[j]+k || cpt==c)
        {
            j=i;
            b++;
            cpt=1;
        }
        else
            cpt++;
    }
    cout<<++b<<endl;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main()
{
    /*freopen("in.txt","r",stdin);
    freopen("out.txt","w",stdout);*/
    int n,c,k;
    cin>>n>>c>>k;
    int t[n];
    for(int i=0;i<n;i++)
    {
       cin>>t[i];
    }
    sort(t,t+n);
    int j=0,b=0,cpt=0;
    for(int i=0;i<n;i++)
    {
        if(t[i]>t[j]+k || cpt==c)
        {
            j=i;
            b++;
            cpt=1;
        }
        else
            cpt++;
    }
    cout<<++b<<endl;
    return 0;
}


Compiler output:
a.cc:34:5: error: redefinition of 'int main()'
   34 | int main()
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main()
      |     ^~~~
Language: C++

#include <iostream>


using namespace std;
#define MAX 100000

int p[MAX];

int main() {

    int N,C,K;
    int b=0;
    cin>>N>>C>>K;
    for(int i=0;i<N;i++) {
        cin>>p[i];
    }
    sort(p,p+N);
    int end,cap;
    for(int i=0;i<N;) {
        end=p[i]+K-1;
        cap=1;
        b++;
        while (cap < C && p[i] < end && i<N) {
            cap++;
            i++;
        }
    }
    cout<<b<<endl;
    
    return 0;
}

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

#include "stdafx.h"
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define int long long

int n, c, k;
int T[101010];
bool Tv[101010] = { false };

signed main() {
	cin >> n >> c >> k;
	for (int i = 0; i < n; i++)
	{
		cin >> T[i];
	}

	sort(T, T + n);

	int busCnt = 0;
	for (int i = 0; i < n; i++)
	{
		if (Tv[i]) continue;
		
		Tv[i] = true;
		int capa = c - 1;
		for (int j = i + 1; j < n; j++)
		{
			if (!Tv[j] && T[j] <= T[i] + c) {
				capa--;
				Tv[j] = true;
				if (capa == 0)
					break;
			}
		}
		busCnt++;
	}
	cout << busCnt << endl;
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: stdafx.h: No such file or directory
    1 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
 
using namespace std;
 
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
 
typedef long long ll;

ll t[100001];
ll time[100001];

int main(){
	ll n, c, k;
	
	scanf("%lld %lld %lld", &n, &c, &k);
	
	REP(i,n) scanf("%lld", &t[i]);
	
	sort(t,t+n);
	
	REP(i,n){
		time[i] = t[i] - t[0];
	}
	
	ll b = 0;
	ll l = 0;
	ll cnt = 0;
	
	REP(i,n){
		cnt++;
		if (time[i] - time[l] > k || cnt == 3){
			if (cnt == 2) b++;
			cnt = 0;
			b++;
			l = i+1;
		}
	}
	
	printf("%lld\n", b);
	
	return 0;
}

Compiler output:
a.cc:15:15: error: 'll time [100001]' redeclared as different kind of entity
   15 | ll time[100001];
      |               ^
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'int main()':
a.cc:27:23: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   27 |                 time[i] = t[i] - t[0];
      |                       ^
a.cc:27:25: error: assignment of read-only location '*(time + ((sizetype)i))'
   27 |                 time[i] = t[i] - t[0];
      |                 ~~~~~~~~^~~~~~~~~~~~~
a.cc:36:27: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                 if (time[i] - time[l] > k || cnt == 3){
      |                           ^
a.cc:36:37: warning: pointer to a function used in arithmetic [-Wpointer-arith]
   36 |                 if (time[i] - time[l] > k || cnt == 3){
      |                                     ^
a.cc:36:29: error: ISO C++ forbids using pointer to a function in subtraction [-fpermissive]
   36 |                 if (time[i] - time[l] > k || cnt == 3){
      |                     ~~~~~~~~^~~~~~~~~
Language: C++

#include <algorithm>//min/max/sort(rand-access it)/merge
#include <iostream>//cin/cout/wcin/wcout/left/right/internal/dec/hex/oct/fixed/scientific
#include <vector>

using namespace std;

typedef unsigned long long ull;

int main(void)
{
    ui n, c, k;
    cin >> n >> c >> k;
    std::vector<ui> t;
    for (size_t i = 0; i < n; ++i) {
        ui temp;
        cin >> temp;
        t.push_back(temp);
    }
    if (c == 1) {
        cout << n << endl;
        return 0;
    }
    sort(t.begin(), t.end());
    ull buses = 0UL;

    ui first_t = t[0];
    ui current_load = 1;
    for (size_t i = 1; i < n; ++i) {
        if (current_load == c || first_t + k < t[i]) {
            ++buses;
            first_t = t[i];
            current_load = 1;
        } else {
            ++current_load;
        }
    }

    cout << ++buses << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'ui' was not declared in this scope
   11 |     ui n, c, k;
      |     ^~
a.cc:12:12: error: 'n' was not declared in this scope
   12 |     cin >> n >> c >> k;
      |            ^
a.cc:12:17: error: 'c' was not declared in this scope
   12 |     cin >> n >> c >> k;
      |                 ^
a.cc:12:22: error: 'k' was not declared in this scope
   12 |     cin >> n >> c >> k;
      |                      ^
a.cc:13:19: error: template argument 2 is invalid
   13 |     std::vector<ui> t;
      |                   ^
a.cc:15:11: error: expected ';' before 'temp'
   15 |         ui temp;
      |           ^~~~~
      |           ;
a.cc:16:16: error: 'temp' was not declared in this scope; did you mean 'tm'?
   16 |         cin >> temp;
      |                ^~~~
      |                tm
a.cc:17:11: error: request for member 'push_back' in 't', which is of non-class type 'int'
   17 |         t.push_back(temp);
      |           ^~~~~~~~~
a.cc:23:12: error: request for member 'begin' in 't', which is of non-class type 'int'
   23 |     sort(t.begin(), t.end());
      |            ^~~~~
a.cc:23:23: error: request for member 'end' in 't', which is of non-class type 'int'
   23 |     sort(t.begin(), t.end());
      |                       ^~~
a.cc:26:7: error: expected ';' before 'first_t'
   26 |     ui first_t = t[0];
      |       ^~~~~~~~
      |       ;
a.cc:27:7: error: expected ';' before 'current_load'
   27 |     ui current_load = 1;
      |       ^~~~~~~~~~~~~
      |       ;
a.cc:29:13: error: 'current_load' was not declared in this scope
   29 |         if (current_load == c || first_t + k < t[i]) {
      |             ^~~~~~~~~~~~
a.cc:29:34: error: 'first_t' was not declared in this scope
   29 |         if (current_load == c || first_t + k < t[i]) {
      |                                  ^~~~~~~
a.cc:29:49: error: invalid types 'int[size_t {aka long unsigned int}]' for array subscript
   29 |         if (current_load == c || first_t + k < t[i]) {
      |                                                 ^
a.cc:31:24: error: invalid types 'int[size_t {aka long unsigned int}]' for array subscript
   31 |             first_t = t[i];
      |                        ^
Language: Java

import java.util.Scanner;

public class AtCoder_GrandContest11_1 {
	static int N;
	static long C, K;
	static long[] T;
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		N = Integer.valueOf(in.nextInt()); // Number of passengers
		C = Long.valueOf(in.nextLong()); // Size of bus
		K = Long.valueOf(in.nextLong()); // Max wait time
		T = new long[N]; // Arrival timings
		for (int x = 0; x < N; x++) {
			T[x] = in.nextLong();
		}
		sort(0, N - 1);
	}
	
	public static void sort (int low, int high) {
		int l = low, h = high;
		long p = T[low + (high-low)/2];
		while (l < h) {
			while (T[l] < p) {
				l++;
			}
			while (T[h] > p) {
				h--;
			}
			if (l <= h) {
				long t = T[l];
				T[l] = T[h];
				T[h] = t;
				l++;
				h--;
			}
		}
		
		if (low < h) {
			sort(low, h);
		} else if (l < high) {
			sort(l, high);
		} else {
			printAns();
		}
	}
	
	public static void printAns() {
		int Ti = 0; // Current passenger
		int buses = 0;
		while (Ti != N){
			// UpperBound = T + K
			for (int x = Ti; x <= Ti + C; x++) {
				if (x == N || x == Ti + C || T[x] > T[Ti] + K) {
					buses++;
					Ti = x;
					break;
				}
			}
		}
		System.out.println(buses);
	}
}


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

#include <iostream>
#include <stdlib.h>
#include <utility>
using namespace std;
const int MaxN=100003;
int n,c,k,res=0,nnx=0,nny=0,idx[MaxN],idy[MaxN],trx[8*MaxN],trey[8*MaxN];
bool dau[MaxN];
struct ta{ int x,y;};

ta a[MaxN];
ta b[2*MaxN];
void upx(int i){
    if (idx[i]==0){
        nnx++;
        idx[i]=nnx;
        trx[nnx]=i;
    }
    int cha=nnx,hh=a[i].x,con=cha/2;
    while (con>0){
        if (a[trx[cha]].x<=hh) break;
        trx[cha*2]=trx[cha];
        idx[trx[cha]]=cha*2;
        cha=con;
        con=cha/2;
    }
    idx[i]=cha;
    trx[cha]=i;
}
void upy(int i){
    if (idy[i]==0){
        nny++;
        idy[i]=nny;
        trey[nny]=i;
    }
    int cha=nny,hh=a[i].y,con=cha/2;
    while (con>0){
        if (a[trey[cha]].x<=hh) break;
        trey[cha*2]=trey[cha];
        idy[trey[cha]]=cha*2;
        cha=con;
        con=cha/2;
    }
    idy[i]=cha;
    trey[cha]=i;
}
void downx(){
}
void downy(int i){
    int cha=i,con=cha*2,hh=a[trey[i]].y;
    while (con<=nny){
        if (con<nny && a[trey[con]].y>a[trey[con+1]].y) con++;
        if (hh<=a[trey[con]].y) break;
        trey[cha]=trey[con];
        idy[trey[con]]=cha;
        cha=con;
        con=cha*2;
    }
    idy[i]=cha;
    trey[cha]=i;
}
int popx(){
    int i=trx[1];
    trx[1]=trx[nnx];
    idx[trx[nnx]]=1;
    idx[i]=0;
    nnx--;
    downx();
    return i;
}
int popy(int i){
    int j=trey[i];
    trey[i]=trey[nny];
    idy[trey[nny]]=i;
    nny--;
    downy(i);
    idy[j]=0;
    return j;
}
void Sort(int l,int r){
    int hh=(rand() % (r-l+1))+l;
    int i=l,j=r;
    while (i<j){
        while ( (a[hh].x>a[i].x)||(a[hh].x==a[i].x && a[i].y<a[hh].y)) i++;
        while ( (a[hh].x<a[j].x)||(a[hh].x==a[j].x && a[j].y>a[hh].y)) j--;
        if (i<=j){
            swap(a[i],a[j]); i++; j--;
        }
    }
    if (i<r) Sort(i,r);
    if (j>l) Sort(l,j);
}
void process(int c){
    int i=1,k,co;
    while (nny>0){
        res++;
        k=a[popy(1)].y;
        co=1;
        while (co<c && i<n && a[i].x<=k){
            co++;
            popy(idy[i]);
            i++;
        }
    }
}
void main(){
    cin >> n >> c >> k;
    int i,j=-1,h;
    for (i=0;i<n;i++){
      cin >> a[i].x;
      a[i].y=a[i].x+k;
      dau[i]=true;
    }
    Sort(0,n-1);
    for (i=0;i<n;i++) upy(i);
    process(c);
    cout << res;
}


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

#include<stdio.h>


int N,C,K,M;
int T[100001];
int i,j,k,ans=0,max;
int array[100001];

int can_ride(int Time);

int main(void){
  scanf("%d %d %d",&N,&C,&K);
  for(i=0;i<N;i++){
    scanf("%d",&T[i]);
  }
  //puts("data seted.");
  //printf("%d\n",can_ride(4));
  //printf("%d\n",array[0]);
  if(C<N){
  while(C){
    //printf("%d\n",i);
    max=T[0];
    for(i=0;i<N;i++){
      if(T[i]>max){
        max = T[i];
      }
    }
    for(j=1;j<max;j++){
      if(can_ride(j) >= C){
        //printf("%d\n",can_ride(4));
        //printf("%d\n",array[0]);

        ans++;
        for(k=0;k<C;k++){
          T[array[k]]=-1000000000;
        }
      }
    }
    C--;
    //printf("%d\n",C);
  }
}else{
  M=N
  while(M){
    //printf("%d\n",i);
    max=T[0];
    for(i=0;i<N;i++){
      if(T[i]>max){
        max = T[i];
      }
    }
    for(j=1;j<max;j++){
      if(can_ride(j) >= M){
        //printf("%d\n",can_ride(4));
        //printf("%d\n",array[0]);

        ans++;
        for(k=0;k<M;k++){
          T[array[k]]=-1000000000;
        }
      }
    }
    M--;
    //printf("%d\n",C);
  }
}
  printf("%d\n",ans);
  return 0;

}


int can_ride(int Time){
  int count=0;
  for(i=0;i<N;i++){
    if(T[i] <= Time && Time <= T[i]+K){
      array[count]=i;
      count++;
    }
  }
  return count;
}


Compiler output:
main.c: In function 'main':
main.c:43:6: error: expected ';' before 'while'
   43 |   M=N
      |      ^
      |      ;
   44 |   while(M){
      |   ~~~~~
Language: C

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

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

int main() {
	long int N, C, K;
	long int *T;
	long int nBus;
	long int i,j;

	scanf("%d %d %d",&N,&C,&K);
	T = (long int *)malloc(sizeof(long int)*N);

	for (i = 0; i < N; i++)
	{
		scanf("%d", &T[i]);

	}
	qsort(T, N,sizeof(long int), int_sort);


	for (i = 0,nBus=1; i < N; i++) {
		for (j = 0; j < C; j++) {
			if(T[i] + K < T[i+j]) {
				break;
			}
		}
		i += j;
		nBus++;
	}
	prlong intf("%d\n", nBus);

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:34:9: error: unknown type name 'prlong'; did you mean 'ulong'?
   34 |         prlong intf("%d\n", nBus);
      |         ^~~~~~
      |         ulong
main.c:34:21: error: expected declaration specifiers or '...' before string constant
   34 |         prlong intf("%d\n", nBus);
      |                     ^~~~~~
main.c:34:29: error: expected declaration specifiers or '...' before 'nBus'
   34 |         prlong intf("%d\n", nBus);
      |                             ^~~~
Language: C++

#include <stdio.h>

int N;
long long int C, K;
long long int T[100001];
long long int a = 1;
long long int b;
long long int ans=0;
bool flag;


int main() {
	scanf_s("%d %lld %lld", &N, &C, &K);
	for (int i = 1; i <= N; i++) {
		scanf_s("%lld", &T[i]);
	}
	for (int i = 1; i <= N; i++) {
		for (int j = i + 1; j <= N; j++) {
			if (T[i] > T[j]) {
				b = T[j];
				T[j] = T[i];
				T[i] = b;
			}
		}
	}
	while (a <= N) {
		flag = false;
		for (int i = a; i <= a + C - 1; i++) {
			if (i + 1 <= N) {
				if (T[i] - T[a] <= K && T[i + 1] - T[a] > K) {
					a = i + 1;
					ans++;
					flag = true;
					break;
				}
			}
		}
		if (!flag) {
			a += C;
			ans++;
		}
	}
	printf("%lld\n", ans);
	return 0;
}

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

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

int main()
{
int N,C,K,B,P,s,F;
int *T
int i,j;

scanf("%d %d %d",&N,&C,&K);
T = (int *)malloc(N * sizeof(int));

B=0;
P=0;

for(i=0;i<N;i++){
scanf("%d",&T[i]);
}

for(i=0;i<N;i++){
for(j=N-1;j>i;j--){
if(T[j]<T[j-1]){
s=T[j];
T[j]=T[j-1];
T[j-1]=s;
}
}
}

F=T[0];
for(i=0;i<N;i++){
if(P<C){
P++;
}else if(P==C || (T[i]-F)>K){
B++;
P=1;
F=T[i];
}
}

printf("%d",B);
free(T);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:7: error: expected ';' before 'int'
    7 | int *T
      |       ^
      |       ;
    8 | int i,j;
      | ~~~    
main.c:11:1: error: 'T' undeclared (first use in this function)
   11 | T = (int *)malloc(N * sizeof(int));
      | ^
main.c:11:1: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int tempT = 0;
		int tempC = 0;
		int tempB = 0;
		int Ti = 0;
		Ti = scan.nextInt();
		tempT = Ti + K;
		tempC = 1;
		tempB = 1;
		while (scan.hasNext()) {
			Ti = scan.nextInt();
			if (tempC <= C && Ti <= tempT){
				tempC++;
			} else {
				tempB++;
				tempC = 1;
				tempT = Ti + K;
			}
		}
		System.out.println(tempB);
	}
}


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

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = Integer.valueOf(in.nextInt()); // Number of passengers
		long C = Long.valueOf(in.nextLong()); // Size of bus
		long K = Long.valueOf(in.nextLong()); // Max wait time
		long[] T = new long[N]; // Arrival timings
		for (int x = 0; x < N; x++) {
			T[x] = in.nextLong();
		}
		int Ti = 0; // Current passenger
		int buses = 1;
		while (Ti != N){
			// UpperBound = T + K
			for (int x = Ti; x <= Ti + C; x++) {
				if (x == Ti + C || T[x] > T[Ti] + K) {
					buses++;
					Ti = x;
					break;
				}
			}
		}
		System.out.println(buses);
	}
}

Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1: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++

import java.util.Scanner;

public class AtCoder_GrandContest11_1 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = Integer.valueOf(in.nextInt()); // Number of passengers
		long C = Long.valueOf(in.nextLong()); // Size of bus
		long K = Long.valueOf(in.nextLong()); // Max wait time
		long[] T = new long[N]; // Arrival timings
		for (int x = 0; x < N; x++) {
			T[x] = in.nextLong();
		}
		int Ti = 0; // Current passenger
		int buses = 1;
		while (Ti != N){
			// UpperBound = T + K
			for (int x = Ti; x <= Ti + C; x++) {
				if (x == Ti + C || T[x] > T[Ti] + K) {
					buses++;
					Ti = x;
					break;
				}
			}
		}
		System.out.println(buses);
	}
}

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

public class Main {
	public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		int C = scan.nextInt();
		int K = scan.nextInt();
		int tempT = 0;
		int tempC = 0;
		int tempB = 0;
		int Ti = 0;
		while (scan.hasNext()) {
			Ti = scan.nextInt();
			if (tempC < C && Ti < tempT){
				tempC++;
			} else {
				tempB++;
				tempC = 1;
				tempT = Ti + K;
			}
		}
		System.out.println(tempB);
	}
}


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

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

int main()
{
int N,C,K,B,P,S,F;
int *T;
int i,j;

scanf("%d %d %d",&N,&C,&K);

T = (int *)malloc(N * sizeof(int));
B=0;

for(i=0;i<N;i++){
scanf("%d",&T[i]);
}

for(i=0;i<N;i++){
for(j=N-1;j>i;j--){
if(T[j]<T[j-1]){
s=T[j];
T[j]=T[j-1];
T[j-1]=s;
}
}
}

F=T[0];
for(i=0;i<N;i++){
if(P<C){
P++;
}else if(P==C || (T[i]-F)>K){
B++;
P=1;
F=T[i];
}
}

printf("%d",B);
free(T);
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:1: error: 's' undeclared (first use in this function)
   22 | s=T[j];
      | ^
main.c:22:1: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

/* ソート関数 */
int int_sort(const void * a, const void * b) {
	/* 引数はvoid*型と規定されているのでint型にcastする */
	if (*(int *)a < *(int *)b) {
		return -1;
	}
	else
		if (*(int *)a == *(int *)b) {
			return 0;
		}
	return 1;
}

int main() {
	int N, C, K;
	int *T;
	int nBus;
	int i,j;

	scanf("%d %d %d",&N,&C,&K);
	T = (int *)malloc(sizeof(int)*N);

	for (int i = 0; i < N; i++)
	{
		scanf_s("%d", &T[i]);

	}
	qsort(T, N,sizeof(int),int_sort);


	for (i = 0,nBus=1; i < N; i++) {
		for (j = 0; j < C; j++) {
			if(T[i] + K < T[i+j]) {
				break;
			}
		}
		i += j;
		nBus++;
	}
	printf("%d\n", nBus);

	return 0;
}

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

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

/* ソート関数 */
int int_sort(const void * a, const void * b) {
	/* 引数はvoid*型と規定されているのでint型にcastする */
	if (*(int *)a < *(int *)b) {
		return -1;
	}
	else
		if (*(int *)a == *(int *)b) {
			return 0;
		}
	return 1;
}

int main() {
	int N, C, K;
	int *T;
	int nBus;
	int i,j;

	scanf_s("%d %d %d",&N,&C,&K);
	T = (int *)malloc(sizeof(int)*N);

	for (int i = 0; i < N; i++)
	{
		scanf_s("%d", &T[i]);

	}
	qsort(T, N,sizeof(int),int_sort);


	for (i = 0,nBus=1; i < N; i++) {
		for (j = 0; j < C; j++) {
			if(T[i] + K < T[i+j]) {
				break;
			}
		}
		i += j;
		nBus++;
	}
	printf("%d\n", nBus);

	return 0;
}

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

// ConsoleApplication2.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <iostream>
#include <algorithm>

int n, c, k, t[100005], tf, ans, cnt;

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

	std::cin >> n >> c >> k;
	for (int i = 0; i < n; ++i) std::cin >> t[i];

	std::sort(t, t + n);

	for (int i = 0; i < n; ++i) {
		//std::cout << "pre :" << ans << " " << cnt << std::endl;
		if (tf == 0) {
			tf = t[i];
			cnt++;
		}
		else {
			if (t[i] <= tf + k && cnt < c) {
				cnt++;
				if (i == n - 1) {
					ans++;
				}
			}
			else if (t[i] > tf + k || cnt >= c) {
				ans++;
				tf = t[i];
				cnt = 1;
				if (i == n - 1) ans++;
			}
		}
		//std::cout << ans << " " << cnt << std::endl;
	}



	std::cout << ans << std::endl;

	return 0;
}



Compiler output:
a.cc:4:10: fatal error: stdafx.h: No such file or directory
    4 | #include "stdafx.h"
      |          ^~~~~~~~~~
compilation terminated.
Language: Java

mport java.util.Arrays;
import java.util.Scanner;

public class Main {

    /**
     * @param args
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int C = sc.nextInt();
        int K = sc.nextInt();
        int[] T = new int[N];
        for (int i=0; i<N; i++) {
            T[i] = sc.nextInt();
        }

        System.out.println(solve(N, C, K, T));
    }

    private static int solve(int N, int C, int K, int[] T) {
        int count = 0;

        Arrays.sort(T);

        int idx = 0;
        int sum = 0;
        for (int i=0; i<N; i++) {
            if (T[i] - idx > K) {
                count++;
                idx = T[i];
                sum = 1;
            } else if (sum+1 > C) {
                count++;
                idx = T[i];
                sum = 1;
            } else {
                sum++;
            }
        }

        if (sum > 0) {
            count++;
        }

        return count;
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.Arrays;
^
Main.java:2: error: class, interface, enum, or record expected
import java.util.Scanner;
^
2 errors
Language: Java

public class Main {

    private static int solve(int n, int c, int k, int[] ts) {
        int count = 0;
        int r = 0;
        int maxT = -1;
        for (int t : ts) {
            if (maxT == -1) {
                maxT = t + k;
            }

            if (maxT >= t && count < c) {
                count++;
            } else {
                r++;
                count = 1;
                maxT = t + k;
            }
        }
        if (count > 0) {
            r++;
        }
        return r;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int c = in.nextInt();
        int k = in.nextInt();
        int[] ts = new int[n];
        for (int i = 0; i < n; i++) {
            ts[i] = in.nextInt();
        }
        Arrays.sort(ts);
        System.out.println(solve(n, c, k, ts));
    }
}

Compiler output:
Main.java:27: error: cannot find symbol
        Scanner in = new Scanner(System.in);
        ^
  symbol:   class Scanner
  location: class Main
Main.java:27: error: cannot find symbol
        Scanner in = new Scanner(System.in);
                         ^
  symbol:   class Scanner
  location: class Main
Main.java:35: error: cannot find symbol
        Arrays.sort(ts);
        ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include <bits\stdc++.h>

using namespace std;

int main() {

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

	long long n, c, k;
	cin >> n >> c >> k;

	vector<long long> t(n);

	for (auto &a : t) {
		cin >> a;
	}

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

	int ans = 1;
	int time = t[0] + k;
	int count = 1;
	for (long long i = 0; i < n; i++) {

		if (count >= c) {
			ans++;
			time = t[min(i + 1,n-1)] + k;
			count = 0;
		}

		if (time <= t[i]) {
			ans++;
			time = t[i] + k;
			count = 1;
		}

		count++;

	}

	cout << ans << endl;

	return 0;

}

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

#include "bits\stdc++.h"

using namespace std;

int main() {

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

	long long n, c, k;
	cin >> n >> c >> k;

	vector<long long> t(n);

	for (auto &a : t) {
		cin >> a;
	}

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

	int ans = 1;
	int time = t[0] + k;
	int count = 1;
	for (long long i = 0; i < n; i++) {

		if (count >= c) {
			ans++;
			time = t[min(i + 1,n-1)] + k;
			count = 0;
		}

		if (time <= t[i]) {
			ans++;
			time = t[i] + k;
			count = 1;
		}

		count++;

	}

	cout << ans << endl;

	return 0;

}

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

N,C,K = map(int,input().split())
A = []
for n in range(N):
	a = int(input())
	A.append(a)
A.sort()
b = 0
for a in A:
	if b == 0:
		b = 1
		c = 1
		t = a
	elif c >= C:
		b = b + 1
		c = 1
		t = a
	elif a <= t + K and c < C:
		c = c + 1
	elif a > t + K:
		b = b + 1
		c = 1
		t = a
print(b)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N,C,K = map(int,input().split())
      | ^
Language: C++

n,c,k = map(int, input().split())
t = []
for i in range(n):
    t.append(int(input()))
t.sort()

ni,nt,ans = 0,0,0
while 1:
    if ni >= n:
        break
    nt = t[ni]
    for i in range(1,c+1):
        if ni+i<n and t[ni+i] < nt + k:
            ni += 1
        else:
            break
    ni += 1
    ans += 1
print(ans)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n,c,k = map(int, input().split())
      | ^
Language: Java

import java.util.*;
public class A{
	static Scanner s = new Scanner(System.in);
	public static void main(String[] args) {
		int n=s.nextInt(),c=s.nextInt(),k=s.nextInt();
		boolean[] t = new boolean[1000001];
		for(int i=0;i<n;i++) t[s.nextInt()]=true;

		int result=0,bus;
		for(int i=0;i<t.length;i++) {
			if(t[i]) {
				result++;
				bus=0;
				for(int j=0;j<=k;j++) {
					if(t[i+j]) {
						bus++;
						t[i+j]=false;
					}
					if(bus==c)
						break;
				}
			}
		}
		System.out.println(result);
	}
}

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

#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
using namespace std;
const int MAXN=200001;
int arr[MAXN];
int main(){
    set<int> st;
    int n,c,k;
    cin>>n>>c>>k;
    for(int i=1;i<=n;i++)cin>>arr[i];
    sort(arr+1,arr+n+1);
    int ret=0;
    for(int i=1;i<=n;i++){
        if(st.size()==0){
            st.insert(arr[i]);
            ret++;
        }
        else{
            if(*st.begin()+k>=arr[i] && st.size()<c){
                st.insert(arr[i]);
            }else{
                st.clear();
                st.insert(arr[i]);
                ret++;
            }
        }
    }
    cout<<ret;
    return 0;
}

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

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    int n, c, k;
    cin >> n >> c >> k;
    vector<int> v(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
    sort(v.begin(), v.end());
    int j = 0;
    int ans = 0;
    for (int i = 0; i < n; ++i) {
        if (i - j + 1 > c ||  v[i] - v[j] > k) {
            j = i;
            ++ans;
        }
    }
    ++ans;
    cout << ans << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'vector' was not declared in this scope
   10 |     vector<int> v(n);
      |     ^~~~~~
a.cc:3:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    2 | #include <algorithm>
  +++ |+#include <vector>
    3 | 
a.cc:10:12: error: expected primary-expression before 'int'
   10 |     vector<int> v(n);
      |            ^~~
a.cc:12:16: error: 'v' was not declared in this scope
   12 |         cin >> v[i];
      |                ^
a.cc:14:10: error: 'v' was not declared in this scope
   14 |     sort(v.begin(), v.end());
      |          ^
Language: C++

//
//  main.cpp
//  A
//
//  Created by 黄宇凡 on 2017/3/12.
//  Copyright © 2017年 黄宇凡. All rights reserved.
//

#include <iostream>
#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

const int maxn = 1e5 + 5;

long long T[maxn];
long long K,C;
int n;

int main(int argc, const char * argv[]) {
    cin >> n;
    cin >> C >> K;
    for(int i = 1;i <= n;i++){
        int t;
        scanf("%d",&t);
        T[i] = t;
    }
    sort(T + 1,T + 1 + n);
    int num = 0;
    long long s;
    for(int i = 1,j = 1;i <= n;i = j + 1,j = i){
        s = T[i] + K;
        while(j < n && j - i + 1 < C && T[j + 1] <= s){
            j++;
        }
        num++;
    }
    cout << num << endl;
    return 0;
}


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

#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<unordered_map>
#include<unordered_set>
using namespace std;

int d[100000];
signed main() {
	int a, b, c; scanf("%d%d%d", &a, &b, &c);
	for (int e = 0; e < a; e++) {
		scanf("%d", &d[e]);
	}
	sort(d, d + a);
	int sum = 0, hito = 0, hazime =INT_MIN;
	for (int i = 0; i < a; i++) {
		if (hazime < d[i]-c) {
			sum++;
			hazime = d[i];
			hito = 1;
		}
		else if (hito == b) {
			sum++;
			hazime = d[i];
			hito = 1;
		}
		else {
			hito++;
		}
	}
	printf("%d\n", sum);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:40: error: 'INT_MIN' was not declared in this scope
   20 |         int sum = 0, hito = 0, hazime =INT_MIN;
      |                                        ^~~~~~~
a.cc:11:1: note: 'INT_MIN' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include<unordered_set>
  +++ |+#include <climits>
   11 | using namespace std;
Language: C++

//#include <bits/stdc++.h>
#include <iostream>
using namespace std;
typedef long long ll;
ll n,c,k,a[111111],cnt,last,ans;
int main()
{
	cin>>n>>c>>k;
	for(ll i=1;i<=n;i++)
		scanf("%lld",&a[i]);
	sort(a+1,a+n+1);
	for(ll i=1;i<=n;i++)
	{
		if(cnt==0||a[i]-last>k)
			cnt=c,last=a[i],ans++;
		cnt--;
	}
	cout<<ans;
}

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

#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int64_t INF=1e18+1;
const int mod = 1000000007;

int main() {
  int N;
  cin>>N;
  vector<int>A(N);
  vector<int64_t>sum(N);
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  sort(A.begin(),A.end());
  sum=A;
  for(int i=0;i<N-1;i++){
    sum[i+1]+=sum[i];
  }
  for(int i=N-2;i>=0;i--){
    if(sum[i]*2<A[i+1]){cout<<N-1-i<<endl;return 0;}
  }
  cout<<N<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: no match for 'operator=' (operand types are 'std::vector<long int>' and 'std::vector<int>')
   19 |   sum=A;
      |       ^
In file included from /usr/include/c++/14/vector:72,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/vector.tcc:210:5: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(const std::vector<_Tp, _Alloc>&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  210 |     vector<_Tp, _Alloc>::
      |     ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/vector.tcc:211:42: note:   no known conversion for argument 1 from 'std::vector<int>' to 'const std::vector<long int>&'
  211 |     operator=(const vector<_Tp, _Alloc>& __x)
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
In file included from /usr/include/c++/14/vector:66:
/usr/include/c++/14/bits/stl_vector.h:766:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::vector<_Tp, _Alloc>&&) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:766:26: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::vector<long int>&&'
  766 |       operator=(vector&& __x) noexcept(_Alloc_traits::_S_nothrow_move())
      |                 ~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_vector.h:788:7: note: candidate: 'std::vector<_Tp, _Alloc>& std::vector<_Tp, _Alloc>::operator=(std::initializer_list<_Tp>) [with _Tp = long int; _Alloc = std::allocator<long int>]'
  788 |       operator=(initializer_list<value_type> __l)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:788:46: note:   no known conversion for argument 1 from 'std::vector<int>' to 'std::initializer_list<long int>'
  788 |       operator=(initializer_list<value_type> __l)
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Language: C++

#include <its//stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long int ll;
int main() {
	int n,cnt = 0; cin >> n; vector<int> a(n);
	rep(i, n) cin >> a[i];
	sort(a.begin(), a.end());
	ll sum = 0;
	rep(i, n - 1) {
		sum += a[i];
		if (sum * 2 < a[i + 1]) cnt = i+1;
	}cout << n - cnt << endl;
}

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