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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define all(vec) vec.begin(),vec.end()
int main() {
  int N,C,K;  cin >> N >> C >> K;
  vector<int> T(N);
  rep(i,N) cin >> T.at(i);
  sort(all(T));

  int bus = 1;
  int psng = 0;
  int bustime = T.at(0)+ K;  //1台目の時間6
  reo(i,N){
      if (T.at(i) <= bustime && psng < C) psng++;
      else{
        bus++;
        psng=1;
        bustime = T.at(i) + K;
//        cout << i+1 <<" bus " << bus << "-" << bustime << endl;
      }
  }
  cout << bus << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   reo(i,N){
      |       ^
a.cc:14:3: error: 'reo' was not declared in this scope; did you mean 'rep'?
   14 |   reo(i,N){
      |   ^~~
      |   rep
Language: C++

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

# define ll long long

int main(){
 
  int n, capacity, late;
  cin >> n >> capacity >> late;
  
  int time[100005];
  for(int i=0; i<N; i++) cin >> time[i];
  sort(time, time+N);
  
  int ans = 1, currentCap = 1, firstPerson = time[0];
  for(int i=1; i<n; i++){
    if(currentCap + 1 <= capacity && time[i] <= firstPerson + late){
      currentCap++;
    } else {
      ans++;
      capacity = 1;
      firstPerson = time[i];
    }
  }
  
  cout << ans << endl;
  
  return 0;
} 



Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'N' was not declared in this scope
   14 |   for(int i=0; i<N; i++) cin >> time[i];
      |                  ^
a.cc:15:19: error: 'N' was not declared in this scope
   15 |   sort(time, time+N);
      |                   ^
Language: C++

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

# define ll long long

int main(){
 
  int N, capacity, late;
  cin >> N >> capacity >> late;
  
  int time[100005];
  for(int i=0; i<N; i++) cin >> time[i];
  sort(time, time+N);
  
  int ans = 1, currentCap = 1, firstPerson = time[0];
  for(int i=1; i<n; i++){
    if(currentCap + 1 <= capacity && time[i] <= firstPerson + late){
      currentCap++;
    } else {
      ans++;
      capacity = 1;
      firstPerson = time[i];
    }
  }
  
  cout << ans << endl;
  
  return 0;
} 



Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: 'n' was not declared in this scope
   18 |   for(int i=1; i<n; i++){
      |                  ^
Language: C++

#include <string>
#include <memory>
#include <vector>
#include <iostream>
#include <set>

using namespace std;

int main() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, c, k;
  cin >> n >> c >> k;

  std::vector<int> v(n);
  for (auto& el : v) {
    cin >> el;
  }

  sort(v.begin(), v.end());
  int cur = v[0];
  int cnt = 1;
  int ans = 1;
  for (int i = 1; i < n; i++) {
    if (v[i] - cur <= k && cnt + 1 <= c) {
      cnt++;
      continue;
    } else {
      cur = v[i];
      cnt = 1;
      ans++;
    }
  }
  cout << ans << endl;
}

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

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

int main() {
  int N,C,K;
  cin >> N >> C >> K;
  vector<int>data(N);
  for(int i=0;i<N;i++){
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  int count=0;
  pair<int,int>start;
  start.first=-1;
  for(int i=0;i<N;i++){
    if(start.first>=data.at(i)&&i-start.second<C){
    }
    else{
      count ++;
      startfirst=data.at(i);
      start.second=i;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 'startfirst' was not declared in this scope
   20 |       startfirst=data.at(i);
      |       ^~~~~~~~~~
Language: C++

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

int main() {
  int N,C,K;
  cin >> N >> C >> K;
  vector<int>data(N);
  for(int i=0;i<N;i++){
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  int count=0;
  pair<int,int>start;
  start.first=-1;
  for(int i=0;i<N;i++){
    if(start.first>=data.at(i)&&i-start.second<C){
    }
    else{
      count ++;
      pair.first=data.at(i);
      pair.second=i;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: expected unqualified-id before '.' token
   20 |       pair.first=data.at(i);
      |           ^
a.cc:21:11: error: expected unqualified-id before '.' token
   21 |       pair.second=i;
      |           ^
Language: C++

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

int main() {
  int N,C,K;
  cin >> N >> C >> K;
  vector<int>data(N);
  for(int i=0;i<N;i++){
    cin >> data.at(i);
  }
  sort(data.begin(),data.end());
  int count=0;
  pair<int,int>start;
  start.first=-1
  for(int i=0;i<N;i++){
    if(start.first>=data.at(i)&&i-start.second<C){
    }
    else{
      count ++;
      pair.first=data.at(i);
      pair.second=i;
    }
  }
  cout << count << endl;
}

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

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

int main(){
  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);
  reverse(T,T+N);
  int j=0,count=0;
  for(int i=0;i<N;i++){
    if(-T[i]+T[j]<=K){
      if(i==N-1 && j=0)count +=(N+C-1)/C;
      else continue;
    }
    else {
      count+=(i-j+C-1)/C;
      j=i;
    }
  }
  cout << count + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: lvalue required as left operand of assignment
   17 |       if(i==N-1 && j=0)count +=(N+C-1)/C;
      |          ~~~~~~~^~~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_bit(n) for (int bit = 0; bit < (1<<n); ++bit)
#define all(x) (x).begin(),(x).end()
#define ll long long
#define ld long double
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define SP <<" "<<
#define CST(x) cout<<fixed<<setprecision(x)
using namespace std;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<vi> Graph;

//条件式 ? 真の場合の文 : 偽の場合の文
//abs(x) = (x の絶対値)
//string S  S,at(i),S += T,S += c,S.size(),S.substr(l)l文字目から最後まで,
///S.substr(l, r)l文字目からl+r-1文字目 n文字目から0個で空列を返せる
//*min_element(all(x)) *max_element(all(x))
//vi x; x.back(),x.front(),x.push_back(),x.pop_back()
//swap(a, b)
//gcd(a, b)最大公約数
//sort(all(x)),reverse(all(x)),sort(x.begin()+l,a.begin()+r)lからrまで
//stack<int> a; a.push(x),a.pop(),a.top(),a.empty()bool
//queue<int> b; b.push(x),b.pop(),b.front(),b.empty()bool,b.size() 要素が小さい順
//priority_queue<int, vector<int>, greater<int>> c,c.top()
//map<int, int> M1; 変数[key] = value; 変数.erase(key); 変数.at(key); 変数.count(key)所属判定　変数.size()
//find(all(x), key)boolソート済みのベクトル
//*lower_bound(all(x),k)以上の最小の要素,*uppper_bound(all(x),k)より大きい最小の要素
//char('0'+cnt) 数字cntからcharへの変換
//int(char-'0') charからintへの変換
int main(){

    int n;
    ll c,k;
    cin >> n >> c >> k;
    vl t(n);
    rep(i,n) cin >> t.at(i);
    sort(all(t));
    int ans = 1;
    int now = 0;
    rep(i,n){
        if(now+c=i || t.at(now)+k < t.at(i)){
            ans++;
            now = i;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:15: error: lvalue required as left operand of assignment
   50 |         if(now+c=i || t.at(now)+k < t.at(i)){
      |            ~~~^~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_bit(n) for (int bit = 0; bit < (1<<n); ++bit)
#define all(x) (x).begin(),(x).end()
#define ll long long
#define ld long double
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define SP <<" "<<
#define CST(x) cout<<fixed<<setprecision(x)
using namespace std;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<vi> Graph;

//条件式 ? 真の場合の文 : 偽の場合の文
//abs(x) = (x の絶対値)
//string S  S,at(i),S += T,S += c,S.size(),S.substr(l)l文字目から最後まで,
///S.substr(l, r)l文字目からl+r-1文字目 n文字目から0個で空列を返せる
//*min_element(all(x)) *max_element(all(x))
//vi x; x.back(),x.front(),x.push_back(),x.pop_back()
//swap(a, b)
//gcd(a, b)最大公約数
//sort(all(x)),reverse(all(x)),sort(x.begin()+l,a.begin()+r)lからrまで
//stack<int> a; a.push(x),a.pop(),a.top(),a.empty()bool
//queue<int> b; b.push(x),b.pop(),b.front(),b.empty()bool,b.size() 要素が小さい順
//priority_queue<int, vector<int>, greater<int>> c,c.top()
//map<int, int> M1; 変数[key] = value; 変数.erase(key); 変数.at(key); 変数.count(key)所属判定　変数.size()
//find(all(x), key)boolソート済みのベクトル
//*lower_bound(all(x),k)以上の最小の要素,*uppper_bound(all(x),k)より大きい最小の要素
//char('0'+cnt) 数字cntからcharへの変換
//int(char-'0') charからintへの変換
int main(){

    int n;
    ll c,k;
    cin >> n >> c >> k;
    vl t(n);
    rep(i,n) cin >> t.at(i);
    sort(all(t));
    int ans = 1;
    int now = 0;
    rep(i,n){
        if(s+c=i || t.at(s)+k < t.at(i)){
            ans++;
            now = i;
        }
    }
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:12: error: 's' was not declared in this scope
   50 |         if(s+c=i || t.at(s)+k < t.at(i)){
      |            ^
Language: C++

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

int main() {
  int n,c,k;
  cin>>n>>c>>k;
  vector<int> t(n);
  rep(i,n) cin>>t[i];
  sort(all(t));
  /////////////
// wakarannnnnnnnnn/////
  
  
  
  
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   cout<<ans<<endl;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int N, C, K;
    cin >> N >> C >> K;
    vector<int> T(N);
    REP(i,N) cin >> T[i];

    sort(ALL(T));
    int c = 0, time = 0;;
    int ans = 0;
    c = 1, time = t[0];
    FOR(i,1,N) {
        if (T[i] - time > K || c >= C) {
            ans++;
            c = 0;
        }
        if (c == 0) {
            time = T[i];
            c++;
        } else {
            c++;
        }
    }
    ans++;

    cout << ans << '\n';

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:19: error: 't' was not declared in this scope
   28 |     c = 1, time = t[0];
      |                   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll n, c, k;
  cin >> n >> c >> k;

  vector<ll> t(n);

  REP(i, n) { cin >> t[i]; }

  sort(all(t));

  int ans = 0, nc, nk = -1;

  for (int i = 0; i < n; i++) {
    if (nk < a[i] || !nc) {
      ans++;
      nc = c - 1;
      nk = t[i] + k;
    } else {
      nc--;
    }
  }

  cout << ans << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'a' was not declared in this scope
   28 |     if (nk < a[i] || !nc) {
      |              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll n, c, k;
  cin >> n >> c >> k;

  vector<ll> t(n);

  REP(i, n) { cin >> t[i]; }

  sort(all(t));

  int ans = 0, nc, nk = -1;

  for (int i = 0; i < n; i++) {
    if (nk < a[i] || !nc) {
      ans++;
      nc = c - 1;
      nk = a[i] + k;
    } else {
      nc--;
    }
  }

  cout << ans << "\n";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:14: error: 'a' was not declared in this scope
   28 |     if (nk < a[i] || !nc) {
      |              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){

  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 bus_count = 0;
  int ninzu = 0;
  
  int i = 0;
  while(i < N) {
    bus_count++;
    bus_time = T[i] + K;
    int j = i;
    while (j < N && T[j] <= bus_time && ninzu <= C) {
      j++;
      ninzu++;
    }
    i = j;
  }
  cout << bus_count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:5: error: 'bus_time' was not declared in this scope
   21 |     bus_time = T[i] + K;
      |     ^~~~~~~~
Language: C++

// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
int getDigit(int n);            // 数字の桁数を取得する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

typedef long long ll;
typedef unsigned long long ull;

// code
// ------------------------------------------------
int main() {

  int n,c,k;
  cin >> n >> c >> k;
 
  vector<ll> a(n);
 
  vsort(a);
  rep(i,n) cin >> a[i];
 
  ll nb = -1;
  ll ans = 0;
  ll cus = 0;
  for(int i = 0;i < n;)
  {
    nb = a[i] + k;  // nb分には出発しないといけない
    cus = 0;        // 乗客が何人乗れるか？
    ans++;          // バスの数
    for(int j = i;j < n;j++)
    {
      if(cus + 1<= c && a[j] <= nb)
      {
        cus++;
      }
      else
      {
        i = j;  // j-1番目まで乗っている
        cus=0;  // バスはいってしまった　＆フラグ代わり
        break;
      }
    }
    if(cus != 0)
    {
      //バスが出たとき以外にここにくる。
      break;
    }
  }
 
  cout << ans << endl;
 
  return 0;
}
 
// funcの実体
// ------------------------------------------------
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;

  

  return 0;
}
// funcの実体
// ------------------------------------------------
int getDigit(int n)
{
  int i = 1;
  while(1)
  {
    n = n / 10;
    if(n == 1)
      break;
    i++;
  }
  return i;
}
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


Compiler output:
a.cc:111:5: error: redefinition of 'int CalcSumOfDigit(int)'
  111 | int CalcSumOfDigit(int n)
      |     ^~~~~~~~~~~~~~
a.cc:83:5: note: 'int CalcSumOfDigit(int)' previously defined here
   83 | int CalcSumOfDigit(int n)
      |     ^~~~~~~~~~~~~~
Language: C++

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

int main() {
    int N,C,K;
    cin>>N>>C>>K;
    vector<int> T(N);
    for(int i=0; i<N; i++)
        cin>>T[i];
    
    int bus=0;
    int passenger=0;
    int first_wait;
    sort(T.begin(), T.end());
    for(int i=0; i<N;) {
        passenger=1;
        first_wait=T[i++];
        while(i<N && passenger<C && T[i]-first_wait<=K) {
            passenger++;
            i++;
        }
        bus++;
    }
    cout<<bus<<endl;
}

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

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

ll gcd(ll a, ll b){return b!=0 ? gcd(b, a%b) : a;}
ll lcm(ll a, ll b){return a / gcd(a, b) * b;}

int main(){
	ll n, c, k;
	cin >> n >> c >> k;
	vector<ll> t(n);
	rep(i, n) cin >> t[i];
	
	sort(t.begin(), t.end());
	ll ans = 0;
	ll th = INF;
	l tmpc = c;
	for(int i = 0; i < n; ++i){
		th = min(th, t[i] + k);
		tmpc--;
		if(th < t[i]){
			tmpc = c - 1;
			ans++;
			th = t[i] + k;
		}
		else if(tmpc == 0){
			tmpc = c;
			ans++;
			th = INF;
		}
	}
	ans++;
	cout << ans << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:21:9: error: 'l' was not declared in this scope
   21 |         l tmpc = c;
      |         ^
a.cc:24:17: error: 'tmpc' was not declared in this scope; did you mean 'tm'?
   24 |                 tmpc--;
      |                 ^~~~
      |                 tm
Language: C++

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

int main(void){
    int n,c,k;
    cin >> n >> c >> k;
    vector<int> vec(n);
    for(int i=0;i<n;i++) cin >> vec.at(i);

    int bus=0,people=0;
    for(int i=0;i<n;){
        if(i==n-1){bus++; break;}   //最終乗客=第一乗客のときは専用バスあげて終了

        int p0 = vec.at(i); //第一乗客の時刻
        while(vec.at(i)-p0<=k && people<c){
            if(i==n-1) break;
            people++;   //人乗せる
            i++;        //時間送る
        }
        bus++;
        people = 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:22:6: error: expected '}' at end of input
   22 |     }
      |      ^
a.cc:4:15: note: to match this '{'
    4 | int main(void){
      |               ^
Language: C++

#include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int n,c,k,people,sign,bus;
int timer[100010];
int main()
{
	cin>>n>>c>>k;
	for(int i=1; i<=n; i++)
		scanf("%d",&timer[i]);
	sort(timer+1,timer+1+n);
	people=1;
	bus=1;
	sign=timer[1]+k;
	for(int i=2; i<=n; i++)
		if(sign<timer[i]||sum==c)
		{
			bus++;
			people=1;
			sign=timer[i]+k;
		}
		else people++;
	cout<<bus<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:35: error: 'sum' was not declared in this scope
   19 |                 if(sign<timer[i]||sum==c)
      |                                   ^~~
Language: C++

#include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namestiace std;
int n,k,c,t[100010];
int per=1,cnt=1,tb;
int main()
{
    scanf("%d%d%d",&n,&c,&k);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&t[i]);
    }
    sort(t+1,t+1+n);
    tb=t[1]+k;
    for(int i=2;i<=n;i++)
    {
        if(t[i]>tb||per==c){
            cnt++;
            tb=t[i]+k;
            per=1;
        }
        else per++;
    }
    printf("%d",cnt);
    return 0;
}

Compiler output:
a.cc:6:7: error: expected nested-name-specifier before 'namestiace'
    6 | using namestiace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   16 |     sort(t+1,t+1+n);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:5:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<iostream>
#include<fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namestiace std;
int n,k,c,t[100010];
int per=1,cnt=1,tb;
int main()
{
    scanf("%d%d%d",&n,&c,&k);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&t[i]);
    }
    sort(t+1,t+n+1);
    tb=t[1]+k;
    for(int i=2;i<=n;i++)
    {
        if(t[i]>tb||per==c){
            cnt++;
            tb=t[i]+k;
            per=1;
        }
        else per++;
    }
    printf("%d",cnt);
    return 0;
}

Compiler output:
a.cc:6:7: error: expected nested-name-specifier before 'namestiace'
    6 | using namestiace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:16:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   16 |     sort(t+1,t+n+1);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:5:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <bits/stdc++.h>

using namestiace std;

int n,k,c,t[100010];
int per=1,cnt=1,tb;

int main(){
    scanf("%d%d%d",&n,&c,&k);
    for(int i=1;i<=n;i++){
        scanf("%d",&t[i]);
    }
    sort(t+1,t+n+1);
    tb=t[1]+k;
    for(int i=2;i<=n;i++){
        if(t[i]>tb||per==c){
            cnt++;
            tb=t[i]+k;
            per=1;
        }
        else per++;
    }
    printf("%d",cnt);
    return 0;
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'namestiace'
    3 | using namestiace std;
      |       ^~~~~~~~~~
a.cc: In function 'int main()':
a.cc:13:5: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   13 |     sort(t+1,t+n+1);
      |     ^~~~
      |     std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,C,K,S=0;cin>>N>>C>>K;
  vector<int>T(N);
  for(int i=0;i<N;i++)cin>>T.at(i):
  sort(T.begin(),T.end());
  for(int i=0;i<N;i++){
    S++;int j=1;
    while(j<C&&T.at(i)+C>=T.at(i+j))j++;
    i+=j-1;
  }
  cout<<S<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:35: error: expected ';' before ':' token
    6 |   for(int i=0;i<N;i++)cin>>T.at(i):
      |                                   ^
      |                                   ;
Language: C++

//WAだけどどこが間違っているのかわからないので後日のために投げときます
#include <bits/stdc++.h>
using namespace std;

int main(){

  int N,C,K;
  cin >>N >> C >> K;
  int t[i];
  for (int i=0;i<N;i++){
    cin>>t[i];
  }
  sort(t,t+N);
  vector <int> b;
  int num=0;
  b[num]=t[0];
  int nowbus=1;
  for (int i=1;i<N;i++){
    cout<<i<<" "<<num<<" "<<nowbus<<endl;
    if((t[i]<=b[num]+K)&&(C-nowbus>=0)){//時間内　まだ乗れる
      nowbus++;
    }
    else if(t[i]>b[num]+K){//K秒以上経過して到着
      nowbus=1;
      num++;
      b[num]=t[i];
    }
    else if(C-nowbus<0){
      nowbus=1;
      num++;
      b[num]=t[i];
    }
  }
  cout<<num+1<<endl;
  return 0;
}

    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'i' was not declared in this scope
    9 |   int t[i];
      |         ^
a.cc:11:10: error: 't' was not declared in this scope
   11 |     cin>>t[i];
      |          ^
a.cc:13:8: error: 't' was not declared in this scope
   13 |   sort(t,t+N);
      |        ^
Language: C++

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


int main() {
	int N, C, K;
	cin >> N >> C >> K;
	int Bus = 0;
	int Waiting = 0;
	int AngryTime = INFINITY;
	vector<int> Schedule(N, 0);
	for (int i = 0; i < N; i++) cin >> Schedule[i];
	sort(Schedule.begin(), Schedule.end());
	for (int i = 0; i < N; i++) {
		int T = Schedule[i];
		Waiting++;
		if (AngryTime >= T) {
			Bus++;
			Waiting = 1;
		}
		if (Waiting == C) {
			Bus++;
			Waiting = 0;
		}
		if (Waiting == 1) {
			AngryTime = T + K;
		}
	}
	cout << Bus;
}

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

#include<bits/stdc++.h>


using namespace std;
 
int main(){
 long int N,C,K;
 long int ans = 0;

 cin >> N >> C >> K;
 vector<int> T(N);
long int count = 1;
for(int i = 0; i < N; i++) {cin >> T[i];}

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

long int tt = -1;
long int cnt = 0;
 for(int i = 1; i < N; i++){
   if(T[i] <= tt && cnt + 1 <=C){
     cnt++;
   }else{
     ans++;
     tt = T[i] + K;
     cnt = 1;
   }
 
   }
 }

 cout << ans;



}

Compiler output:
a.cc:31:2: error: 'cout' does not name a type
   31 |  cout << ans;
      |  ^~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

#include<bits/stdc++.h>


using namespace std;
 
int main(){
 long int N,C,K;
 long int ans = 0;

 cin >> N >> C >> K;
 vector<int> T(N);
long int count = 1;
for(int i = 0; i < N; i++) {cin >> T[i];}

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

long int tt = -1;
long int cnt = 0;
 for(int i = 1; i < N; i++){
   if(t[i] <= tt && cnt + 1 <=c){
     cnt++;
   }else{
     ans++;
     tt = T[i] + K;
     cnt = 1;
   }
 
   }
 }

 cout << ans;



}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:7: error: 't' was not declared in this scope
   20 |    if(t[i] <= tt && cnt + 1 <=c){
      |       ^
a.cc:20:31: error: 'c' was not declared in this scope
   20 |    if(t[i] <= tt && cnt + 1 <=c){
      |                               ^
a.cc: At global scope:
a.cc:31:2: error: 'cout' does not name a type
   31 |  cout << ans;
      |  ^~~~
a.cc:35:1: error: expected declaration before '}' token
   35 | }
      | ^
Language: C++

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

const int Maxn = 100005;

int n, c, k;
int a[Maxn];
int res;

int main()
{
    scanf("%d %d %d", &n, &c, &k);
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i]);
    sort(a, a + n);
    int pnt = 0;
    while (pnt < n) {
        res++;
        pnt = min(upper_bound(a, a + n, a[pnt] + k) - a, pnt + c);
    }
    printf("%d\n", res);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: no matching function for call to 'min(long int, int)'
   19 |         pnt = min(upper_bound(a, a + n, a[pnt] + k) - a, pnt + c);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:19:18: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'int')
   19 |         pnt = min(upper_bound(a, a + n, a[pnt] + k) - a, pnt + c);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:19:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   19 |         pnt = min(upper_bound(a, a + n, a[pnt] + k) - a, pnt + c);
      |               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
// Welcome to my source code!

int main() {
    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);
    ll dep = t[0] + k, cnt = 0, ans = 1;
    for (int i = 0; i < n; i++) {
        if (dep < t || cnt == c) {
            dep = t[i] + k, cnt = 0, ans++;
        }
        cnt++;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   15 |         if (dep < t || cnt == c) {
      |             ~~~~^~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  long int c, k;
  cin >> c >> k;
  vector<long int> t(n);
  for(int i = 0; i < n; i++){
    cin >> t.at(i);
  }
  sort(t.begin(). t.end());
  int rag = k;
  int count = 0;
  int bus = 0;
  for(int i = 0; i < n; i++){
    if(count == c){
      rag = k;
      count = 0;
      bus++;
    }
    if(rag == k){
      rag += t.at(i);
      bus++;
      count++;
    }else if(t.at(i) < rag){
      count++;
    }else if(t.at(i) > rag){
      count = 0;
      rag = k;
    }
  }
  cout << bus;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: 'std::vector<long int>::iterator' has no member named 't'
   13 |   sort(t.begin(). t.end());
      |                   ^
Language: C++

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

int main() {
  long long int n,c,k;
  cin >> n >> c >> k;
  vector<long long int> list(n);
  for (long long int i=0;i<n;i++) {
    cin >> list.at(i);
  }
  revers(list.begin(), list.end());
  long long int count=1,temp_time=list.at(0),temp_num=0;
  
  for (int i=0;i<n;i++) {
    temp_num++;
    if (temp_num>c||list.at(i)-temp_time>k) {
      count++;
      temp_num=1;
      temp_time=list.at(i);
    }
  }
  cout << count << endl;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'revers' was not declared in this scope
   11 |   revers(list.begin(), list.end());
      |   ^~~~~~
a.cc:22:25: error: expected '}' at end of input
   22 |   cout << count << endl;
      |                         ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

//Zory-2019
#include<bits/stdc++.h>
using namespace std;
namespace mine
{
    typedef long long ll;
    #define pii pair<int,int>
    #define FR first
    #define SE second
    #define MP make_pair
    #define PB push_back
    #define vc vector
    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())
    #define bin(x) (1ll<<(x))
    #define GG(x) if(x) {puts("error");exit(666);}
    #define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
    #define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
    ll qread()
    {
        ll ans=0,f=1;char c=getchar();
        while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
        while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
        return ans*f;
    }
    void write(ll num)
    {
        if(num<0) putchar('-'),num=-num;
        if(num>=10) write(num/10);
        putchar('0'+num%10);
    }
    void write1(ll num){write(num);putchar(' ');}
    void write2(ll num){write(num);putchar('\n');}
    template<typename T> void chmax(T &x,const T y) {x=(x>y?x:y);}
    template<typename T> void chmin(T &x,const T y) {x=(x<y?x:y);}
    ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

    const int INF=0x3f3f3f3f;
    const int MOD=1e9+7;
    int mm(const int x){return x>=MOD?x-MOD:x;}
    template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
    ll qpower(ll x,ll e,int mod=MOD){ll ans=1;GG(e<0)while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
    ll invm(ll x){return qpower(x,MOD-2);}
    const int N=2e5+10;

    pii a[N];priority_queue< int,vc<int>,greater<int> > q;
	void main()
	{
		int n=qread(),C=qread(),K=qread();
		fo(i,1,n) a[i].FR=qread(),a[i].SE=a[i].FR+K;sort(a+1,a+n+1);
		int ans=0;a[n+1].FR=INF+INF;
		fo(i,1,n+1)9
		{
			while(sz(q) and q.top()<a[i].FR)
			{
				int cnt=C;while(cnt-- and sz(q)) q.pop();
				ans++;
			}q.push(a[i].SE);
		}write(ans);
	}
};//(ans+MOD)%MOD
signed main()
{
    srand(time(0));
    mine::main();
}


Compiler output:
a.cc: In function 'void mine::main()':
a.cc:52:29: error: expected ';' before '{' token
   52 |                 fo(i,1,n+1)9
      |                             ^
      |                             ;
   53 |                 {
      |                 ~
Language: C++

//スギノキさんの写経コード
#include <bits/stdc++.h>

using namespace std;
using ll =long long;
using db = double;
using vll = vector<long long>;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
#define debug(x)  cout << #x << " = " << (x) << endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//グラフ用
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};	
//ここから書き始める

ll combination(ll n, ll i){
	ll count = 0;
	ll multi = 1;
	ll div =1;
	int limit = i;
	while(count < limit){
		multi *= n;
		n--;
		multi/= count+1;
		count ++ ;
	}
	return multi / div;
}

int main()
{
	cout <<setprecision(10);
	int N , C , K ;
	cin >> N >> C >> K ;
	vector<int> T(N);
	rep(i,N) cin >> T[i];
	SORT(T);
	int bus = 1;
	int count  = 0; //乗客数カウント
	int time =  0 ;//一人目の客の乗車時刻
	for(int i = 0 ; i < N ; i++){
		if(count == c){
			bus ++ ;
			count = 0;
		}
		if(count == 0){
			time = T.at(i);
			count ++ ;
		}else{
			if( T.at(i) <= time + K) count ++;
			else{
				bus ++ ;
				count = 1;
				time = T.at(i);
			}
		}
	}
	cout << bus << endl;
	
}


Compiler output:
a.cc: In function 'bool coY()':
a.cc:20:32: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | bool coY() {cout <<"Yes"<<endl;}
      |                                ^
a.cc: In function 'bool coN()':
a.cc:21:30: warning: no return statement in function returning non-void [-Wreturn-type]
   21 | bool coN(){cout <<"No"<<endl;}
      |                              ^
a.cc: In function 'int main()':
a.cc:65:29: error: 'c' was not declared in this scope
   65 |                 if(count == c){
      |                             ^
Language: C++

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

signed main() {
  int N, C, K;
  cin >> N >> C >> K;
  
  vector<int> T(N);
  for( int i = 0; i < N; i++ ) cin >> T.at(i);
  sort( T.begin(), T.end() );
  
  int bus = 1;
  int count = 0; //乗客数カウント
  int time = 0; //1人目の客の乗車時刻
  for( int i = 0; i < N; i++ ){
    if( count == 0 ){
      time = T.at(i);
      count++;
    }else{
      if( T.at(i) <= time + K ) count++;
      else{
        bus++;
        count = 1;
        if(i+1>=n)break;
        time = T.at(i+1);
      }
    }
    if( count == C ){
      bus++;
      count = 0;
    }
  }
  
  cout << bus << endl;
      
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'n' was not declared in this scope
   25 |         if(i+1>=n)break;
      |                 ^
Language: C++

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

cosnt int MAXN = 1e5 + 10;

int n, k, c; 
int t[MAXN];

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

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

	sort(t, t + n);

	int cc = c, tt = k, b = 0;

	for(int i = 1; i <= n; i++){
		if(cc < c && tt + t[i] - t[i - 1] <= k) {
			cc++;
			tt += t[i] - t[i - 1];
		}
		else {
			b++;
			cc = 1;
			tt = 0;
		}
	}
	cout << b << '\n';
	return 0;
}


Compiler output:
a.cc:5:1: error: 'cosnt' does not name a type; did you mean 'const'?
    5 | cosnt int MAXN = 1e5 + 10;
      | ^~~~~
      | const
a.cc:8:7: error: 'MAXN' was not declared in this scope
    8 | int t[MAXN];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:14:24: error: 't' was not declared in this scope
   14 |                 cin >> t[i];
      |                        ^
a.cc:16:14: error: 't' was not declared in this scope; did you mean 'tm'?
   16 |         sort(t, t + n);
      |              ^
      |              tm
Language: C++

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

cosnt int MAXN = 1e5 + 10;

int n, k, c; 
int t[MAXN];

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

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

	sort(t, t + n);

	int cc = c, tt = k, b = 0;

	for(int i = 1; i <= n; i++){
		if(cc < c && tt + t[i] - t[i - 1] <= k) {
			cc++;
			tt += t[i] - T[i - 1];
		}
		else {
			b++;
			c = 1;
			t = 0;
		}
	}
	cout << b << '\n';
	return 0;
}


Compiler output:
a.cc:5:1: error: 'cosnt' does not name a type; did you mean 'const'?
    5 | cosnt int MAXN = 1e5 + 10;
      | ^~~~~
      | const
a.cc:8:7: error: 'MAXN' was not declared in this scope
    8 | int t[MAXN];
      |       ^~~~
a.cc: In function 'int main()':
a.cc:14:24: error: 't' was not declared in this scope
   14 |                 cin >> t[i];
      |                        ^
a.cc:16:14: error: 't' was not declared in this scope; did you mean 'tm'?
   16 |         sort(t, t + n);
      |              ^
      |              tm
a.cc:23:38: error: 'T' was not declared in this scope
   23 |                         tt += t[i] - T[i - 1];
      |                                      ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll INF = 1e10;
int main()
{
    ll n, c, k;
    cin >> n >> c >> k;
    vector<int> t(n);
    for(int i = 0; i < n; i++) cin >> t[i];
    sort(t.begin(), t.end());
    queue<int> que;
    que.push(t[0]);
    ll ans = 0;
    for(int i = 1; i < n; i++)
    {
        ll now = t[i];
        while(que.size() && que.front() + k <= now)
        {
            ll loop = min(int(que.size()), c);
            while(loop--) que.pop();
            ans++;
        }
        que.push(now);
    }
    ans += (que.size()-1)/c + 1;
    cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: no matching function for call to 'min(int, ll&)'
   21 |             ll loop = min(int(que.size()), c);
      |                       ~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h: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:21:26: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'll' {aka 'long long int'})
   21 |             ll loop = min(int(que.size()), c);
      |                       ~~~^~~~~~~~~~~~~~~~~~~~
/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:21:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   21 |             ll loop = min(int(que.size()), c);
      |                       ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>

using namespace std;

int main(){
    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 ans = 0, c = 0, k = 0;
    bool dprt;
    for (int i = 0; i < N - 1; i++){
        c++;
        k += T[i + 1] - T[i];
        dprt = false;
        if (c == C or k >= K){
            c = 0;
            k = 0;
            ans++;
            dprt = true;
        }
    }
    if (dprt){ // last person calculations
        ans++;
    } else if (k + (T[N - 1] - T[N - 2]) >= K) {
        ans++;
    }

    cout << ans << endl;

    return 0;
}


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

#include <iostream>
using namespace std;

int N, C, K; //passengers, bus capacity, time capacity;
int* T;
int main()
{
    cin >> N >> C >> K;
    T = new int[N+1];
    for(int i = 1; i <= N; i++) cin >> T[i];
    sort(T+1, T+N+1);

    int c = C, t = K, b = 0;

    for(int i = 1; i <= N; i++)
    {
        if(c < C && t + T[i] - T[i-1] <= K)
        {
            c++;
            t += T[i] - T[i-1];
            continue;
        }
        b++;
        c = 1;
        t = 0;
    }
    cout << b << '\n';
    return 0;
}

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

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

int main() {
    int n = 0, c = 0, k = 0;
    int a[10000000];
    cin >> n >> c >> k;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    sort(a, a + n);
    cout << a[n-1];
    int ans = 1, base = 0;
    int passenger = 0;
    int p = 0;
    while (p != n){
        if (passenger < c && (a[p] - a[base] <= k)){
            p++;
            passenger++;
        } else {
            ans++;
            base = p;
            p++;
            passenger = 1;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin >> n >> c >> k;
      |     ^~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(a, a + n);
      |     ^~~~
      |     short
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout << a[n-1];
      |     ^~~~
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;

template<typename T>void chmax(T &a,T b){a=max(a,b);}
template<typename T>void chmin(T &a,T b){a=min(a,b);}
using namespace std;

void solve(){
	int n;
	ll c,k;
	cin>>n>>c>>k;
	vector<ll>t(n);
	rep(i,n){
		cin>>t[i];
	}
	sort(t.begin(),t.end());
	ll now=0;
	while(now<n){
		ll nxt=now;
		while(nxt<n&&nxt-now<c&&t[nxt]-t[now]<=k)++nxt;
		++ans;
		now=nxt;
	}
	cout<<ans<<endl;
}

signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:40:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   40 |                 ++ans;
      |                   ^~~
      |                   abs
a.cc:43:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#include<functional>
#include<unordered_set>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 50;

template<typename T>void chmax(T &a,T b){a=max(a,b);}
template<typename T>void chmin(T &a,T b){a=min(a,b);}
using namespace std;

void solve(){
	int n;
	ll c,k;
	cin>>n>>c>>k;
	vector<ll>t(n);
	ll minv=1e9+5,maxv=0;
	rep(i,n){
		cin>>t[i];
		minv=min(minv,t[i]);
		maxv=max(maxv,t[i]);
	}
	sort(t.begin(),t.end());
	ll now=0;
	while(now<n){
		ll nxt=cnt;
		while(nxt<n&&nxt-now<c&&t[nxt]-t[cnt]<=k)++nxt;
		++ans;
		now=nxt;
	}
	cout<<ans<<endl;
}

signed main(){
	std::ios::sync_with_stdio(false);
    std::cin.tie(0);
	solve();
	return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:41:24: error: 'cnt' was not declared in this scope; did you mean 'int'?
   41 |                 ll nxt=cnt;
      |                        ^~~
      |                        int
a.cc:43:19: error: 'ans' was not declared in this scope; did you mean 'abs'?
   43 |                 ++ans;
      |                   ^~~
      |                   abs
a.cc:46:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   46 |         cout<<ans<<endl;
      |               ^~~
      |               abs
Language: C++

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

int main() {
    int N, C, K;
    cin >> N >> C >> K;
    vector<int> T(N);
    for(int i = 0; i < N; i++){
        cin >> T[i];
    }
    sort(T.begin(),T.end());
    while(i < N){
        int j = i;
        while(i - j < C && i < N && T[i] <= T[j] + K){
            i++;
        }
        ans++;
    }

    cout << ans << endl;


}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'i' was not declared in this scope
   12 |     while(i < N){
      |           ^
a.cc:17:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |         ans++;
      |         ^~~
      |         abs
a.cc:20:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     cout << ans << endl;
      |             ^~~
      |             abs