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

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    // 貪欲法では間に合わないので使い回す、
    // segtree、累積和を使えばsegtreeいらない
    int N;
    cin >> N;
    vector<int> A(N);
    map<int, int> mp;
    rep(i, N) {
        cin >> A[i];
        mp[A[i]]++;
    }
    vector<int> B;
    for (auto a : mp) {
        B.push_back(a.second);
    }
    sort(B.begin(), B.end());
    vector<ll> Bcum = B;
    int length = sz(B);
    for (int i = 1; i < length; i++) {
        Bcum[i] += Bcum[i-1];
    }
    for (int i = 1; i <= N; i++) {
        // 最大の回数
        int time = N / i;
        int ind = (upper_bound(B.begin(), B.end(), time) - B.begin()); // time以下の一番右のindex+1
        ll ans = Bcum[ind-1];
        ans += time * (length - ind);
        ans /= i;
        cout << ans << '\n';
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: conversion from 'vector<int>' to non-scalar type 'vector<long long int>' requested
   25 |     vector<ll> Bcum = B;
      |                       ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define show(x) {for(auto i: x){cout << i << " ";} cout << endl;}
using namespace std;
using ll = long long;
using P = pair<int, int>;
#include <atcoder/all>
using namespace atcoder;

// AC Libraryが出来たら通りそう

int op(int a, int b) { return a + b; }

int e() { return 0; }

int target;

bool f(int v) { return v < target; }

// segtree<int, op, e> seg(a); seg.set(x, v); seg.prod(l, r)
// seg.max_right<f>(p)

int main() {
    // 貪欲法では間に合わないので使い回す、奇数と偶数？、2部グラフ？
    // segtree
    int N;
    cin >> N;
    vector<int> A(N);
    map<int, int> mp;
    rep(i, N) {
        cin >> A[i];
        mp[A[i]]++;
    }
    vector<int> B;
    for (auto a : mp) {
        B.push_back(a.second);
    }
    sort(B.begin(), B.end());
    int length = sz(B);
    segtree<int, op, e> seg(B);
    for (int i = 1; i <= N; i++) {
        // 最大の回数
        int time = N / i;
        int ind = (upper_bound(B.begin(), B.end(), time) - B.begin()); // time以下の一番右のindex+1
        int ans = seg.prod(0, ind);
        ans += time * (length - ind);
        ans /= i;
        cout << ans << '\n';
    }
    return 0;
    // ll, 0, -, 1i, for s&g, debug
}

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

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define endl "\n"
#define all(c) (c).begin(),(c).end()

signed main() {
	// freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	/* stuff you should look for
	 * int overflow, array bounds
	 * special cases (n=1?)
	 * do smth instead of nothing and stay organized
	 * WRITE STUFF DOWN
	 * also remember to clear global variables on multitest problems
	 * also remember to switch INT_MAX -> LLONG_MAX after fixing overflow bugs
	 * don't get used to greedy, DP might actually be the solution
	 */
	std::ios::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin >> n;
	vector<int> freq(n);
	for (int i = 0; i < n; i++) {
		int x;
		cin >> x;
		freq[--x]++;
	}
	priority_queue<int> pq;
	for (int i = 0; i < n; i++)
		pq.push(freq[i]);


	int s = n;
	for (int k = 1; k <= n; k++) {
		while (!pq.empty() and pq.top() > s/k) {
			int x = pq.top(); pq.pop();
			pq.push(x-1);
			s--;
		}
		cout << s/k << endl;
	}
	
	// you should actually read the stuff at the top
}


Compiler output:
In file included from /usr/include/c++/14/string:43,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:4:
/usr/include/c++/14/bits/allocator.h: In destructor 'std::_Vector_base<int, std::allocator<int> >::_Vector_impl::~_Vector_impl()':
/usr/include/c++/14/bits/allocator.h:182:7: error: inlining failed in call to 'always_inline' 'std::allocator< <template-parameter-1-1> >::~allocator() noexcept [with _Tp = int]': target specific option mismatch
  182 |       ~allocator() _GLIBCXX_NOTHROW { }
      |       ^
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:132:14: note: called from here
  132 |       struct _Vector_impl
      |              ^~~~~~~~~~~~
Language: C++

#include "bits/stdc++.h"
#include<random>
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first - r.first, l.second - r.second); }
const lint MOD = 1e9 + 7, INF = 1e18;

lint N, A;
lint cnt[300000];
lint sumcnt[300001];

int main() {
	cin >> N;
	REP(i, N) cnt[i] = 0;
	REP(i, N) {
		cin >> A; A--;
		cnt[A]++;
	}
	sort(cnt, cnt + N, greater<lint>());
	lint knd = 0;
	REP(i, N) {
		if (cnt[i] != 0) knd++;
	}
	IREP(i, knd) {
		sumcnt[i] = sumcnt[i + 1] + cnt[i];
	}
	lint idx = 0;
	vector<lint> ans;
	lint out_use = 0;
	lint border = N;
	REP(i, N) {
		//許容出現回数 border = 5なら、5を超える数の和を引く
		out_use += idx * (border - N / (i + 1));
		border = N / (i + 1);
		while (idx < N && border < cnt[idx]) {
			out_use += cnt[idx] - border;
			idx++;
		}
		ans.push_back(min(max(0ll, (N - out_use) / (i + 1)), sumcnt[i));
	}
	REP(i, N) {
		cout << (i + 1) << " ";
		cout << ans[i] << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:51:78: error: expected ']' before ')' token
   51 |                 ans.push_back(min(max(0ll, (N - out_use) / (i + 1)), sumcnt[i));
      |                                                                              ^
      |                                                                              ]
Language: C++

#include<iostream>
#include<algorithm>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

int const MAXN = 3e5;
int N, m[MAXN], d[MAXN+1];

int main() {
  std::cin >> N;
  std::fill_n(m, N, 0);
  for(int i = 0; i < N; ++i) { int A; std::cin >> A; ++m[A-1]; }
  std::fill_n(d, N+1, 0);
  for(int i = 0; i < N; ++i) ++d[m[i]];
 
  int sum_D = 0, sum_iD = N, k = 1;
  for(int ans = N; ans >= 1; --ans) {
    sum_D += d[ans];
    sum_iD -= d[ans]*ans;
    int f = sum_iD/ans + sum_D + 1;
    for(int i = k; i < f; ++i) std::cout << ans << std::endl;
    k = f;#
  }
  while(k <= N) { std::cout << 0 << std::endl; ++k; }
  return 0;
}


Compiler output:
a.cc:23:11: error: stray '#' in program
   23 |     k = f;#
      |           ^
Language: C++

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

const int mod = 1e9 + 7;
const long long INF = 1LL<<60;
using ll = long long;
using P = pair<int,int>;

int main(){
    // C : Aをカウントする配列である
    // D[x] :  Cの中にx以上が何個存在するかを表す
    // S : Dの累積和を表す
    // S2[x] = S[x] / x;
    
    int n;
    cin >> n;
    
    vector<long long> C(n, 0);
    vector<long long> D(n+1, 0);
    
    rep(i, n){
        int a;
        cin >> a;
        a--;
        C[a]++;
        D[C[a]]++;
    }
    
    vector<long long> S(n+1, 0), S2(n+1, 0);
    for (int i = 1; i < n+1; i++){
        S[i] = S[i-1] + D[i], S2[i]= S[i] / i;
    }
    
    long long x = n;
    for (long long k = 1; k <= n; k++){
        while(x > 0 && K > S2[x]) x--;
        cout << x << endl;
    }
        
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:24: error: 'K' was not declared in this scope
   37 |         while(x > 0 && K > S2[x]) x--;
      |                        ^
Language: Java

import java.util.*;

public class Main implements Runnable {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        // Run with 32MB stack
        Thread thread = new Thread(null, new Main(), "", 32 * 1024 * 1024);
        thread.start();
    }

    @Override
    public void run() {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static void solve(Scanner scanner) {
        int N = Integer.parseInt(scanner.next());
        int A[] = new int[N];
        for (int i = 0; i < N; i++) {
            A[Integer.parseInt(scanner.next()) - 1]++;
        }
        Arrays.sort(A);

        int S[] = new int[N + 1];
        for (int i = 0; i < N; i++) {
            S[i + 1] = S[i] + A[i];
        }

        for (int k = 1; k <= N; k++) {
            int l = 0; // ok
            int r = N + 1; // ng
            while (r - l > 1) {
                int mid = (l + r) >>> 1;
                int index = binarySearch(A, 0, A.length, mid);
                int sum = mid * (N - index) + S[index];
                if (sum >= mid * k) {
                    l = mid;
                } else {
                    r = mid;
                }
            }
            System.out.println(l);
        }

    }

    // return first index whose value is more than or equal to val;
    static int lowerBound(int[] A, int fromInc, int toExc, int val) {
        if (A[toExc - 1] < val) {
            return toExc;
        }
        int left = fromInc - 1, right = toExc;
        while (right - left > 1) {
            int mid = (left + right) >>> 1;
            if (A[mid] < val) {
                left = mid;
            } else {
                right = mid;
            }
        }
        if (A[left] < val) {
            return left + 1;
        }
        return left;
    }

}


Compiler output:
Main.java:37: error: cannot find symbol
                int index = binarySearch(A, 0, A.length, mid);
                            ^
  symbol:   method binarySearch(int[],int,int,int)
  location: class Main
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef multiset<ll> S;
typedef priority_queue<ll> PQ;
typedef priority_queue<P,vector<P>,greater<P>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double pi=3.14159265358979323846;
bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}
void outvi(vi v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<endl;}
void outvvi(vvi v){rep(i,v.size()){rep(j,v[i].size()){if(j)cout<<' ';cout<<v[i][j];}cout<<endl;}}
int main(){
ll n;cin>>n;
vi v(n)
rep(i,n){
ll k;cin>>k;
v[k-1]++;
}
sort(all(v));
vi rui(n+1);
rui[0]=0;
REP(i,1,n+1)rui[i]=v[i-1]+rui[i-1];
rep(i,n){
ll ok=0,ng=n+1;
while(ng-ok>1){
ll mid=(ok+ng)/2;
ll u=lb(v,mid);
if((i+1)*mid<=(n-u)*mid+rui[u])ok=mid;
else ng=mid;
}
cout<<ok<<endl;
}
}

Compiler output:
a.cc:24:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   24 | bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
      |            ^~~~
a.cc:24:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   24 | bool chmin(auto &a,auto b){if(a>b){a=b;return true;}return false;}
      |                    ^~~~
a.cc:25:12: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   25 | bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}
      |            ^~~~
a.cc:25:20: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   25 | bool chmax(auto &a,auto b){if(a<b){a=b;return true;}return false;}
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:3:20: error: expected ',' or ';' before 'for'
    3 | #define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
      |                    ^~~
a.cc:31:1: note: in expansion of macro 'rep'
   31 | rep(i,n){
      | ^~~
a.cc:31:5: error: 'i' was not declared in this scope
   31 | rep(i,n){
      |     ^
a.cc:3:38: note: in definition of macro 'rep'
    3 | #define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
      |                                      ^
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Solution {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = Integer.parseInt(st.nextToken());
        int[] A = new int[N];
        int[] C = new int[N+1];
        int[] D = new int[N+1];

        st = new StringTokenizer(br.readLine());

        for(int i = 0; i < N; i++) {
            A[i] = Integer.parseInt(st.nextToken());
            C[A[i]] += 1;
        }

        for(int i = 0; i <= N; i++) {
            D[C[i]] += 1;
        }

        int[] Dk_cumsum = new int[N+1];
        int[] D_cumsum = new int[N+1];

        D_cumsum[N] = D[N];
        for(int k = 1; k <= N; k++) {
            Dk_cumsum[k] = Dk_cumsum[k-1] + k*D[k];
            D_cumsum[N-k] = D_cumsum[N-k+1] + D[N-k];
        }

        int[] f = new int[N+1];
        for(int X = 1; X <= N; X++) {
            if(X == N) {
                f[X] = Dk_cumsum[X] / X;
            } else {
                f[X] = (Dk_cumsum[X] + X * D_cumsum[X+1]) / X;
            }
        }

        for(int K = 1; K <= N; K++) {
            //find X maximal, with K <= f(X)
            int x = 0;
            if(f[1] >= K) {
                if(K <= f[N]) {
                    System.out.println(N);
                } else {
                    for (int b = N; b >= 1; b /=2) {
                        while(K <= f[x+b]) x += b;
                    }
                    System.out.println(x);
                }
            } else {
                System.out.println("0");
            }
        }
    }
}

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

import java.util.Scanner;

public class Solution {
    static Scanner sc;
    public static void main(String[] args) {
        sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] A = new int[N];
        int[] C = new int[N+1];
        int[] D = new int[N+1];

        for(int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
            C[A[i]] += 1;
        }

        for(int i = 0; i <= N; i++) {
            D[C[i]] += 1;
        }

        int[] Dk_cumsum = new int[N+1];
        int[] D_cumsum = new int[N+1];

        D_cumsum[N] = D[N];
        for(int k = 1; k <= N; k++) {
            Dk_cumsum[k] = Dk_cumsum[k-1] + k*D[k];
            D_cumsum[N-k] = D_cumsum[N-k+1] + D[N-k];
        }

        int[] f = new int[N+1];
        for(int X = 1; X <= N; X++) {
            if(X == N) {
                f[X] = Dk_cumsum[X] / X;
            } else {
                f[X] = (Dk_cumsum[X] + X * D_cumsum[X+1]) / X;
            }
        }

        for(int K = 1; K <= N; K++) {
            //find X maximal, with K <= f(X)
            int x = 0;
            if(f[1] >= K) {
                if(K <= f[N]) {
                    System.out.println(N);
                } else {
                    for (int b = N; b >= 1; b /=2) {
                        while(K <= f[x+b]) x += b;
                    }
                    System.out.println(x);
                }
            } else {
                System.out.println("0");
            }
        }
    }
}

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

import bisect
N = int(input())
count = {}
for x in map(int, input().split()):
    count[x] = count.get(x, 0) + 1

a = sorted(count.values())
sums = a[:]
n = len(a)
for i in range(1, n):
    sums[i] += sums[i-1]
    
def check(k, x):
    pos = bisect.bisect_right(a, x)
    if pos == 0:
        return x * n >= k * x
    return sums[pos-1]+ x * (n - pos) >= k * x

x = N
for k in range(1, N + 1):
    while not check(k, x):
        x -= 1
    print(x)


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import bisect
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'for'
    4 | for x in map(int, input().split()):
      | ^~~
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i = 0;i < (int)(n);i++)
#define ITR(x,c) for(_typeof(c.begin()) x = c.begin();x != c.end();x++)
#define RITR(x,c) for(_typeof(c.rbegin())) x = c.rbegin;x != c.rend();x++)//逆
#define setp(n) fixed << setprecision(n) //小数点はn桁
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbigin()),(a.rend()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void) {
	
	
	int n; cin >> n;
	vi C(n);
	rep(i, n) {
		int j; 
		cin >> j;
			C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
	}
	sort(all(C));
	vi D(n);
	int k;
	int j = 1;
	for (k = 0; k <= n; k++)
		while (C[j - 1] == k) {
			D[k]++;
			j++;     //Cj = k であるjの個数を格納
		}
	vi f_X(n);

	rep(i,n){
		for (int k = 0; k <= i; k++) {
			f_X[i] += k * D[k];
		}
		for (int k = i + 1; k <= N; k++) {
			f_X[i] += i * D[k];
		}
		f_X[i] = f_X[i] / i;
	}
	int flag = 0;
	for (int K = 1; K <= N; K++) {
		while (K <= f_X[flag]) {
			flag++;
		}
		cout << flag << "\n";
		flag = 0;
	}
	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:42: error: 'N' was not declared in this scope
   49 |                 for (int k = i + 1; k <= N; k++) {
      |                                          ^
a.cc:55:30: error: 'N' was not declared in this scope
   55 |         for (int K = 1; K <= N; K++) {
      |                              ^
Language: C++

#include <bits/stdc++.h>
 
#define rep(i,n) for(int i = 0;i < (int)(n);i++)
#define ITR(x,c) for(_typeof(c.begin()) x = c.begin();x != c.end();x++)
#define RITR(x,c) for(_typeof(c.rbegin())) x = c.rbegin;x != c.rend();x++)//逆
#define setp(n) fixed << setprecision(n) //小数点はn桁
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>
 
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbigin()),(a.rend()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert
 
using namespace std;
 
int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false); 　//高速cin
	int n; cin >> n;
	vi C(n);
	rep(i, n) {
		int j; 
      cin >> j;
			C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
	}
	sort(all(C));
	vi D(n);
	int k;
	int j = 1;
	for (k = 0; k <= n; k++)
		while (C[j - 1] == k) {
			D[k]++;
			j++;     //Cj = k であるjの個数を格納
		}
	vi f_X(n);
 
	rep(i,n){
		for (int k = 0; k <= i; k++) {
			f_X[i] += k * D[k];
		}
		for (int k = i + 1; k <= n; k++) {
			f_X[i] += i * D[k];
		}
		f_X[i] = f_X[i] / i;
	}
	int flag = 0;
	for (int K = 1; K <= n; K++) {
		while (K <= f_X[flag]) {
			flag++;
		}
		cout << flag << "\n";
		flag = 0;
	}
	return 0;
 
}

Compiler output:
a.cc:26:38: error: extended character 　 is not valid in an identifier
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^
a.cc: In function 'int main()':
a.cc:26:38: error: '\U00003000' was not declared in this scope
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^~
a.cc:27:23: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |         int n; cin >> n;
      |                       ^
      |                       yn
Language: C++

#include <bits/stdc++.h>
 
#define rep(i,n) for(int i = 0;i < (int)(n);i++)
#define ITR(x,c) for(_typeof(c.begin()) x = c.begin();x != c.end();x++)
#define RITR(x,c) for(_typeof(c.rbegin())) x = c.rbegin;x != c.rend();x++)//逆
#define setp(n) fixed << setprecision(n) //小数点はn桁
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>
 
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbigin()),(a.rend()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert
 
using namespace std;
 
int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false); 　//高速cin
	int n; cin >> n;
	vi C(n);
	rep(i, n) {
		int j; 
      cin >> j;
			C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
	}
	sort(all(C));
	vi D(n);
	int k;
	int j = 1;
	for (k = 0; k <= n; k++)
		while (C[j - 1] == k) {
			D[k]++;
			j++;     //Cj = k であるjの個数を格納
		}
	vi f_X(n);
 
	rep(i,n){
		for (int k = 0; k <= i; k++) {
			f_X[i] += k * D[k];
		}
		for (int k = i + 1; k <= n; k++) {
			f_X[i] += i * D[k];
		}
		f_X[i] = f_X[i] / i;
	}
	int flag = 0;
	for (int K = 1; K <= n; i++) {
		while (K <= f_X[flag]) {
			flag++;
		}
		cout << flag << "\n";
		flag = 0;
	}
	return 0;
 
}

Compiler output:
a.cc:26:38: error: extended character 　 is not valid in an identifier
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^
a.cc: In function 'int main()':
a.cc:26:38: error: '\U00003000' was not declared in this scope
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^~
a.cc:27:23: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |         int n; cin >> n;
      |                       ^
      |                       yn
a.cc:55:33: error: 'i' was not declared in this scope
   55 |         for (int K = 1; K <= n; i++) {
      |                                 ^
Language: C++

#include <bits/stdc++.h>
 
#define rep(i,n) for(int i = 0;i < (int)(n);i++)
#define ITR(x,c) for(_typeof(c.begin()) x = c.begin();x != c.end();x++)
#define RITR(x,c) for(_typeof(c.rbegin())) x = c.rbegin;x != c.rend();x++)//逆
#define setp(n) fixed << setprecision(n) //小数点はn桁
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>
 
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbigin()),(a.rend()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert
 
using namespace std;
 
int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false); 　//高速cin
	int n; cin >> n;
	vi C(n);
	rep(i, n) {
		int j; cin >> j
			C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
	}
	sort(all(C));
	vi D(n);
	int k;
	int j = 1;
	for (k = 0; k <= n; k++)
		while (C[j - 1] == k) {
			D[k]++;
			j++;     //Cj = k であるjの個数を格納
		}
	vi f_X(n);
 
	rep(i,n){
		for (int k = 0; k <= i; k++) {
			f_X[i] += k * D[k];
		}
		for (int k = i + 1; k <= N; k++) {
			f_X[i] += i * D[k];
		}
		f_X[i] = f_X[i] / i;
	}
	int flag = 0;
	for (int K = 1; K <= N; i++) {
		while (K <= f_X[flag]) {
			flag++;
		}
		cout << flag << "\n";
		flag = 0;
	}
	return 0;
 
}

Compiler output:
a.cc:26:38: error: extended character 　 is not valid in an identifier
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^
a.cc: In function 'int main()':
a.cc:26:38: error: '\U00003000' was not declared in this scope
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^~
a.cc:27:23: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |         int n; cin >> n;
      |                       ^
      |                       yn
a.cc:30:32: error: expected ';' before 'C'
   30 |                 int j; cin >> j
      |                                ^
      |                                ;
   31 |                         C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
      |                         ~       
a.cc:48:42: error: 'N' was not declared in this scope
   48 |                 for (int k = i + 1; k <= N; k++) {
      |                                          ^
a.cc:54:30: error: 'N' was not declared in this scope
   54 |         for (int K = 1; K <= N; i++) {
      |                              ^
a.cc:54:33: error: 'i' was not declared in this scope
   54 |         for (int K = 1; K <= N; i++) {
      |                                 ^
Language: C++

#include <bits/stdc++.h>

#define rep(i,n) for(int i = 0;i < (int)(n);i++)
#define ITR(x,c) for(_typeof(c.begin()) x = c.begin();x != c.end();x++)
#define RITR(x,c) for(_typeof(c.rbegin())) x = c.rbegin;x != c.rend();x++)//逆
#define setp(n) fixed << setprecision(n) //小数点はn桁
#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbigin()),(a.rend()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false); 　//高速cin
	int n; cin >> n;
	vi C(n);
	rep(i, n) {
		int j; cin >> j
			C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
	}
	sort(all(C));
	vi D(n);
	int k;
	int j = 1;
	for (k = 0; k <= n; k++)
		while (C[j - 1] == k) {
			D[k]++;
			j++;     //Cj = k であるjの個数を格納
		}
	vi f_X(n);

	rep(i,n){
		for (int k = 0; k <= i; k++) {
			f_X[i] += k * D[k];
		}
		for (int k = i + 1; k <= N; k++) {
			f_X[i] += i * D[k];
		}
		f_X[i] = f_X[i] / i;
	}
	int flag = 0;
	for (int K = 1; K <= N; i++) {
		while (K <= f_X[flag]) {
			flag++;
		}
		cout << flag << "\n";
		flag = 0;
	}
	return 0;

}



Compiler output:
a.cc:26:38: error: extended character 　 is not valid in an identifier
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^
a.cc: In function 'int main()':
a.cc:26:38: error: '\U00003000' was not declared in this scope
   26 |         ios::sync_with_stdio(false); 　//高速cin
      |                                      ^~
a.cc:27:23: error: 'n' was not declared in this scope; did you mean 'yn'?
   27 |         int n; cin >> n;
      |                       ^
      |                       yn
a.cc:30:32: error: expected ';' before 'C'
   30 |                 int j; cin >> j
      |                                ^
      |                                ;
   31 |                         C[j - 1]++;  // 値がjであるカードの枚数がvec a(n)に格納 つまり Cj : Ai = j なる i の個数
      |                         ~       
a.cc:48:42: error: 'N' was not declared in this scope
   48 |                 for (int k = i + 1; k <= N; k++) {
      |                                          ^
a.cc:54:30: error: 'N' was not declared in this scope
   54 |         for (int K = 1; K <= N; i++) {
      |                              ^
a.cc:54:33: error: 'i' was not declared in this scope
   54 |         for (int K = 1; K <= N; i++) {
      |                                 ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int N;
int S = 1;
int ans[300001];
vector<int> A(N);

void input() {

	cin >> N;
	
	for (int i = 0; i < N; i++) {
		cin >> A.at(i);
	}
	sort(A.bigin(), A.end());
}

void solve() {
	input();
	for (int i = 0; i < N; i++) {
		if (A.at(i) != A.at(i + 1)) {
			S++;
		}
	}
	for (int i = 1; i <= N; i++) {
		ans[i] = S / i;
		cout << ans[i] << '\n';
	}
}

int main() {
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void input()':
a.cc:17:16: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   17 |         sort(A.bigin(), A.end());
      |                ^~~~~
      |                begin
Language: C++

#include<bits/stdc++.h>
#define MAX 300005
 
using namespace std;
int use[MAX];
vector<int> a;
int main(){
  int n,x;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x;
    use[x]++;
  }
  int cnt = 0;
  for(int i=1;i<MAX;i++){
    	if(use[i])a.push_back(use[i]);
  }
  sort(a.begin(),.end());
  int sum = n;
  for(int i=1;i<=n;i++){
    	while(a.back() > sum/i){
        	int len = a.size();
            int dup = 0;
            while(len && a[len-1] > sum/i){
            	a[len--]--;dup++;
            }
            sum -= dup;
        }
    	cout<<sum/i<<endl;
  }
  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:18: error: expected primary-expression before '.' token
   18 |   sort(a.begin(),.end());
      |                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const int maxn = 3e5 + 5 ;
int n ;
int num[maxn] ;
int sum[maxn] ;
/*bool judge(int k , int x)
{
	int now = upper_bound(num + 1 , num + n + 1 , x) - num ;
	if(now > n)
	{
		if(n >= k * x)
		  return 1 ;
		else
		  return 0 ;
	}
	int s = sum[now - 1] + (n - now + 1) ;
	if(s >= k * x)
	  return 1 ;
	else
	  return 0 ;
}*/
bool judge(int k, int x) {
	int pos = upper_bound(a + 1, a + n + 1, x) - a;
	return sum[pos-1] + 1ll*(n-pos+1)*x >= 1ll*k*x;
}
int main()
{
	scanf("%d" , &n) ;
	memset(num , 0 , sizeof(num)) ;
	for(int i = 1 ; i <= n ; i ++)
	{
		int x ;
		scanf("%d" , &x) ;
		num[x] ++ ;
	}
	sort(num + 1 , num + n + 1) ;
	sum[0] = 0 ;
	for(int i = 1 ; i <= n ; i ++)
	  sum[i] = sum[i - 1] + num[i] ;
	for(int k = 1 ; k <= n ; k ++)
	{
		int ans = 0 ;
		int l = 0 , r = n / k ;
		int mid ;
		while(l <= r)
		{
			mid = (l + r) / 2 ;
			if(judge(k , mid))
			{
				ans = mid ;
				l = mid + 1 ;
			}
			else
			  r = mid - 1 ;
		}
		printf("%d\n" , ans) ;
	}
}

Compiler output:
a.cc: In function 'bool judge(int, int)':
a.cc:25:31: error: 'a' was not declared in this scope
   25 |         int pos = upper_bound(a + 1, a + n + 1, x) - a;
      |                               ^
Language: C++

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <cassert>
#include <random>
#include <deque>
#include <bitset>
#include <string>
#include <queue>
#include <complex>

//#define int long long

#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

using namespace std;
typedef long long ll;
typedef long double ld;

mt19937 mrand(random_device{}());

double PI = acos((double)-1);
const double eps = 1e-8;
const ll inf0 = 1023 * 1024 * 1024;
const ll inf = inf0 * inf0;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;

void solve();
void scan();

signed main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
	cout << fixed; cout.precision(15);
	solve();
	return 0;
}

void solve() {
	int n; cin >> n;
	int m = n;
	vector<pair<int, int>> f;
	vector<int> a(n);
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(all(a));
	f = { {a[0], 1} };
	for (int i = 1; i < n; i++) {
		if (f.back().first == a[i]) f.back().second++;
		else f.push_back({ a[i], 1 });
	}
	n = f.size();
	vector<int> s(n);
	for (int i = 0; i < n; i++)
		s[i] = f[i].second;
	vector<int> p(n);
	p[0] = s[0];
	for (int i = 1; i < n; i++)
		p[i] = s[i] - p[i - 1];
	cout << m << endl << (m - p.back()) / 2 << endl;	
	int s = p.back();
	for (int i = 3; i < n; i++) {
		int c = i - 2;
		int id = m - c;
	}
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:73:13: error: conflicting declaration 'int s'
   73 |         int s = p.back();
      |             ^
a.cc:65:21: note: previous declaration as 'std::vector<int> s'
   65 |         vector<int> s(n);
      |                     ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>
#define chmin(x, y) x = min(x , y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

ll MAX_N = 3e6;

int N;
vector<int> card(MAX_N + 1);

void input(){
    cin >> N;
    rep(i, N) {
        
        cin >> card[i];
    }
}

void solve(){
    input();
    vector<int> num(N+1);
    for(int i=0;i<sizeof(card);i++){
        num[card[i]] += 1;
    }

    sort(num.begin(), num.end());
    vector<int> card2(N+1);
    rep(i, N) {
        s[i+1] = s[i] + card[i];
    }
    for(int i=0;i<N;i++){// 二分探索
        int f = 0, e = N;
        while(f+1<e){
            int c = (f+e)/2;
            bool ok = [&](int c){
                int j = lower_bound(card2.begin(), card2.end(), c) - card2.begin();
                int sum = c*(N-i) + card2[i];
                return sum >= c*i;
            }(c);
            if(ok) f = c;else r = e;
        }
        printf("%d", f);
    }
    return;
}

int main(){
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:36:9: error: 's' was not declared in this scope
   36 |         s[i+1] = s[i] + card[i];
      |         ^
a.cc:47:31: error: 'r' was not declared in this scope
   47 |             if(ok) f = c;else r = e;
      |                               ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>
#define chmin(x, y) x = min(x , y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

ll MAX_N = 3e6;

int N;
vector<int> card(MAX_N + 1);

void input(){
    cin >> N;
    rep(i, N) {
        
        cin >> card[i];
    }
}

void solve(){
    input();
    vector<int> num(N+1);
    for(int i=0;i<sizeof(card);i++){
        num[card[i]] += 1;
    }

    sort(num.begin(), num.end());
    vector<int> card2(N+1);
    rep(i, N) {
        s[i+1] = s[i] + card[i];
    }
    for(int i=0;i<N;i++){// 二分探索
        int f = 0, e = N;
        while(f+1<r){
            int c = (f+e)/2;
            bool ok = [&](int c){
                int j = lower_bound(card2.begin(), card2.end(), c) - card2.begin();
                int sum = c*(N-i) + card2[i];
                return sum >= c*i;
            }(c);
            if(ok) f = c;else r = e;
        }
        printf("%d", f);
    }
    return;
}

int main(){
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:36:9: error: 's' was not declared in this scope
   36 |         s[i+1] = s[i] + card[i];
      |         ^
a.cc:40:19: error: 'r' was not declared in this scope
   40 |         while(f+1<r){
      |                   ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>
#define chmin(x, y) x = min(x , y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

ll MAX_N = 3e6;

int N;
vector<int> card(MAX_N + 1);

void input(){
    cin >> N;
    rep(i, N) {
        
        cin >> card[i];
    }
}

void solve(){
    input();
    vector<int> num(N+1);
    for(int i=0;i<sizeof(card);i++){
        num[card[i]] += 1;
    }

    sort(num.begin(), num.end());
    vector<int> card2(N+1);
    rep(i, N) {
        s[i+1] = s[i] + card[i];
    }
    for(int i=0;i<N;i++){// 二分探索
        int f = 0, e = N;
        while(f+1<r){
            int c = (r+l)/2;
            bool ok = [&](int c){
                int j = lower_bound(card2.begin(), card2.end(), c) - card2.begin();
                int sum = c*(N-i) + card2[i];
                return sum >= c*i;
            }(c);
            if(ok) l = c;else r = c;
        }
        printf("%d", l);
    }
    return;
}

int main(){
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:36:9: error: 's' was not declared in this scope
   36 |         s[i+1] = s[i] + card[i];
      |         ^
a.cc:40:19: error: 'r' was not declared in this scope
   40 |         while(f+1<r){
      |                   ^
a.cc:41:24: error: 'l' was not declared in this scope
   41 |             int c = (r+l)/2;
      |                        ^
a.cc:49:22: error: 'l' was not declared in this scope
   49 |         printf("%d", l);
      |                      ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <vector>
#include <iostream>
#include <utility>
#define chmin(x, y) x = min(x , y);
#define rep(i, j) for (int (i)=0;(i)<(j);(i)++)
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long int ll;

ll MAX_N = 3e6;

int N;
vector<int> card(MAX_N + 1);

void input(){
    cin >> N;
    rep(i, N) {
        
        cin >> card[i];
    }
}

void solve(){
    input();
    vector<int> num(N+1);
    for(int i=0;i<sizeof(card);i++){
        num[card[i]] += 1;
    }

    sort(num.begin(), num.end());
    vector<int> card2(N+1);
    rep(i, N) {
        s[i+1] = s[i] + card[i];
    }
    for(int i=0;i<N;i++){// 二分探索
        int f = 0, e = N;
        while(f+1<r){
            int c = (r+l)/2;
            bool ok = [&](int c){
                int j = lower_bound(card2.begin(), card2.end(), c) - card2.begin();
                int sum = c*(N-i) + card2[i];
                return sum >= c*k;
            }(c);
            if(ok) l = c;else r = c;
        }
        printf("%d", l);
    }
    return;
}

int main(){
    solve();
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:36:9: error: 's' was not declared in this scope
   36 |         s[i+1] = s[i] + card[i];
      |         ^
a.cc:40:19: error: 'r' was not declared in this scope
   40 |         while(f+1<r){
      |                   ^
a.cc:41:24: error: 'l' was not declared in this scope
   41 |             int c = (r+l)/2;
      |                        ^
a.cc: In lambda function:
a.cc:45:33: error: 'k' was not declared in this scope; did you mean 'ok'?
   45 |                 return sum >= c*k;
      |                                 ^
      |                                 ok
a.cc: In function 'void solve()':
a.cc:49:22: error: 'l' was not declared in this scope
   49 |         printf("%d", l);
      |                      ^
Language: C++

#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cout << #x << " = " << (x) << endl;
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; }
//#define int long long

void solve() {
	int n; cin >> n;
    vector<int> (n);
    vector<int> c(n + 1, 0);
    rep(i, n) {
        cin >> a[i];
        c[a[i]] ++;
    }
    vector<int> e(n + 1, 0);
    rep1(i, n) {
        e[c[i]] ++;
    }
    vector<int> f(n + 2, 0), g(n + 2, 0);
    rep(i, n + 1) {
        f[i + 1] = f[i] + i * e[i];
        g[i + 1] = g[i] + e[i];
    }
    vector<int> d(n + 1, 0);
    rep(x, n + 1) {
        d[x] = f[x + 1] + x * (g[n + 1] - g[x + 1]);
    }
    for(int k = 1; k <= n; ++k) {
        int ok = 0, ng = n + 1;
        while(ng - ok > 1) {
            int mid = (ok + ng) / 2;
            if(d[mid] >= k * mid) ok = mid;
            else ng = mid;
        }
        cout << ok << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:54:18: error: conflicting declaration 'std::vector<int> n'
   54 |     vector<int> (n);
      |                  ^
a.cc:53:13: note: previous declaration as 'int n'
   53 |         int n; cin >> n;
      |             ^
a.cc:57:16: error: 'a' was not declared in this scope
   57 |         cin >> a[i];
      |                ^
Language: C++

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

int n;
int c[300010],q[300010];

bool judge(int x,int k){
	int l=1,r=n,ans=-1;
	while(l<=r){
		int mid=(l+r)/2;
		if(c[mid]<k&&(c[mid+1]>=k||mid==n){
		    ans=mid;
		    break;
		}
		else if(c[mid]<k) l=mid+1;
		else r=mid-1;
	}
	if(ans!=-1){
		if((n-ans)*x+q[ans]>=k*x) return true;
	}
	return false;
}

int main(){
	scanf("%d",&n);
	for(int i=1; i<=n; i++){
		int a;
		scanf("%d",&a);
		c[a]++;
	}
	sort(c+1,c+n+1);
	for(int i=1; i<=n; i++){
		q[i]=q[i-1]+c[i];
	}	    
	int x=n;
	for(int k=1; k<=n; k++){
		while(x>0&&!judge(x,k)){
			x--;
		}
		printf("%d\n",x);
	}
	return 0;
} 

Compiler output:
a.cc: In function 'bool judge(int, int)':
a.cc:11:51: error: expected ';' before '{' token
   11 |                 if(c[mid]<k&&(c[mid+1]>=k||mid==n){
      |                                                   ^
      |                                                   ;
a.cc:15:17: error: expected primary-expression before 'else'
   15 |                 else if(c[mid]<k) l=mid+1;
      |                 ^~~~
a.cc:14:18: error: expected ')' before 'else'
   14 |                 }
      |                  ^
      |                  )
   15 |                 else if(c[mid]<k) l=mid+1;
      |                 ~~~~
a.cc:11:19: note: to match this '('
   11 |                 if(c[mid]<k&&(c[mid+1]>=k||mid==n){
      |                   ^
Language: C++

//AT-143-F-Distinct Numbers
#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5+10;
const long long INF = 1e9+10;
typedef long long ll;
int n,cnt[maxn],ans[maxn],s;
ll prefix[maxn];
vector<int>mul;
inline idxUB(ll x){
	return upper_bound(mul.begin(),mul.end(),x) - mul.begin();
}
bool judge(ll x,ll k){
	int idx = idxUB(x);
	return (prefix[idx-1]+(long long)x*(s-idx) >= x*k);
}
int main(){
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		int tmp;
		scanf("%d",&tmp);
		cnt[tmp]++;
	}
	mul.push_back(0);
	for(int i = 1;i <= n;i++){
		mul.push_back(cnt[i]);
	}
	s = mul.size();
	sort(mul.begin(),mul.end());
	for(int i = 1;i <= s;i++)prefix[i] += (prefix[i-1] + mul[i]);
	ll now = 0;
	for(int k = n; k >= 1; --k) {
		while(now < n and judge(now+1,k))now++;
		ans[k] = now;
	}
	for(int i = 1;i <= n;i++)printf("%d\n",ans[i]);
	return 0;
}

Compiler output:
a.cc:10:8: error: ISO C++ forbids declaration of 'idxUB' with no type [-fpermissive]
   10 | inline idxUB(ll x){
      |        ^~~~~
Language: C++

//AT-143-F-Distinct Numbers
#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5+10;
const long long INF = 1e9+10;
typedef long long ll;
int n,cnt[maxn],ans[maxn],s;
ll prefix[maxn];
vector<int>mul;
inline idxUB(ll x){
	return upper_bound(mul.begin(),mul.end(),x) - mul.begin();
}
bool judge(ll x,ll k){
	int idx = idxUB(x);
	return (prefix[idx-1]+(long long)x*(s-idx) >= x*k);
}
int main(){
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		int tmp;
		scanf("%d",&tmp);
		cnt[tmp]++;
	}
	mul.push_back(0);
	for(int i = 1;i <= n;i++){
		mul.push_back(cnt[i]);
	}
	s = mul.size();
	sort(mul.begin(),mul.end());
	for(int i = 1;i <= s;i++)prefix[i] += (prefix[i-1] + mul[i]);
	ll L = 0,R = ans[0] = INF;
	ll now = 0;
	for(int k = n; k >= 1; --k) {
		while(now < n and judge(now+1,k))now++;
		ans[k] = now;
	}
	for(int i = 1;i <= n;i++)printf("%d\n",ans[i]);
	return 0;
}

Compiler output:
a.cc:10:8: error: ISO C++ forbids declaration of 'idxUB' with no type [-fpermissive]
   10 | inline idxUB(ll x){
      |        ^~~~~
Language: C++

#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
signed main()
{
    int n;
    scanf("%d",&n);
    vector<ll> c(n,0);
    vector<ll> d(n+1,0);
    for(int i=0;i<n;i++)
    {
        int a;scanf("%d",&a);--a;
        c[a]++;
        d[c[a]]++;
    }    
    vector<ll> s(n+1,0),s2(n+1,0);
    for(int i=1;i<=n;i++)s[i]=s[i-1]+d[i],s2[i]=s[i]/i;

    ll itr=n;
    for(ll k=1;k<=n;k++)
    {
        while(itr>0&&k>st[itr])--itr;
        printf("%d\n",itr);
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: 'st' was not declared in this scope; did you mean 's2'?
   24 |         while(itr>0&&k>st[itr])--itr;
      |                        ^~
      |                        s2
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<int> card(N);
  for (int i=0; i < N; i++) {
    cin >> card.at(i);
  }
  vector<int> count(N + 1, 0);
  for (int i=0; i < N; i++) {
    count.at(card.at(i))++;
  }
  vector<int> deg(N + 1, 0);
  for (int i=1; i <= N; i++) {
    deg.at(count.at(i))++;
  }
  vector<int> kdsum(N + 1, 0), dsum(N + 1, 0);
  for (int i=1; i <= N; i++) {
    kdsum.at(i) = kdsum.at(i - 1) + i * deg.at(i);
    dsum.at(i) = dsum.at(i - 1) + deg.at(i);
  }
  vector<int> fx(N + 1, 0);
  for (int i=1; i <= N; i++) {
      fx.at(i) = kdsum.at(i) / i + (dsum.at(N) - dsum.at(i));
  }
  sort(fx.begin(), fx.end());
  for (int k=1; k <= N; k++) {
    cout << N + 1 - ( lower_bound(fx.begin(), fx.end(), k) - fx.begin() ) << endl;
  }

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

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

using namespace std;

#define LL long long
#define FOR(i,l,r) for(int i = l; i <= r; ++i)
#define REP(i,l,r) for(int i = l; i < r; ++i)

const int maxN = 3e5 + 123;
const int oo = 123456789;

int N;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie();
    cout.tie();
    //
    //freopen("F.INP","r",stdin);
    //freopen("F.OUT","w",stdout);

    cin >> N;
    FOR(i,1,N) cin >> A[i];
    sort(A + 1,A + 1 + N);
    int M = 1;
    FOR(i,2,N) if(A[i] > A[i - 1]){
        A[++M] = A[i];
    }
    //
    FOR(i,1,N){
        cout << N/i << endl;
    }

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:23: error: 'A' was not declared in this scope
   25 |     FOR(i,1,N) cin >> A[i];
      |                       ^
a.cc:26:10: error: 'A' was not declared in this scope
   26 |     sort(A + 1,A + 1 + N);
      |          ^