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

#include <stdio.h>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;
double eps=0.000001;

unsigned long long combi(int a,int b){
  unsigned long long up=1,dn=1;
  for(int i=0;i<b;i++){
    up*=a-i;
    dn*=b-i;
  }
  return up/dn;
}

int main(void){
  int n,a,b,c,d;
  scanf("%d%d%d",&n,&a,&b);
  vector<unsigned long long> v[n];
  for(int i=0;i<n;i++) scanf("%llu",v[i]);
  sort(v.begin(),v.end());
  double ans1=1.0*accumulate(v.end()-a+1,v.end(),0)/a;
  for(c=n-1;c>=0;c--) if(v[c]==v[n-a])break;
  c=n-1-c;
  unsigned long long ans2=0;
  d=count(v.begin(),v.end(),v[n-a]);
  for(int i=a;i<=b;i++){
    if(abs(ans1-1.0*accumulate(v.end()-i+1,v.end(),0)/i)<eps){
      ans2+=combi(d,i-c);
    }
  }
  printf("%f\n%llu\n",ans1,ans2);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:10: error: request for member 'begin' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   22 |   sort(v.begin(),v.end());
      |          ^~~~~
a.cc:22:20: error: request for member 'end' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   22 |   sort(v.begin(),v.end());
      |                    ^~~
a.cc:23:32: error: request for member 'end' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   23 |   double ans1=1.0*accumulate(v.end()-a+1,v.end(),0)/a;
      |                                ^~~
a.cc:23:44: error: request for member 'end' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   23 |   double ans1=1.0*accumulate(v.end()-a+1,v.end(),0)/a;
      |                                            ^~~
a.cc:27:13: error: request for member 'begin' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   27 |   d=count(v.begin(),v.end(),v[n-a]);
      |             ^~~~~
a.cc:27:23: error: request for member 'end' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   27 |   d=count(v.begin(),v.end(),v[n-a]);
      |                       ^~~
a.cc:29:34: error: request for member 'end' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   29 |     if(abs(ans1-1.0*accumulate(v.end()-i+1,v.end(),0)/i)<eps){
      |                                  ^~~
a.cc:29:46: error: request for member 'end' in 'v', which is of non-class type 'std::vector<long long unsigned int> [n]'
   29 |     if(abs(ans1-1.0*accumulate(v.end()-i+1,v.end(),0)/i)<eps){
      |                                              ^~~
Language: C++

#include <algorithm>
#include <bitset>
#include <cstdio>
#include <functional>
#include <initializer_list>
#include <iostream>
#include <limits.h>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define REP(i, a, n) for (int i = (a); i < (int)(n); ++i)
#define REPC(i, a, n) for (int i = (a); i <= (int)(n); ++i)
#define ALL(t) t.begin(), t.end()
#define RALL(t) t.rbegin(), t.rend()
#define Yes(cond) cout << (cond ? "Yes" : "No") << endl;
#define YES(cond) cout << (cond ? "YES" : "NO") << endl;
using namespace std;
using LL = long long;
using ULL = unsigned long long;
template <class T> using VEC = std::vector<T>;
template <class T> using MAT = std::vector<std::vector<T>>;
void DUMP() { cerr << endl; }
template <class Head, class... Tail> void DUMP(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  DUMP(std::move(tail)...);
}
template <typename T> ostream &operator<<(ostream &os, vector<T> &vec) {
  os << "{";
  for (auto v : vec)
    os << v << ",";
  os << "}";
  return os;
}
std::vector<std::vector<long long>> comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

int main() {
  int n, a, b;
  cin >> n >> a >> b;
  VEC<LL> v(n);
  map<LL, int> m;
  REP(i, 0, n) {
    cin >> v[i];
    m[v[i]++];
  }
  LL ans = 0;
  sort(ALL(v));
  auto q = comb(50, 1);
  int remain = a;
  for (int i = n - 1; i >= 0; ) {
    LL w = v[i];
    int num = m[w];
    if(remain>=num){
      remain -= num;
      i -= num;
    }else{
      ans = q[num][remain];

    }
    cout << ans << endl;

    return 0;
}


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

#include "bits/stdc++.h"

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
const int INF = numeric_limits<int>::max()/2;

vector<vector<ll>> comb2(ll n) {
  vector<vector<ll>> v(n + 1,vector<ll>(n + 1, 0));
  for (int i = 0; i < (int)v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < (int)v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v;
}

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

    ll n,a,b;cin>>n>>a>>b;
    vector<ll> v(n);
    vector<vector<ll>> com=comb2(60,60);
    map<ll,ll> mp,used;
    for(int i=0;i<n;i++){
        cin>>v[i];
        mp[v[i]]++;
    }
    sort(v.rbegin(),v.rend());
    ll sum=0;
    for(int i=0;i<a;i++){
        sum += v[i];
        used[v[i]]++;
    }
    ld s = sum;
    cout<<fixed<<setprecision(10)<<s/a<<endl;
    if(v[0]!=v[a-1]) cout<<com[mp[v[a-1]]][used[v[a-1]]]<<endl;
    else{
        ll res=0;
        for(int i=a;i<=min(mp[v[0]],b);i++){
            res += com[mp[v[0]]][i];
        }
        cout<<res<<endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:33: error: too many arguments to function 'std::vector<std::vector<long long int> > comb2(ll)'
   30 |     vector<vector<ll>> com=comb2(60,60);
      |                            ~~~~~^~~~~~~
a.cc:10:20: note: declared here
   10 | vector<vector<ll>> comb2(ll n) {
      |                    ^~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll comb[55][55];

void init() {
	for(int i = 0; i <= 50; i++) {
		comb[i][0] = 1;
		comb[i][i] = 1;
		for(int j = 1; j < i; j++) {
			comb[i][j] = comb[i-1][j-1] + comb[i-1][j];
		}
	}
}

ll l[55];

int main() {
	init();
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	map<ll, int> dp;
	for(int i = 0; i < n; i++) {
		scanf("%lld", &l[i]);
		dp[l[i]]++;
	}
	sort(l, l+n);
	for(int i = 0; i < n-1-i; i++) {
		l[i] ^= l[n-1-i];
		l[n-1-i] ^= l[i];
		l[i] ^= l[n-1-i];		
	}
	if(l[0] == l[a-1]) {
		printf("%lld\n", l[0]);
		ll amt = 0;
		for(int i = a; i <= b; i++) {
			if(i <= freq[l[0]]) {
				amt += comb[freq[l[0]]][i];
			}
		}
		printf("%lld\n", amt);
	}
	else {
		ll pref = 0;
		for(int i = 0; i < a; i++) pref += l[i];
		printf("%.9f\n", pref / (double)a);
		int use = 0;
		for(int i = 0; i < a; i++) if(l[i] == l[a-1]) use++;
		printf("%lld\n", comb[dp[l[a-1]]][use]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:40:33: error: 'freq' was not declared in this scope; did you mean 'free'?
   40 |                         if(i <= freq[l[0]]) {
      |                                 ^~~~
      |                                 free
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll comb[55][55];

void init() {
	for(int i = 0; i <= 50; i++) {
		comb[i][0] = 1;
		comb[i][i] = 1;
		for(int j = 1; j < i; j++) {
			comb[i][j] = comb[i-1][j-1] + comb[i-1][j];
		}
	}
}

ll l[55];

int main() {
	init();
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	map<ll, int> dp;
	for(int i = 0; i < n; i++) {
		scanf("%lld", &l[i]);
		dp[l[i]]++;
	}
	sort(l, l+n);
	for(int i = 0; i < n-1-i; i++) {
		l[i] ^= l[n-1-i];
		l[n-1-i] ^= l[i];
		l[i] ^= l[n-1-i];		
	}
	if(l[0] == l[a-1]) {
		printf("%lld\n", l[0]);
		for(int i = a; i <= b; i++) {
			if(i <= freq[l[0]]) {
				amt += comb[freq[l[0]]][i];
			}
		}
		printf("%lld\n", amt);
	}
	else {
		ll pref = 0;
		for(int i = 0; i < a; i++) pref += l[i];
		printf("%.9f\n", pref / (double)a);
		int use = 0;
		for(int i = 0; i < a; i++) if(l[i] == l[a-1]) use++;
		printf("%lld\n", comb[dp[l[a-1]]][use]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:33: error: 'freq' was not declared in this scope; did you mean 'free'?
   39 |                         if(i <= freq[l[0]]) {
      |                                 ^~~~
      |                                 free
a.cc:40:33: error: 'amt' was not declared in this scope
   40 |                                 amt += comb[freq[l[0]]][i];
      |                                 ^~~
a.cc:43:34: error: 'amt' was not declared in this scope
   43 |                 printf("%lld\n", amt);
      |                                  ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll comb[55][55];

void init() {
	for(int i = 0; i <= 50; i++) {
		comb[i][0] = 1;
		comb[i][i] = 1;
		for(int j = 1; j < i; j++) {
			comb[i][j] = comb[i-1][j-1] + comb[i-1][j];
		}
	}
}

ll l[55];

int main() {
	init();
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	map<ll, int> dp;
	for(int i = 0; i < n; i++) {
		scanf("%lld", &l[i]);
		dp[l[i]]++;
	}
	sort(l, l+n);
	for(int i = 0; i < n-1-i; i++) {
		l[i] ^= l[n-1-i];
		l[n-1-i] ^= l[i];
		l[i] ^= l[n-1-i];		
	}
	if(l[0] == l[a-1]) {
		printf("%lld\n", l[0]);
		ll amt = 0;
		for(int i = a; i <= b; i++) {
			if(l[i-1] == l[0]) {
				amt += comb[dp[0]][i];
			}
		}
		printf("%lld\n", amt);
	}
	else {
		ll pref = 0;
		for(int i = 0; i < a; i++) pref += l[i];
		printf("%.9f\n", pref / (double)a);
		int use = 0;
		for(int i = 0; i < a; i++) if(l[i] == l[a-1]) use++;
		printf("%lld\n", comb[freq[l[a-1]]][use]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:39: error: 'freq' was not declared in this scope; did you mean 'free'?
   52 |                 printf("%lld\n", comb[freq[l[a-1]]][use]);
      |                                       ^~~~
      |                                       free
Language: C++

#include<iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include <iomanip>
#include<map>
#include <random>
#include<type_traits>
using namespace std;

long long int  combination(long long int n,long long int r)
{
	long long int i, a, b;
	long long int  c;
	if (r>n / 2) r = n - r;
	a = n;
	b = 1;
	c = 1L;
	for (i = 0; i< r; i++) {
		c = c * a / b;
		a--;
		b++;
	}
	return c;
}

int main() {

	long long int vec1[1000],N, A, B,y=0,Y=0;
	cin >> N >> A >> B;
	vector<long long int> vec(N);
	for (int i = 0; i < N; i++) {
		cin >> vec[i];
	}

	for (long long int i = 0; i < N; i++) {
		vec1[i] = 1;
	}
	long long int d=1;
	sort(vec.begin(), vec.end(), greater<long long int>());
	for (long long int i = 1; i < N; i++) {
		if (vec[i] == vec[i - 1]) {
			vec1[i] += vec1[i-1];
		}
	}

	for (int i = N-1; i>0; i--) {
		if (vec1[i-1] != 1)vec1[i-1] = vec1[i];
		else {
			vec1[i - 1] = vec1[i];
			i--;
		}
	}
	long double c;
	if (vec1[0] == N) {
		Y = vec[0] * A;
		for (long long int i = A - 1; i < B; i++) {
			y += combination(vec1[i], i - A + 2);
		}
	}
	else {
		for (long long int i = 0; i < A; i++) {
			if (i != 0) {
				if (vec[i] == vec[i - 1]) {
					d++;
				}
				else {
					d = 1;
				}
			}
				Y += vec[i];
		}

		y = combination(vec1[A - 1], d);

	}

	c = Y / long double(A);
		cout <<fixed <<setprecision(6)<<c<< endl;
		cout << y << endl;
		
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:17: error: expected primary-expression before 'long'
   83 |         c = Y / long double(A);
      |                 ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

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

int64_t comb[60][60];

int main() {

	rep(i, 55) {
		for (int j = 0; j <= i; j++) {
			if (j == 0 || j == i) {
				comb[i][j] = 1;
			} else {
				comb[i][j] = comb[i - 1][j - 1] + comb[i - 1][j];
			}
		}
	}

	int N, A, B; cin >> N >> A >> B;
	vector<int64_t> v(N);
	rep(i, N) cin >> v[i];
	sort(v.rbegin(), v.rend());
	printf("%.16f\n", std::accumulate(v.begin(), v.begin() + A, 0LL) / (double) A);

	int lidx = 0;
	for (int i = A - 1; i >= 0; i--) {
		if (v[i] > v[A - 1]) {
			lidx = i + 1;
			break;
		}
	}

	int ridx = N;
	REP(i, A, min(N, B + 1)) {
		if (v[A - 1] > v[i]) {
			ridx = i;
			break;
		}
	}

	int64_t sum = 0;
	auto CountTarget = ridx - lidx;
	if (v[A - 1] != v[0]) {
		assert(lidx == 0);
		cout << comb[CountTarget][A] << "\n";
	} else {
		REP(n, A, min(B, CountTarget) + 1) {
			sum += comb[CountTarget][n];
		}
		cout << sum << "\n";
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:50:17: error: 'assert' was not declared in this scope
   50 |                 assert(lidx == 0);
      |                 ^~~~~~
a.cc:5:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>'
    4 | #include <numeric>
  +++ |+#include <cassert>
    5 |
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vvd = vector<vd>;
using vl = vector<ll>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using vs = vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define LINF    	((ll)1ll<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI 3.1415926535897932384

template<class S, class T>ostream& operator<<(ostream&os, pair<S, T>p) { os << "[" << p.first << ", " << p.second << "]"; return os; };
template<class S>auto&operator<<(ostream&os, vector<S>t) { bool a = 1; for (auto s : t) { os << (a ? "" : " ") << s; a = 0; } return os; }


//int dx[]={1,1,1,0,-1,-1,-1,0},dy[8]={1,0,-1,-1,-1,0,1,1,1};
//
//constexpr ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
//

ll nCr[51][51];

void comb(int n) {
	rep(i, n+1) {
		rep(j, i + 1) {
			if (j == 0 || j == i) {
				nCr[i][j] = 1ll;
			}
			else {
				nCr[i][j] = nCr[i - 1][j - 1] + nCr[i - 1][j];
			}
		}
	}
}

int main() {
	//cin.tie(0); ios::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	comb(n);
	ll ans = 0;
	vector<double> v(n);
	vector<double> dp(n + 1, -1);
	dp[0] = 0;
	rep(i, n) {
		cin >> v[i];
	}
	sort(all(v),greater<ll>());
	ll sum = 0;
	rep(i, a) {
		sum += v[i];
	}
	fcout(10) << (sum / (double)a) << endl;
	if (v[0] == v[a - 1]) {
		int cntn = 0;
		rep(i, v.size()) {
			if (v[i] == v[a - 1]) cntn++;
		}
		rep(i, a, b + 1) {
			ans += nCr[cntn][i];
		}
		cout << ans << endl;
	}
	else {
		ll ans = 0;
		int pos = 0;
		int cntn = 0, cntr = 0;
		rep(i, v.size()) {
			if (v[i] == v[a - 1]) {
				cntn++;
				if (i < a)pos++;
			}
		}
		cout << nCr[cntn][pos] << endl;
	}
}

Compiler output:
a.cc:71:32: error: macro "rep" passed 3 arguments, but takes just 2
   71 |                 rep(i, a, b + 1) {
      |                                ^
a.cc:12:9: note: macro "rep" defined here
   12 | #define rep(i,n) range(i,0,n)
      |         ^~~
a.cc: In function 'int main()':
a.cc:71:17: error: 'rep' was not declared in this scope
   71 |                 rep(i, a, b + 1) {
      |                 ^~~
Language: C

#include<stdio.h>
int main(){
  long long int n,a,b,i,j,s=51,t=0;
  long long int v[50],temp,sum=0,cnt=1;
  scanf("%lld %lld %lld",&n,&a,&b);
  for(i=0;i<n;i++)
    scanf("%lld",&v[i]);
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      if(v[i]<v[j]){
        temp=v[i];
        v[i]=v[j];
        v[j]=temp;
      }
    }
  }
  for(i=0;i<a;i++)
    sum+=v[i];
  printf("%lf\n",(double)sum/(double)a);
  for(i=0;i<n;i++){
    if(s==51&&v[i]==v[a-1])
      s=i;
    if(v[i]==v[a-1])
      t=i;
  }
  sum=0;
  if(t==a-1)
    printf("1\n");
  else if(v[0]==v[a-1]){
    for(i=a;i<=b;i++){
      if(i<=t+1){
        cnt=1;
        for(j=0;j<i;j++){
          cnt*=(t+1-j);
          cnt/=j+1;
        }
        sum+=cnt;
      }
    }
    printf("%lld\n",sum);
  }
  else{
    for(j=s;j<a;j++){
      cnt*=(t+1-j);
      cnt/=(j-s+1);
    sum+=cnt;
    printf("%lld\n",sum);
  }
}

Compiler output:
main.c: In function 'main':
main.c:49:1: error: expected declaration or statement at end of input
   49 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <array>
#include <vector>
#include <utility>
#include <bitset>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

using ll = long long;
using p = pair<ll, ll>;
constexpr ll INF = 1e18;

ll C[51][51];

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

    ll N, A, B;
    cin >> N >> A >> B;

    vector<ll> V(N);
    for (auto&& v : V) {
        cin >> v;
    }

    sort(V.begin(), V.end(), greater<ll>());

    double ave = 0;
    double sum = 0;
    for (ll i = 0; i < A; i++) {
        sum += V[i];
    }
    ave = sum / A;
    for (ll i = A; i < B; i++) {
        sum += V[i];
        ave = max(ave, sum / (i + 1));
    }

    cout << setprecision(20) << ave << endl;

    for (ll i = 0; i <= N; i++) {
        for (ll j = 0; j <= i; j++) {
            if (j == 0 || j == i) {
                C[i][j] = 1LL;
            } else {
                C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]);
            }
        }
    }

    ll same = 1;
    for (ll i = 0; i < A - 1; i++) {
        if (V[i] == V[A - 1]) {
            same++;
        }
    }

    if (same == A) {
        ll Bp = 0;
        for (auto v : V) {
            if (v == V[A - 1]) {
                Bp++;
            }
        }
        ll ans = (1LL << Bp) - (1LL << (A - 1));
        cout << ans << endl;
    } else {
        ll r = same;
        ll n = 0;
        for (auto v : V) {
            if (v == V[A - 1]) {
                n++;
            }
        }

        cout << C[n][r] << endl;
    }

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:48:13: error: 'setprecision' was not declared in this scope
   48 |     cout << setprecision(20) << ave << endl;
      |             ^~~~~~~~~~~~
a.cc:14:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
   13 | #include <unordered_set>
  +++ |+#include <iomanip>
   14 |
Language: C++

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

int a[100], dp[100][100];
int calc(int l, int r, int n){
	int ans = 0;
	for(int i = l;i <= r;i++)ans += dp[n][i];
	return ans;
}

void init(){
	dp[0][0] = 1;
	for(int i = 1;i <= 51;i++){
		dp[i][0] = 1;
		for(int j = 1;j <= 51;j++)
		dp[i][j] = dp[i-1][j-1]+dp[i-1][j];
	}
}

signed main(){
	init();
	int n, l, r;
	scanf("%lld%lld%lld", &n, &l, &r);
	for(int i = 1;i <= n;i++)scanf("%lld", &a[i]);
	sort(a+1, a+n+1, greater<int>());
	
	int sum = 0, s1 = 0, s2 = 0;
	for(int i = 1;i <= n;i++){
		if(i <= l)sum += a[i];
		if(a[i] > a[l])s1++;
		if(a[i] == a[l])s2++;
	}
	
	printf("%lf\n", (double)sum/l);
	if(s1 == 0)printf("%lld\n", calc(l, r, s2));
	elseprintf("%lld\n", dp[s2][l-s1]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:9: error: 'elseprintf' was not declared in this scope; did you mean 'vswprintf'?
   37 |         elseprintf("%lld\n", dp[s2][l-s1]);
      |         ^~~~~~~~~~
      |         vswprintf
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define MOD 1000000007

ll C[51][51];

void comb_table(int N){
  for(int i=0;i<=N;i++){
    for(int j=0;j<=i;j++){
      if(j==0||j==i){
        C[i][j]=1LL;
      }else{
        C[i][j]=(C[i-1][j-1]+C[i-1][j]);
      }
    }
  }
}


int main(){
  comb_table(50);
  int n,a,b;
  cin>>n>>a>>b;
  vector<ll> v(n);
  for(int i=0;i<n;i++) cin>>v[i];
  sort(v.rbegin(),v.rend());
  ull sum=0;
  double ans=-1.0;
  for(int i=0;i<b;i++){
    sum+=v[i];
    if(i>=a-1){
      ans=max(ans, sum/(i+1.0));
    }
  }
  ull ans2=0;
  for(int i=b-1;i>a-2;i--){
    if(sum/(i+1.0)==ans){
      int x=count(v.begin(),v.end(), v[i]);
      if(x!=1){
        int count=0;
        for(int j=i;j>=0;j--){
          if(v[j]==v[i]) count++;
          else break;
        }
        ans2+=C[x][count];
      }else{
        ans2++;
      }
    }
    sum-=v[i];
  }
  cout<<precision(20);
  cout<<ans<<endl<<ans2<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:9: error: 'precision' was not declared in this scope
   54 |   cout<<precision(20);
      |         ^~~~~~~~~
Language: C++

#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
#define YES cout<<"YES"<<endl;
#define Yes cout<<"Yes"<<endl;
#define yes cout<<"yes"<<endl;
#define NO cout<<"NO"<<endl;
#define No cout<<"No"<<endl;
#define no cout<<"no"<<endl;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int,int> pi;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;

/*---------------------------------------------------*/

ull C[55][55];
void comb_table(int n){
  rep(i,n+1){
    rep(j,n+1){
      if(j==0||j==i)C[i][j]=(ull)1;
      else C[i][j]=C[i-1][j-1]+C[i-1][j];
    }
  }
}

int main(){
  int n,a,b;
  vll v;
  map<ull,int>imp,mp;
  cin>>n>>a>>b;
  comb_table(n);
  rep(i,n){
    ll in;
    cin>>in;
    v.pb(in);
    imp[in]++;
  }
  sort(all(v),greater<ll>());
  ll ave=0;
  rep(i,a){
    ave+=v[i];
  }
  int pos=0,max_pos=0;
  rep(i,n){
    if(v[i]==v[a-1]){
      pos++;
      if(i<a)max_pos++;
    }
  }
  ull cnt=0;
  if(v[0]==v[a-1]){
    REP(i,a,min(pos+1,b))cnt+=C[pos][i];
  }else{
    cnt+=C[pos][max_pos];
  }
  printf("%.10f\n",ave/(double)a);
  cout<<cnt<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:62:3: error: 'cin' was not declared in this scope
   62 |   cin>>n>>a>>b;
      |   ^~~
a.cc:18:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
   17 | #include <ctime>
  +++ |+#include <iostream>
   18 | #define INF 1000000000
a.cc:89:3: error: 'cout' was not declared in this scope
   89 |   cout<<cnt<<endl;
      |   ^~~~
a.cc:89:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:89:14: error: 'endl' was not declared in this scope
   89 |   cout<<cnt<<endl;
      |              ^~~~
a.cc:18:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
   17 | #include <ctime>
  +++ |+#include <ostream>
   18 | #define INF 1000000000
Language: C++

#include <algorithm>
#include <cctype>
#include <complex>
#include <iomanip>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::string;
using std::to_string;
using std::vector;
using std::set;
using std::queue;
using std::priority_queue;

using std::min;
using std::max;
using std::sort;
using std::abs;

typedef long long ll;

ll comb(ll n, ll r) {
    if(n <= r){
        return 1;
    }
    if(r == 0){
        return 1;
    }
    return comb(n - 1, r - 1) + comb(n - 1, r);
}

int main(void) {
    int n, a, b;
    cin >> n >> a >> b;

    vector<ll> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }

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

    vector<ll> acc(v);  // sum of [i, n)
    for (int i = n - 1; i > 0; i--) {
        acc[i - 1] += acc[i];
    }

    ll opt_num = -1;
    for (int i = a; i <= b; i++) {
        if (opt_num == -1 || acc[n - i] * opt_num > acc[n - opt_num] * i) {
            opt_num = i;
        }
    }

    cout << std::fixed << std::setprecision(8);
    cout << (1.0 * acc[n - opt_num] / opt_num) << endl;

    ll cnt = 0;
    for (int i = a; i <= b; i++) {
        if (acc[n - i] * opt_num != acc[n - opt_num] * i) {
            continue;
        }
        ll key = v[n - i];
        ll cntIn = 0;
        for (int j = n - i; j < n; j++) {
            if (v[j] == key) {
                cntIn++;
            }
        }

        ll cntOut = 0;
        for (int j = 0; j < n - i; j++) {
            if (v[j] == key) {
                cntOut++;
            }
        }
        cnt += comb(cntIn + cntOut, cntIn);
    }

    cout << cnt << endl;

    return 0;


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

#include <iostream>
#include <vector>

using namespace std;

long long combi[50][50];

long long combination(int n, int r) {
  if (n/2 < r) {
    r = n - r;
  }
  if (combi[n][r] != 0) return combi[n][r];
  if (n == r || r == 0) return 1;
  return combi[n][r] = combination(n-1, r) + combination(n-1, r-1);
}

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  vector<long long> v(N);
  for (int i = 0; i < N; i++)
    cin >> v[i];

  sort(v.begin(), v.end(), greater<int>());

  for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
      combi[i][j] = 0;

  int n1 = 0, n2 = 0;
  long long sum = 0;
  for (int i = 0; i < N; i++) {
    if (i < A) sum += v[i];
    if (v[i] == v[A-1]) n1++;
    else if (v[i] > v[A-1]) n2++;
  }

  double avg = (double)sum / A;
  long long num = 0;
  if (v[A-1] == v[0]) {
    for (int r = A - n2; r <= B && r <= n1; r++)
      num += combination(n1, r);
  } else {
    num = combination(n1, A - n2);
  }

  printf("%.6f\n%lld\n", avg, num);

  return 0;
}


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

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
ll c[51][51];
void comb_table(int n) {
  for (int i = 0; i <= n; i++) {
    c[i][0] = 1LL;
    c[i][i] = 1LL;
    for (int j = 1; j < i; j++) {
      c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
    }
  }
}
int main(void) {
  int n, a, b;
  cin >> n >> a >> b;
  vector<ll> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  sort(v.begin(), v.end(), greater<int>());
  double sum = 0.0;
  for (int i = 0; i < a; i++) {
    sum += v[i];
  }
  cout.precision(20);
  cout << sum / a << endl;
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; i < n; i++) {
    if (v[i] == v[a - 1]) {
      cnt1++;
      if (i < a) {
        cnt2++;
      }
    }
  }
  comb_table(n);
  ll ans = 0LL;
  if (cnt2 != a) {
    ans = c[cnt1][cnt2];
  } else {
    for (int i = a; i <= b; i++) {
      ans += c[cnt1][i];
    }
  }
  cout << ans << endl;
  return 0;
}

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

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

#define INF 900000000
#define LINF 9000000000000000000

typedef long long ll;
typedef pair<int, int> P;

int n, a, b;
ll v[50];
ll dp[51][51];

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

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

	for (int i = 0; i <= n-a; i++) {
		for (int j = 0; j < b; j++) {
			cout << i << ' ' << j << ' ' << dp[i][j+1] << ' ' << v[i+j] << endl;
			if (i+j >= n) break;
			dp[i][j+1] = max(dp[i][j+1], dp[i][j]+v[i+j]);
		}
	}

	for (int i = 0; i < n; i++) {
		for (int j = 1; j <= b; j++) {
			cout << dp[i][j] << ' ';
		}
		cout << endl;
	}

	double ans = 0;
	int cnt = 0;
	for (int i = a; i <= b; i++) {
		double avr = dp[n-a+1][i] / i;
		cout << "avr " << avr << " "
		if (ans == avr) cnt++;
		else if (ans < avr) {
			cnt = 1;
			ans = avr;
		}
	}

	printf("%.6f\n", ans);
	cout << cnt << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:45: error: expected ';' before 'if'
   43 |                 cout << "avr " << avr << " "
      |                                             ^
      |                                             ;
   44 |                 if (ans == avr) cnt++;
      |                 ~~                           
a.cc:45:17: error: 'else' without a previous 'if'
   45 |                 else if (ans < avr) {
      |                 ^~~~
Language: C++

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

//1
//1 1
//1 2 1
//1 3 3 1
//1 4 6 4 1
//
//aC0 = 1
//aCa = 1
//aCb = a-1Cb + a-1Cb-1
//2C1 = 1C1 + 1C0


int main(){
    int N, A, B;
    cin >> N >> A >> B;
    vector<long long> v(N);
    for(int i=0; i<N; i++) cin >> v[i];
    sort(v.begin(), v.end(), greater<long long>());
 
    long long ans = 0;
    for(int i=0; i<A; i++) ans += v[i];
    cout << static_cast<double>(ans) / A << endl;

    long long comb[100][100];
    for(int i=0; i<=50; i++){
        comb[i][0] = 1;
        comb[i][i] = 1;
    }
    for(int i=1; i<=50; i++)
        for(int j=1; j<i; j++)
            comb[i][j] = comb[i-1][j] + comb[i-1][j-1];

    int cnt1 = 0, cnt2 = 0;
    if(v[0] != v[A-1]){
        for(int i=0; i<A; i++)
            if(v[i] == v[A-1])
                cnt1++;
        for(int i=0; i<N; i++)
            if(v[i] == v[A-1])
                cnt2++;
        cout << comb[cnt2][cnt1] << endl;
        return 0;
    }else{
        for(int i=0; i<N; i++)
            if(v[i] == v[A-1])
                cnt2++;
        long long num = 0;
        for(int i=A; i<=B; i++)
            num += comb[cnt2][i];
        cout << num << endl;
        return 0;
    }
    return 0;
}

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

#include <cstdlib>
#include <cmath>
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <map>
#define MOD 1000000007
#define INF 1000000000
typedef long long ll;
using namespace std;
typedef pair<int,int> P;
//nCk
ll dp[51][51];
void comb(int N){
    for(int i=0;i<=N;i++){
        for(int j=0;j<=i;j++){
            if(j==0||j==i){
                dp[i][j]=1LL;
            }else{
                dp[i][j]=(dp[i-1][j-1]+dp[i-1][j]);
            }
        }
    }
}
ll cal(int n,int k){
    return dp[n][k];
}
int main(void){
    int n,a,b;
    cin>>n>>a>>b;
    ll v[51];
    map<ll,int>m;
    m.clear();
    for(int i=0;i<n;i++){
        cin>>v[i];
        m[v[i]]++;
    }
    sort(v,v+n,greater<int>());
    ll sum=v[0];
    ll pre=v[0];
    bool sev=false;
    vector<ll>num;
    num.push_back(v[0]);
    for(int i=1;i<a;i++){
        if(v[i]!=pre)sev=true;
        sum+=v[i];
        num.push_back(v[i]);
    }
    //求める平均値
    double ave=(double)sum/a;
    ll ans=0;
    comb(50);
    if(sev){
        //複数
        ans=1;
        for(int i=0;i<num.size();i++){
            ans*=m[num[i]];
        }
        
    }else{
        //1種類
        for(int i=a;i<=b;i++){
            ans+=cal(m[v[0]],i);
        }
        
    }
    printf("%.6lf\n",ave);
    cout<<ans<<endl;
    
    return 0;
}
　

Compiler output:
a.cc:77:1: error: extended character 　 is not valid in an identifier
   77 | 　
      | ^
a.cc:77:1: error: '\U00003000' does not name a type
   77 | 　
      | ^~
Language: C++

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

long long com[70][70]; //67以上でオーバーフロー
void init(int n) {
        for (int i = 0; i <= n; i ++) {
                for (int j = 0; j <= i; j ++) {
                        if (j == 0 || j == i) com[i][j] = 1LL;
                        else com[i][j] = com[i - 1][j - 1] + com[i - 1][j];
                } 
        }
}
long long nCr(int n, int r) { return com[n][r]; }

int main() {
        int n;
        init(66);
        cin >> n;
        long long a, b;
        cin >> a >> b;
        vector<long long> v(n);
        for (int i = 0; i < n; i ++) cin >> v[i];
        sort(all(v));
        reverse(all(v));
        long long sum = 0;
        long long mi;
        for (int i = 0; i < a; i ++) { 
                sum += v[i];
                if (i == a - 1) mi = v[i];
        }
        cout << setprecision(10) << (double)sum / (double)a << endl;
        bool can_add = true;
        for (int i = 0; i < a; i ++) if (v[i] != mi) can_add = false;
        int cnt_A = 0, cnt_B = 0, cnt_all = 0;
        for (int i = 0; i < a; i ++) if (v[i] == mi) cnt_A ++;
        for (int i = 0; i < b; i ++) if (v[i] == mi) cnt_B ++;
        for (int i = 0; i < n; i ++) if (v[i] == mi) cnt_all ++;
        long long ans = 0;
        for (int i = cnt_A; i <= (can_add ? cnt_B : cnt_A); i ++) ans += nCr(cnt_all, i);
        cout << ans << endl;
        return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:14: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   23 |         sort(all(v));
      |              ^~~
      |              std::filesystem::perms::all
In file included from /usr/include/c++/14/filesystem:51,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:200,
                 from a.cc:1:
/usr/include/c++/14/bits/fs_fwd.h:158:7: note: 'std::filesystem::perms::all' declared here
  158 |       all               =  0777,
      |       ^~~
Language: C

#include<stdio.h>
#include<math.h>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ABS(a) ((a)>0 ? (a):-(a))
#define ll long long
#define SWAP(a,b) {a+=b;b=a-b;a-=b;}

int main(){
	ll n,a,b,v[52];
	double ave = 0;
	ll numin = 0,numall = 0,num;

	scanf("%lld %lld %lld",&n,&a,&b);
	FOR(i,0,n) scanf("%lld",&v[i]);

	FOR(i,0,n-1){
		FOR(j,i+1,n)
		if(v[i] < v[j]) SWAP(v[i],v[j]);
	}

	FOR(i,0,a) ave += v[i];
	ave = ave/a;

	FOR(j,0,a) if(v[j] == v[a-1]) numin ++;
	FOR(j,0,n) if(v[j] == v[a-1]) numall ++;

	num = FACT(numall) / FACT(numin) / FACT(numall - numin);

	printf("%f %lld\n",ave,num);

}

Compiler output:
main.c: In function 'main':
main.c:27:15: error: implicit declaration of function 'FACT' [-Wimplicit-function-declaration]
   27 |         num = FACT(numall) / FACT(numin) / FACT(numall - numin);
      |               ^~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

using VI = vector<int>;
using VVI = vector<VI>;
using VB = vector<bool>;
using VVB = vector<VB>;
using VS = vector<string>;
using PII = pair<int, int>;
using VPII = vector<PII>;
using VL = vector<long long>;
using VVL = vector<VL>;

#define sz(var) (int)var.size()
#define REP(var, start, end) for(int var = start; var < (int)end; ++var)
#define CLEAR(var, with) memset(var, with, sizeof(var))
#define LL long long
#define ULL unsigned long long

// n개중에서 k 를 고르는 Combination table을 미리 세팅한다.
// C[n][k] -> nCk
ULL Comb[51][51];
void combination_table(int n)
{
    for(int i = 0; i <= n; ++i)
        for(int j = 0; j <= i; ++j)
        {
            if(j == 0 || j == i)
                Comb[i][j] = 1ll;
            else
                Comb[i][j] = Comb[i - 1][j - 1] + Comb[i - 1][j];
        }
}

LL cache[51][51];
LL bino2(int n, int r)
{
    if(r > n) return 0;
    if(r == 0 || n == r) return 1;

    int& ret = cache[n][r];
    if(ret != -1)
        return ret;
    return ret = (bino2(n - 1, r - 1) + bino2(n - 1, r));
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	//freopen("tmp.in", "r", stdin);
//	freopen("tmp.out", "w", stderr);
#endif
    int N, A, B;
    cin >> N >> A >> B;

    VL items(N, 0);
    REP(i, 0, N) cin >> items[i];

    combination_table(N);
    sort(items.begin(), items.end(), greater<LL>());

    double max_avg = (double)accumulate(items.begin(), items.begin() + A, 0ll) / A;
    
    int num = 0, pos = 0;
    REP(i, 0, N){
        if(items[i] == items[A - 1])
        {
            ++num;
            if(i < A)
                ++pos;   
        }
    }

    CLEAR(cache, -1);
    LL cnt = 0ll;
    if(pos == A)
    {
        for(int i = A; i <= B; ++i)
            cnt += bino2(num, i);
    }
    else
        cnt += bino2(num, pos);

    cout.precision(10);
    cout << fixed << max_avg << endl << cnt << endl;

	return 0;
}

Compiler output:
a.cc: In function 'long long int bino2(int, int)':
a.cc:42:26: error: cannot bind non-const lvalue reference of type 'int&' to a value of type 'long long int'
   42 |     int& ret = cache[n][r];
      |                ~~~~~~~~~~^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(double i=a;i<b;i++)

long long comb(int n, int i) {
	if (n - i < i) i = n - i;
	long long k = 1;
	for (int d = 1; d <= i; ++d) {
		k *= n--;
		k /= d;
	}
	return k;
}

int main() {
	double n, a, b;
	long long v[52], cnt = 0, key = 0;
	double avr = 0;
	cin >> n >> a >> b;
	rep(i, 0, n) {
		cin >> v[i];
	}
	sort(v,v+n);
	reverse(v,v+n);
	rep(i, 0, a) {
		avr += v[i];
	}
	avr /= a;

	rep(i, a, b+1) {
		double avr_b = 0;
		rep(j, 0, i) {
		avr_b += v[j];
		}
		avr_b /= i;
		//cout << i << endl;
		if (avr_b != avr)continue;
		key = v[i-1];
		//cout << key << " key" << endl;
		int keyp = find(begin(v), end(v), key) - v;
		//cout << keyp <<" keyp"<< endl;
		int min_exp = i - keyp;
		int min_count = count(v, v + n, key);
		//cout << min_exp<<" "<<min_count << endl;
		
		cnt += comb(min_count, min_exp);
		//cout << cnt << endl;
	}
	cout << avr << endl;
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:25: error: invalid types 'long long int [52][double]' for array subscript
   21 |                 cin >> v[i];
      |                         ^
a.cc:23:17: error: invalid operands of types 'long long int [52]' and 'double' to binary 'operator+'
   23 |         sort(v,v+n);
      |                ~^~
      |                | |
      |                | double
      |                long long int [52]
a.cc:24:20: error: invalid operands of types 'long long int [52]' and 'double' to binary 'operator+'
   24 |         reverse(v,v+n);
      |                   ~^~
      |                   | |
      |                   | double
      |                   long long int [52]
a.cc:26:25: error: invalid types 'long long int [52][double]' for array subscript
   26 |                 avr += v[i];
      |                         ^
a.cc:33:27: error: invalid types 'long long int [52][double]' for array subscript
   33 |                 avr_b += v[j];
      |                           ^
a.cc:38:24: error: invalid types 'long long int [52][double]' for array subscript
   38 |                 key = v[i-1];
      |                        ^
a.cc:43:44: error: invalid operands of types 'long long int [52]' and 'double' to binary 'operator+'
   43 |                 int min_count = count(v, v + n, key);
      |                                          ~ ^ ~
      |                                          |   |
      |                                          |   double
      |                                          long long int [52]
Language: C++

long long comb(int n, int i) {
	if (n - i < i) i = n - i;
	long long k = 1;
	for (int d = 1; d <= i; d++) {
		k *= n--;
		k /= d;
	}
	return k;
}

int main() {
	int n, a, b;
	long long v[52], cnt = 0,key=0;
	double avr = 0;
	cin >> n >> a >> b;
	rep(i, 0, n) {
		cin >> v[i];
	}
	sort(v,v+n);
	reverse(v,v+n);
	rep(i, 0, a) {
		avr += v[i];
	}
	avr /= a;

	rep(i, a, b+1) {
		double avr_b = 0;
		rep(j, 0, i) {
		avr_b += v[j];
		}
		avr_b /= i;
		if (avr_b != avr)continue;
		key = v[i-1];
		int keyp = find(begin(v), end(v), key) - v;
		//cout << keyp <<" key_first"<< endl;
		int min_count = count(v, v + n, key);
		int min_exp = i - keyp;
		//cout << min_exp<<" "<<min_count << endl;
		
		cnt += comb(min_count, min_exp);
		//cout << cnt << endl;
	}
	cout << avr << endl;
	cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'cin' was not declared in this scope
   15 |         cin >> n >> a >> b;
      |         ^~~
a.cc:16:13: error: 'i' was not declared in this scope
   16 |         rep(i, 0, n) {
      |             ^
a.cc:16:9: error: 'rep' was not declared in this scope
   16 |         rep(i, 0, n) {
      |         ^~~
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   19 |         sort(v,v+n);
      |         ^~~~
      |         short
a.cc:20:9: error: 'reverse' was not declared in this scope
   20 |         reverse(v,v+n);
      |         ^~~~~~~
a.cc:43:9: error: 'cout' was not declared in this scope
   43 |         cout << avr << endl;
      |         ^~~~
a.cc:43:24: error: 'endl' was not declared in this scope
   43 |         cout << avr << endl;
      |                        ^~~~
Language: Java



import java.math.BigInteger;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main_1 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		int MIN = sc.nextInt();
		int MAX = sc.nextInt();

		BigInteger[][] combo_table = new BigInteger[N+1][N+1];
		setConbTable(combo_table);

		BigInteger[] values = new BigInteger[N];


		for(int i = 0;i < N;i++){
			values[i] = sc.nextBigInteger();
		}

		Arrays.sort(values, new Comparator<BigInteger>() {
			public int compare(BigInteger x,BigInteger y){
				return Integer.valueOf(y.subtract(x).toString());
			}
		});

		BigInteger sum = BigInteger.ZERO;

		for(int i = 0;i < MIN;i++){
			sum = sum.add(values[i]);
		}

		System.out.println(String.format("%f", sum.doubleValue() / MIN));
		BigInteger pattern_count = BigInteger.ZERO;

		if(values[0].equals(values[MIN - 1])){
			int min_value_count = MIN;
			for(int i = MIN;i < MAX;i++){
				if(!values[0].equals(values[i]))break;
				min_value_count++;
			}

			for(int i = MIN;i <= MAX;i++){
//				System.out.println("min : " + min_value_count + ", i : " + i);
				if(!values[i - 1].equals(values[0]))break;
				pattern_count = pattern_count.add(combo_table[min_value_count][i]);
			}
		}else{
			int min_value_count = 0;
			int inner_count = 0;
			for(int i = MIN - 1;0 <= i;i--){
				if(!values[MIN - 1].equals(values[i]))break;
				min_value_count++;
				inner_count++;
			}

			for(int i = MIN; i < N;i++){
				if(!values[MIN - 1].equals(values[i]))break;
				min_value_count++;
			}
			pattern_count = pattern_count.add(combo_table[min_value_count][inner_count]);
		}
		System.out.println(pattern_count);

		sc.close();
	}


	static BigInteger factrial(BigInteger num){
		if(num.compareTo(BigInteger.ONE) < 0)return BigInteger.ONE;

		return num.multiply(factrial(num.subtract(BigInteger.ONE)));
	}

	static void setConbTable(BigInteger[][]table){
		for(int i = 0;i < table.length;i++){
			for(int j = 0;j <= i; j++){
				if(j == 0 || j == i){
					table[i][j] = BigInteger.ONE;
				}else{
					table[i][j] = table[i-1][j-1].add(table[i-1][j]);
				}
			}
		}
	}
}


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

#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long int long long int;
#define MOD (1e9+7);
#define INF (2e9)

long long int c(int x, int y) {//xCyを返す関数
    long long int a = 1;
    for (int i = 1; i<=y; i++) {
        a *= x+1-i;//x,x-1,・・・,x-y+1 がaにかけられる
        a/=i;//1,2,・・・,y　をaから割る
    }
    return a;
}

int main(void) {
    int n, a, b;
    cin >> n >> a >> b;
    long long int *v = new long long int[n];
    for (int i = 0; i<n; i++) {
        cin >> v[i];
    }


    sort(v, v + n);
    reverse(v, v + n);

    long long int min = v[a-1];
    //min = 価値平均が最大となるように選んだ品物のうち、
    //     一番価値の低いものの価値　　→

    long long int ans = 0;//答え（場合の数）
    double ans_max=0;//答え（最大値）

    if (v[0] == min) {//A番目まですべて同じ価値なら
        ans_max=min;// 答え
        int i;
        for (i = 0; i<n; i++) {
            if (v[i] != min) {//{min,min,・・・,min,no,・・・} ならばnoを指して止まる
                break;
            }
        }
        //i = min と同じ価値の品物の個数
        while (a <= b && a <= i) {//i個のうちa個選ぶ、a+1個選ぶ、・・・・、min(b,i)個選ぶ
            ans += c(i, a);
            a++;
        }
    }
    else {
        for(int k=0;k<a;k++){//A番目までの商品の平均値
            ans_max+=v[k];
        }
        ans_max/=a;

        int minp, minm;
        for (minp = a-1; v[minp] == min && minp<n; minp++) {}//minより小さい値を見つけたらstop
        for (minm = a-1; v[minm] == min &&minm >= 0; minm--) {}
        int kosu = minp - minm - 1;
        a -= n - minp;
        ans = c(kosu, a);

        
    }
    cout << ans_maxp<<"\n"<<ans << "\n";
    return 0;
}

Compiler output:
a.cc:5:23: error: 'long long long' is too long for GCC
    5 | typedef long long int long long int;
      |                       ^~~~
a.cc:5:28: error: 'long long long' is too long for GCC
    5 | typedef long long int long long int;
      |                            ^~~~
a.cc:5:19: error: multiple types in one declaration
    5 | typedef long long int long long int;
      |                   ^~~
a.cc:5:33: error: declaration does not declare anything [-fpermissive]
    5 | typedef long long int long long int;
      |                                 ^~~
a.cc: In function 'int main()':
a.cc:66:13: error: 'ans_maxp' was not declared in this scope; did you mean 'ans_max'?
   66 |     cout << ans_maxp<<"\n"<<ans << "\n";
      |             ^~~~~~~~
      |             ans_max
Language: Java

import java.math.BigInteger;
import java.lang.Object;
import java.util.Scanner;
import java.util.Arrays;
import java.util.Collections;

public class d {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int l = sc.nextInt();
		int r = sc.nextInt();

		Long[] a = new Long[n];

		for (int i = 0; i < n; i++) {
			a[i] = new Long(sc.nextLong());
		}

		Arrays.sort(a);
		Collections.reverse(Arrays.asList(a));

		BigInteger c[][] = new BigInteger[60][60];
		for (int i = 0; i < 60; i++) {
			for (int j = 0; j < 60; j++) {
				c[i][j] = BigInteger.ZERO;
			}
		}
		c[0][0] = BigInteger.ONE;
		for (int i = 0; i < 59; i++) {
			for (int j = 0; j < 59; j++) {
				c[i + 1][j] = c[i + 1][j].add(c[i][j]);
				c[i + 1][j + 1] = c[i + 1][j + 1].add(c[i][j]);
			}
		}

		int x = l;
		int y = l;

		while (x > 0 && a[x-1].equals(a[x])) x--;
		while (y + 1 < n && a[y+1].equals(a[y])) y++;

		BigInteger cnt = BigInteger.ZERO;

		int all = y - x + 1;

		if (x == 0) {
			for (int i = l; i <= r; i++) {
				cnt = cnt.add(c[all][i]);
			}
		} else {
			cnt = c[all][l-x+1];
		}

		long sum = 0;
		for (int i = 0; i < l; i++) {
			sum += a[i];
		}
		System.out.format("%.10f\n", (double) sum / l);
		System.out.println(cnt);
	}
}


Compiler output:
Main.java:7: error: class d is public, should be declared in a file named d.java
public class d {
       ^
Main.java:18: warning: [removal] Long(long) in Long has been deprecated and marked for removal
			a[i] = new Long(sc.nextLong());
			       ^
1 error
1 warning