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

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

using namespace std;

long long comb(int n, int k) {
    long long s1 = 1, s2 = 1;
    for (i = (n-k+1); i <= n; i++)
        s1 *= i;
    for (i = 1; i <= k; i++)
        s2 *= i;

    return s1/s2;
}

int main()
{
    int N, A, B;
    long long t, ans = 0;
    int X, Y;
    vector<long long> v(51);

    cin >> N >> A >> B;

    for(int i = 0; i < N; i++)
        cin >> v[i];

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

    t = v[A-1];

    X = count(v.begin(), v.end(), t);
    Y = count(v.begin(), v.begin()+A, t);

    if (v[0] != v[A-1])
        ans = comb(X, Y);
    else {
        for (int i = A; i <= B; i++) {
            if (i <= X)
                ans += comb(X, i);
        }
    }

    cout << setprecision(10) << (accumulate(v.begin(), v.begin()+A, 0.0)) / A << endl;
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'long long int comb(int, int)':
a.cc:11:10: error: 'i' was not declared in this scope
   11 |     for (i = (n-k+1); i <= n; i++)
      |          ^
a.cc:13:10: error: 'i' was not declared in this scope
   13 |     for (i = 1; i <= k; i++)
      |          ^
Language: C++

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

using namespace std;

long long comb(n, k) {
    long long s1 = 1, s2 = 1;
    for (i = (n-k+1); i <= n; i++)
        s1 *= i;
    for (i = 1; i <= k; i++)
        s2 *= i;

    return s1/s2;
}

int main()
{
    int N, A, B;
    long long t, ans = 0;
    int X, Y;
    vector<long long> v(51);

    cin >> N >> A >> B;

    for(int i = 0; i < N; i++)
        cin >> v[i];

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

    t = v[A-1];

    X = count(v.begin(), v.end(), t);
    Y = count(v.begin(), v.begin()+A, t);

    if (v[0] != v[A-1])
        ans = comb(X, Y);
    else {
        for (int i = A; i <= B; i++) {
            if (i <= X)
                ans += comb(X, i);
        }
    }

    cout << setprecision(10) << (accumulate(v.begin(), v.begin()+A, 0.0)) / A << endl;
    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc:9:16: error: 'n' was not declared in this scope
    9 | long long comb(n, k) {
      |                ^
a.cc:9:19: error: 'k' was not declared in this scope
    9 | long long comb(n, k) {
      |                   ^
a.cc:9:20: error: expression list treated as compound expression in initializer [-fpermissive]
    9 | long long comb(n, k) {
      |                    ^
a.cc: In function 'int main()':
a.cc:40:19: error: 'comb' cannot be used as a function
   40 |         ans = comb(X, Y);
      |               ~~~~^~~~~~
a.cc:44:28: error: 'comb' cannot be used as a function
   44 |                 ans += comb(X, i);
      |                        ~~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <unordered_map>
#include <map>

using namespace std;

#define ull unsigned long long

ull pow(ull a, ull e){
    ull tmp = 1;
    while(e > 0){
        if( e & 1ll){
            tmp = tmp * a;
        }
        a = a * a;
        e >>= 1; 
    }
    return tmp;
}

class Conbination
{
public:
	int size;
	vector<vector<long long> > nck;
	Conbination(int n);
	~Conbination();
	void setnCk();
	long long fetchnCk(int n, int k);
};

Conbination::Conbination(int n){
	this->size = n;
	setnCk();
}

Conbination::~Conbination(){}

void Conbination::setnCk(){
	vector<long long> start;
	start.push_back(1.0);
	nck.push_back(start);

	for (int i = 0; i <= size; ++i)
	{
		vector<long long> next;
		for (int j = 0; j <= i+1; ++j)
		{
			next.push_back(0);
		}

		for (int j = 0; j < i+1; ++j)
		{
			next[j] += nck[i][j];
			next[j+1] += nck[i][j];
		}
		nck.push_back(next);
	}
}

long long  Conbination::fetchnCk(int n, int k){
	return nck[n][k];
}


class MaximumAverageSets
{
public:
	int n;
	int a;
	int b;
	vector<double> v;
	map<int, int> hash;
	MaximumAverageSets(){
		cin >> n >> a >> b;
		for (int i = 0; i < n; ++i)
		{
			double tmp;
			cin >> tmp;
			v.push_back(tmp);
			hash[tmp]++;
		}

	}

	void exec(){
		double sum = 0;
		sort(v.begin(), v.end(), greater<int>());
		for (int i = 0; i < a; ++i)
		{
			sum += v[i]; 
		}


		double ave  = sum / (a * 1.0);
		printf("%.10f\n", ave);

		int cnt = n - hash[v[a-1]] > 0 ? n - hash[v[a-1]] : n;
		Conbination c = Conbination(hash[v[a-1]]);
		long long ans = 0;
		for (int i = 0; i < b; ++i)
		{
			ans += c.fetchnCk(hash[v[a-1]], cnt + i)
			if(v[a] != v[i]) break;
		}
		cout << ans << endl;
	}

};

int main(){
	MaximumAverageSets mas = MaximumAverageSets();
	mas.exec();
}


Compiler output:
a.cc: In member function 'void MaximumAverageSets::exec()':
a.cc:107:25: error: expected ';' before 'if'
  107 |                         if(v[a] != v[i]) break;
      |                         ^~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;

using ll = long long;

ll arr[60];

ll memo[60][60] = {};

// a C b
ll combi(ll a,ll b){
    
    if(!memo[0][0]){
        for(int i = 0; i < 60; i++){
            for(int j = 0; j < 60; j++){
                if(i == 0 || j == 0){
                    memo[i][j] = 1;
                }else{
                    memo[i][j] = memo[i-1][j] + memo[i][j-1];
                }
            }
        }
    }
    
    return memo[a-b][b];
    
    
}




int main(void){
    // Here your code !
    
    int n,a,b;
    
    map<ll,ll> number;
    
    cin >> n >> a >> b;
    
    for(int i = 0; i < n; i++){
        cin >> arr[i];
        number[arr[i]]++;
    } 
    
    sort(arr,arr+n);
    
    double Max = 0;
    
    for(int i = a; i <= b; i++){
        ll total = 0;
        for(int j = n - 1; j >= n-i; j--){
            total += arr[j];
        }
        Max = max((double)total/i,Max);
    }
    
    printf("%.7lf\n",Max);
    
    ll res = 0;
    
    for(int i = a; i <= b; i++){
        ll tmp = 0,total = 0;
        for(int k = n-i; k < n; k++){
            if(arr[n-i] == arr[k]){
                tmp++;
            }
            total += arr[k];
        }
        
        if(fabsl((double)total/i - Max ) < 0.0000001)
            res += combi(max(number[arr[n-1-i]] ,tmp), min(number[arr[n-1-i]] ,tmp));
    }
    
    cout << res << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:12: error: 'fabsl' was not declared in this scope
   76 |         if(fabsl((double)total/i - Max ) < 0.0000001)
      |            ^~~~~
Language: C++

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

#define int long long

int n,a,b,v[51];

int 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]);
      }
    }
  }
}
signed main(){
  cin>>n>>a>>b;
  for(int i=0;i<n;i++){
    cin>>v[i];
  }

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

  double temp=0;
  for(int i=0;i<a;i++){
    temp+=v[i];
  }
  cout<<fixed<<setprecision(10)<<temp/a<<endl;

  int ans=0;
  int x=0;
  if(v[a-1]==v[0]){
    for(int i=0;i<n;i++){
      if(v[i]==v[0])
      x++;
    }
    for(int i=a;i<=b;i++){
      ans+=C[x][i]
    }
    cout<<ans<<endl;
    return 0;
  }

  int a_num=0;
  for(int i=0;i<n;i++){
    if(v[a-1]==v[i])a_num++;
  }
  int a_num2=0;
  for(int i=0;i<a;i++){
    if(v[a-1]==v[i])a_num2++;
  }

  ans=C[a_num][a_num2];
  cout<<ans<<endl;


}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:19: error: expected ';' before '}' token
   44 |       ans+=C[x][i]
      |                   ^
      |                   ;
   45 |     }
      |     ~
Language: C++

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

typedef long long ll;
int N, A, B;
ll v[55];
// 組み合わせテーブル
ll C[55][55];  // C[n][k] => nCk

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

int main() {
  // 入力
  cin >> N >> A >> B;
  for (int i=0; i<N; i++) cin >> v[i];
  // A<=x<=Bの範囲においての価値の平均は、vを降順にソートした後に前からA個選んだ時が最大
  sort(v, v+N);
  reverse(v, v+N);
  ll sum = 0;
  double avg;
  for (int i=0; i<A; i++) sum += v[i];
  avg = (double)sum / A;
  // 1行目に平均の最大値を出力
  printf("%.6f\n", avg);
  // 平均が最大となるような品物の選び方の数を求める
  comb_table(N);  // 組み合わせテーブルを前処理で求めておく
  int anum_equal_cnt, apos_below_cnt;
  anum_equal_cnt = apos_below_cnt = 0;
  for (int i=0; i<N; i++) {
    if (v[i] == v[A-1]) {
      anum_equal_cnt++;
      if (i < A) {
        apos_below_cnt++;
      }
    }
  }
  ll cnt = 0;
  if (apos_below_cnt == A) {
    for (; apos_below_cnt<=B; apos_below_cnt++) {
      cnt += C[anum_equal_cnt][apos_below_cnt];
    }
  } else {
    cnt += C[anum_equal_cnt][apos_below_cnt];
  }
  // 2行目に平均が最大となるような品物の選び方の数を出力
  cout << cnt << endl;
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll n, a, b;
vector<ll> v;


ll comb(ll n, ll m){
 ll ret = 1;
 for(ll i=1;i<=m;i++) ret = ret * (n-m+i) / i;
 return ret;
}

int main(void){
 cin >> n >> a >> b;
 for(int i=0;i<n;i++) {ll tmp; cin >> tmp; v.push_back(-tmp);}
 sort(v.begin(), v.end());
 ll thesum = 0;
 for(int i=0;i<a;i++) thesum += (-v[i]);
 printf("%.7f\n",((double)(thesum)) / a);
 ll ans = 0; 
 if (v[0]==v[a-1]){
  int i;
  for(i=a-1;i<n;i++) if (v[0] != v[i]) break;
  int m = i;
  for(int i=a;i<=min(m,b);i++) ans += comb(m,i);
 }else{
  int mi, ma;
  for(mi=0;mi<n;mi++) if (v[mi]==v[a-1]) break;
  for(ma=a-1;ma<n;ma++) if (v[ma]!=v[a-1]) break;
  int m = ma - mi;
  ans += comb(m, a-mi);
 }
 cout << ans << endl;
 return 0;
}

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

#include <iostream>
using namespace std;;
using ll=long long;
// combination table
ll C[51][51];  //C[n][k] -> nCk


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

int main(){
    // input
    int N, A, B;
    cin >> N >> A >> B;

    const int NMAX=50;
    ll v[NMAX];

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

    comb_table(N);
    sort(v, v+N);
    reverse(v,v+N);

    double max_average=0.0;
    for(int i=0; i<A; i++){
        max_average+=v[i];
    }
    max_average/=A;

    int a_th_val_num=0, a_th_val_pos=0;
    for(int i=0; i<N; i++){
        if(v[i]==v[A-1]){
            a_th_val_num++;
            if(i<A){
                a_th_val_pos++;
            }
        }
    }

    ll cnt=0LL;
    if(a_th_val_pos==A){
        for(a_th_val_pos=A; a_th_val_pos<=B; ++a_th_val_pos){
            cnt+=C[a_th_val_num][a_th_val_pos];
        }
    }else{
        cnt+=C[a_th_val_num][a_th_val_pos];
    }

    cout.precision(20);
    cout << fixed << max_average << endl;
    cout << cnt << endl;

    return 0;
}

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

#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<bitset>
#include<sstream>
#include<list>
#include<climits>
 
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define nrep(i,i0,n) for(int i=(i0);i<(int)(n);++i)
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vii;
typedef long long ll;
 
ll comb[51][51];
 
void com(int n){
	rep(i,n+1){
		rep(j,i+1){
			if(j==0||j==i){
				comb[i][j]=1LL;
			}
			else comb[i][j]=comb[i-1][j-1]+comb[i-1][j];
		}
	}
}
 
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,a,b;cin>>n>>a>>b;
	vector<ll> v;
	com(n);
	rep(i,n){
		ll t;cin>>t;
		v.push_back(t);
	}
	sort(v.begin(),v.end(),greater<ll>());
	double sum=0.0;
	rep(i,a)sum+=v[i];
	sum/=a;
	int x=0,y=0;
	rep(i,n){
		if(v[i]==v[a-1]){
			x++;
			if(i<a)y++;
		}
	}
	ll ret=0LL;
	if(v[0]==v[a-1]){
		nrep(i,a,b+1){
			ret+=comb[x][i];
		}
	}
	else{
		ret+=comb[x][y];
	}
prinf("%.7f\n%lld\n",sum,ret);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:70:1: error: 'prinf' was not declared in this scope; did you mean 'printf'?
   70 | prinf("%.7f\n%lld\n",sum,ret);
      | ^~~~~
      | printf
Language: C++

#include <iostream>

using namespace std;
using ll=long long;
using R=double;

// Combination Table
ll C[51][51]; // C[n][k] -> nCk

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

int main(void){
int N,A,B;
cin >> N >> A >> B;
const int NMAX=50;
ll v[NMAX];

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

comb_table(N);
sort(v,v+N);
reverse(v,v+N);

R max_average=0.0;
for(int i=0;i<A;++i){
max_average+=v[i];
}
max_average/=A;

int a_th_val_num=0,a_th_val_pos=0;
for(int i=0;i<N;++i){
if(v[i]==v[A-1]){
a_th_val_num++;
if(i<A){
a_th_val_pos++;
}
}
}

ll cnt=0LL;
if(a_th_val_pos==A){
for(a_th_val_pos=A;a_th_val_pos<=B;++a_th_val_pos){
cnt+=C[a_th_val_num][a_th_val_pos];
}
}else{
cnt+=C[a_th_val_num][a_th_val_pos];
}

cout.precision(20);
cout << fixed << max_average << endl;
cout << cnt << endl;

return 0;
}

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

#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<map>
#include<list>
#include<stack>
#include<queue>
#include<set>
#include<climits> //INT_MIN/MAX
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define FOR(i,s,e) for(ll (i)=(s);(i)<(e);(i)++)
#define FORR(i,s,e) for(ll (i)=(s);(i)>(e);(i)--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define mp make_pair
#define pb push_back
const ll MOD = 1000000007;
const int INF = 1e9;
const ll LINF = 1e16;
const double PI = acos(-1.0);
int dx[8] = { 0,0,1,-1,1,1,-1,-1 };
int dy[8] = { 1,-1,0,0,1,-1,1,-1 };

/* -----  xtimex  Problem: ABC 0 ABCD / Link:  ----- */
/* ------蝠城｡---



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

ll N, A, B;
ll v[60];
ll ans = 0;
ll comb[100][100];

double ave = 0;

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

    cin >> N >> A >> B;
    FOR(i, 0, N) {
        cin >> v[i];
    }


    for (int i = 0; i <= 60; i++) {
        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];
        }
    }


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

    if (v[0] != v[A - 1]) {
        int cnt = 0, ne = 0;
        FOR(i, 0, N) {
            if (v[A - 1] == v[i]) {
                cnt++;
                if (i < A) {
                    ne++;
                }
            }
            if (i < A)ave += v[i];
        }
        //debug(cnt);
        ave /= A;
        ans = comb[cnt][ne];
    }
    else if (v[0] == v[A - 1]) {
        int cnt = 0;
        FOR(i, 0, N) {
            if (v[0] == v[i])cnt++;
        }
        ave = v[0];
        FOR(i, A, B + 1) {
            if (v[0] == v[i - 1]) {
                ans += comb[cnt][i - 1];
            }
        }

    }

    printf("%.10f\n", ave);
    cout << ans << endl;
    return 0;
}


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

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define pi pair<ll,ll>
using namespace std;
int main(){
	// freopen("in.txt","r",stdin);
	int N,A,B;
	long long v[51];
	cin >> N >> A >> B;
	for (int i = 0; i < N; ++i)
	{
		scanf("%lld",&v[i]);
	}
	sort(v,v+N,greater<int>());

	bool flag = true;
	long long SUM = v[0];
	for (int i = 1; i < A; ++i)
	{
		SUM += v[i];
		if((double)SUM/i > v[i]){
			flag = false;
		}
	}
	int j;
	for (j = A; j < B; ++j)
	{
		if((double)SUM/j > v[j]){
			flag = false;
			break;
		}else{
			SUM += v[j];
		}
	}
	int count = 1;
	int k = j-1;
	while(k>0&&v[k]==v[k-1]){
		count++;k--;
	}
	k = j-1;
	while(k<B&&v[k]==v[k+1]){
		count++;k++;
	}
	long long ans;
	if(flag) {
		int ta = A;long long tn = 1;
		while(ta>0){
			tn *= ta;
			ta--;
		}

		ans = pow(2,count)-tn;
	}
	else ans = count;
	cout <<SUM <<":" << j<< endl;
	printf("%f\n",(double)SUM/j);
	printf("%lld\n",ans);
	return 0;
}

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


#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;

ll fun(int x)
{
    ll ans=1;
    for(int i=1;i<=x;i++)
        ans*=i;
    return ans;
}

ll fun1(int x,int y)
{
ll ans=1;
    for(int i=x;y--;i--)
        ans*=i;
    return ans;
}

ll s[100];
int main()
{
//    cout<<fun1(10,4)+fun1(10,5)<<endl;
   ll n;
   while(cin>>n)
   {
   ll a,b;
   cin>>a>>b;
   for(int i=0;i<n;i++)
    cin>>s[i];


   sort(s,s+n);

   int maxn=s[n-1];
   int ans=1;

ll sum=0;
  for(int i=n-1;i>n-a-1;i--)
  {
      sum+=s[i];
  }
  cout<<sum/(double)a<<endl;
  printf("%.6lf",sum/(double)a);
  cout<<endl;



 int len=n-(lower_bound(s,s+n,s[n-a])-s);
 int len1=n-(upper_bound(s,s+n,s[n-a])-s);

int ttt=len-len1;


int biaoji=n-(lower_bound(s,s+n,s[n-1])-s);



if(biaoji<a)
{

 printf("%.6lf\n",fun1(ttt,a-len1)/fun(a-len1));
cout<<fun1(ttt,a-len1)/fun(a-len1)<<endl;
}
else if(biaoji==a) {printf("%.6lf\n",s[n-1]); cout<<1<<endl;}

else if(biaoji>a&&biaoji<b)
{
    ll ss=0;
   for(int i=a;i<=biaoji;i++)
    ss+=fun1(biaoji,i)/fun(i);
    printf("%.6lf\n",s[n-1])
   cout<<ss<<endl;
}
else if(biaoji>=b)
{
       ll ss=0;
   for(int i=a;i<=b;i++)
    ss+=fun1(biaoji,i)/fun(i);
    printf("%.6lf\n",s[n-1])
      cout<<ss<<endl;
}
   }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:74:29: error: expected ';' before 'cout'
   74 |     printf("%.6lf\n",s[n-1])
      |                             ^
      |                             ;
   75 |    cout<<ss<<endl;
      |    ~~~~                      
a.cc:82:29: error: expected ';' before 'cout'
   82 |     printf("%.6lf\n",s[n-1])
      |                             ^
      |                             ;
   83 |       cout<<ss<<endl;
      |       ~~~~
Language: C++

#include <stdio.h>
#include <math.h>

int main(void){
	int N, A, B, i, j, k, x = 1, y = 0;
	scanf("%d %d %d", &N, &A, &B);
	double v[N], S = 0, max_v;
	for(i = 0; i < N; i++){
		scanf("%lf", &v[i]);
			
	}

	for(i = 0; i < N; i++){
		max_v = v[i];
		for(j = i; j < N; j++){
			if(max_v < v[j]){
				max_v = v[j];
				k = j;
			}
		}
		v[k] = v[i];
		v[i] = max_v;
	}

	for(i = 0; i < A; i++){
		S += v[i];
	}
	printf("%lf\n", S/A);
	i = 0;
	while(v[A-1]==v[A+i]){
		printf("i%d\n", i);
		i++;
	}
	
	if(S/A == v[A-1]){
		k = 0;
		for(j = 0; j < B-A; j++)
			for(k = 1; k <= A+j; k++){
				x *= (A+i-k-1);
			}
			for(k = 1; k <= A+j; k++){
				x /= k;
			}
			y += x;
		}
	}else{
		printf("%d\n", i+1);
	}
	scanf("%d", &N);

 	return 0;
}

Compiler output:
a.cc:46:10: error: expected unqualified-id before 'else'
   46 |         }else{
      |          ^~~~
a.cc:49:14: error: expected constructor, destructor, or type conversion before '(' token
   49 |         scanf("%d", &N);
      |              ^
a.cc:51:9: error: expected unqualified-id before 'return'
   51 |         return 0;
      |         ^~~~~~
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

#include<cstdio>
#include<vector>
#define intq vector<double>
#define intqq vector<int>
#define FOR(i, a, b) for((i)=(a);(i)<(b);(i)++)
#define N (1e+15)

using namespace std;

double fac(double n) {
  double r = 1;
  double i;
  for(i=0;i<n;r *= ++i) {
  }
  return r;
}

double com(double n, int k) {
  double i;
  double c;
  c = 1;
  for(i=0;i<k;i++) {
    c *= n - i;
  }

  for(i=0;i<k;i++) {
    c /= i + 1;
  }
  return c;
}

int main(void) {
  int n;
  intq v;
  int a, b;
  scanf("%d %d %d", &n, &a, &b);
  int i;
  FOR(i, 0, n) {
    double c;
    scanf("%lf", &c);
    v.push_back(c);
  }

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

  double s = 0.0;
  double av;
  int c, d;
  c = 1;
  d = 1;
  double p;
  intqq t;

  for(i=n-1;i-n+a+1;i--) {
    s += v[i];
    if(n-1-i){
      double q;
      q = v[i];
      if(p == q) {
        c++;
        d++;
      } else {
        if(c-1){
          c = 1;
          d = 1;
          t.push_back(c);
        }
      }
    }
    printf("c = %d, d = %d\n", c, d);
    p = v[i];
  }
  double r;
  r = s / a;

  int j;
  for(j=i++;v[j] == v[i];j--) {
    c++;
  }


  t.push_back(c);

  int u;
  u = t.size();

  double w = 1;
  for(i=0;i<u-1;i++) {
    w *= fac(t[i]);
  }

  double x = 0;
  for(j=0;j<b-a+1;j++){
    x += com(t[i], d + j);
  }
  w += x;

  printf("%lf\n%lf\n", r, w);




  return 0;
}

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

#include <iostream>
#include <vector>

using ll = long long;

using namespace std;


ll nChoosek(ll n, ll k )
{
    if (k > n) return 0;
    if (k * 2 > n) k = n-k;
    if (k == 0) return 1;

    int result = n;
    for( int i = 2; i <= k; ++i ) {
        result *= (n-i+1);
        result /= i;
    }
    return result;
}

int main()
{
  int N, A, B;
  vector<ll> v(60);

  cin >> N >> A >> B;
  for (int i = 0; i < N; i++) {
    cin >> v[i];
  }

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

  long double a1 = 0;
  for (int i = 0; i < A; i++) {
    a1 += v[i];
  }

  cout << a1 / (long double)A << endl;

  ll m = v[A - 1];
  int i_min, i_max;
  for (int i = 0; i < A; i++) {
    if (v[i] == m) {
      i_min = i;
      break;
    }
  }

  for (int i = A; i < B; i++) {
    if (i == B - 1) {
      i_max = i;
      break;
    }
    
    if (v[i] != m) {
      i_max = i - 1;
      break;
    }
  }

  ll num = i_max - i_min + 1;

  ll ans = 0;
  for (ll i = A - i_min + 1; i <= num; i++) {
    ans += nChoosek(num, i);
  }


  cout << i_min << ' ' <<  i_max << ' ' << num << endl;
  cout << ans << endl;

  return 0;
}


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

using namespace std;

int a,b,n,i,j,k,c[51],d[51],e[51];
float avg;
long long int cnt;

long long int fac(int n) {
	int i;
	long long int c = 1;
	for (i = 1;i <= n;i++) {
		c *= i;
	}
	return c;
}

int main() {
	scanf("%d%d%d",&n,&a,&b);
    for (i = 1;i <= n;i++) {
    	scanf("%d",&c[i]);
    }
    sort(c+1,c+n+1);
    reverse(c+1,c+n+1);
    k = 0;
    for (i = 1;i <= a;i++) {
    	k = k + c[i];
    }
    avg = k / a;
    printf("%0.6f\n",avg);
    for (i = 1;i <= a;i++) {
    	for (j = 1;j <= n;j++) {
    		if (c[i] == c[j]) {
    			d[i] = d[i] + 1;
    		}
    	}
    }
    for (i = 1;i <= a;i++) {
    	for (j = 1;j <= a;j++) {
    		if (c[i] == c[j]) {
    			e[i] = e[i] + 1;
    		}
    	}
    }
    if (c[a] == c[1]) {for (i = e[a];i <= b - a + e[a];i++) {
    	cnt += fac(d[a]) / (fac(i) * fac(d[a]-i)); 
    }
    }
    else {
    	cnt += fac(d[a]) / (fac(e[a]) * fac(d[a]-e[a]));
    }
    printf("%lld\n",cnt);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: 'scanf' was not declared in this scope
   17 |         scanf("%d%d%d",&n,&a,&b);
      |         ^~~~~
a.cc:21:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   21 |     sort(c+1,c+n+1);
      |     ^~~~
      |     short
a.cc:22:5: error: 'reverse' was not declared in this scope
   22 |     reverse(c+1,c+n+1);
      |     ^~~~~~~
a.cc:28:5: error: 'printf' was not declared in this scope
   28 |     printf("%0.6f\n",avg);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | using namespace std;
Language: C++

#include <stdio.h>
#include <math.h>

int main(void){
	int N, A, B, i, j, k, x = 1, y = 0;
	scanf("%d %d %d", &N, &A, &B);
	double v[N], S = 0, max_v;
	for(i = 0; i < N; i++){
		scanf("%lf", &v[i]);
			
	}

	for(i = 0; i < N; i++){
		max_v = v[i];
		for(j = i; j < N; j++){
			if(max_v < v[j]){
				max_v = v[j];
				k = j;
			}
		}
		v[k] = v[i];
		v[i] = max_v;
	}

	for(i = 0; i < A; i++){
		S += v[i];
	}
	printf("%lf\n", S/A);
	i = 0;
	while(v[A-1]==v[A+i]){
		printf("i%d\n", i);
		i++;
	}
	
	if(S/A == v[A-1]{
		k = 0;
		for(j = 0; j < B-A; j++)
			for(k = 1, k <= A+j; k++){
				x *= (A+i-k-1);
			}
			for(k = 1, k <= A+j; k++){
				x /= k;
			}
			y += x;
		}
	}else{
		printf("%d\n", i+1);
	}
	scanf("%d", &N);

 	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:25: error: expected ')' before '{' token
   35 |         if(S/A == v[A-1]{
      |           ~             ^
      |                         )
a.cc:46:9: error: expected primary-expression before '}' token
   46 |         }else{
      |         ^
a.cc: At global scope:
a.cc:46:10: error: expected unqualified-id before 'else'
   46 |         }else{
      |          ^~~~
a.cc:49:14: error: expected constructor, destructor, or type conversion before '(' token
   49 |         scanf("%d", &N);
      |              ^
a.cc:51:9: error: expected unqualified-id before 'return'
   51 |         return 0;
      |         ^~~~~~
a.cc:52:1: error: expected declaration before '}' token
   52 | }
      | ^
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
 
typedef long long ll;

ll kaizyou(int num){
    ll result=1;
    while(num > 0){
    	result*=num;
        num--;
    }
    return result;
}

int main(){
	int N,A,B;
	cin>>N>>A>>B;
	vector<ll> v;
	REP(i,N){
		ll x;
		cin>>x;
		v.push_back(x);
	}
	sort(v.begin(),v.end(),greater<ll>());
	long double mean = 0;
	REP(i,A){
		mean += v[i];
	}
	mean = mean/A;
	cout<<mean<<endl;
	int before = 0;
	REP(i,N){
		if(v[i]==v[A-1]){
			before = i;
			break;
		}
	};
	int after = 0;
	REP(i,N){
		if(v[N-1-i]==v[A-1]){
			after = N-1-i;
			break;
		}
	};
	ll sum = 0;
	if(before==0){
		for (int i = A; i <= B ; ++i)
		{
			if(i<=after+1){
				sum += kaizyou(after+1)/kaizyou(i)/kaizyou(after-i+1);
			}
		}
	}else{
		sum = kaizyou(after-before+1)/kaizyou(A-before)/kaizyou(after-A+1);
	}
	cout<<sum<<endl;
	return 0;
}

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

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

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

int main(){

        int N;
        int A;
        int B;
        long long v[50];
        int i;
        long double average=0;
        int ways=1;

        scanf("%d %d %d",&N, &A, &B);
        for(i=0;i<N;i++) scanf("%lld",&v[i]);

        qsort (v, N, sizeof(long long), compare);
        for(i=0;i<A;i++) average+=v[A-1-i];
        average=average/A;
        for(i=A;i<B+1;i++) if(v[i]==v[A-1]) ways++;
        printf("%Lf\n%d\n",average,ways);

        return 0;
}
 b

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

#include "bits/stdc++.h"

#define REP(i,n) for(ll i=0;i<n;++i)
#define RREP(i,n) for(ll i=n-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<n;++i)
#define RFOR(i,m,n) for(ll i=n-1;i>=m;--i)
#define ALL(v) (v).begin(),(v).end()
#define PB(a) push_back(a)
#define UNIQUE(v) v.erase(unique(ALL(v),v.end()));
#define DUMP(v) REP(i, (v).size()) { cout << v[i]; if (i != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
///(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)(´・ω・`)///

void make_comb(vvl &comb) {
	REP(i, comb.size())comb[i][0] = 1;
	REP(i, comb.size()-1) {
		REP(j, comb[0].size()-1) {
			comb[i + 1][j + 1] = comb[i][j] + comb[i][j + 1];
		}
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	vvl comb(55, vl(55, 0));
	make_comb(comb);

	int n, a, b;
	cin >> n >> a >> b;
	vl v(n);
	REP(i, n)cin >> v[i];
	sort(ALL(v), greater<ll>());
	ll cnt = 0;
	long double ans = -1;
	FOR(i, a, b + 1) {
		ll sum = 0;
		REP(j, i)sum += v[j];
		int cntal = 0, cntin = 0;
		REP(j, n)if (v[j] == v[i - 1])cntal++;
		REP(j, i)if (v[j] == v[i - 1])cntin++;
		ll p = comb[cntal][cntin];

		if ((long double)sum / i + EPS> ans) {
			if (abs(long double(sum) / i - ans) < EPS)cnt += p;
			else cnt = p;
			ans = long double(sum) / i;
		}

	}
	cout << fixed << setprecision(12) << ans << endl;
	cout << cnt << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:60:33: error: expected primary-expression before 'long'
   60 |                         if (abs(long double(sum) / i - ans) < EPS)cnt += p;
      |                                 ^~~~
a.cc:62:31: error: expected primary-expression before 'long'
   62 |                         ans = long double(sum) / i;
      |                               ^~~~
Language: Java

import java.util.*;
import java.io.*;
import java.math.*;
public class Main{
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	
	
	
	
	
	
	
	
	int n, a, b;
	long[] v = new long[100];
	HashMap<Long, Integer> m  = new HashMap<>();
	
	BigInteger fac(int x){
		BigInteger c = new BigInteger("1");
		for(int i=1; i<=x; i++) {
			c = c.multiply(new BigInteger(""+i));
		}
		return c;
	}
	BigInteger ncr(int n, int k){
		return fac(n).divide(fac(k)).divide(fac(n-k));
	}

	void solve(){
		n = in.nextInt();
		a = in.nextInt();
		b = in.nextInt();
		for(int i=1; i<=n; i++){ v[i] = in.nextLong();
			m.put(v[i], m.getOrDefault(v[i], 0) + 1);
		}
		
		Arrays.sort(v, 1, n+1);
		long maxsum = 0;
	
	for(int j=1, i = n; j <= a; j++,i--){
		maxsum += v[i];
	}
	if(a == n){
		out.printf("%.10f\n%d\n", (double)maxsum/(double)n, 1);
	}
	else{
		
		double ans = (double)maxsum/a;
		BigInteger ways = new BigInteger("0");
		if(v[n-a] < v[n-a+1]) ways = new BigInteger("1");
		else{
			int k = n-a+1;
			while(k+1 <= n && v[k+1] == v[k]) k++;
			int occ = k - (n-a+1) + 1;
			// compute X choose occ
			ways = ncr(m.get(v[n-a+1]), occ);
		}
		out.printf("%.10f\n%s\n", ans, ways);
	}
		
	}
	
	
		
	
	
	
	
	
	
	
	
	public static void main(String[] args){
		a m = new a();
		m.solve();
		out.flush();
		out.close();
	}
	
	static class InputReader{
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public InputReader(InputStream instream){
			reader = new BufferedReader(new InputStreamReader(instream), 1<<15);
			tokenizer = null;
		}
		public String next(){
			while(tokenizer == null || !tokenizer.hasMoreTokens()){
				try{
					tokenizer = new StringTokenizer(reader.readLine());
				}catch(Exception e){
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();	
		}
		public String nextLine(){
			try{
			return reader.readLine();
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		public int nextInt(){
			return Integer.parseInt(next());
		}
		public long nextLong(){
			return Long.parseLong(next());
		}
		public double nextDouble(){
			return Double.parseDouble(next());
		}


	}
}


Compiler output:
Main.java:75: error: cannot find symbol
		a m = new a();
		^
  symbol:   class a
  location: class Main
Main.java:75: error: cannot find symbol
		a m = new a();
		          ^
  symbol:   class a
  location: class Main
2 errors
Language: Java

import java.util.*;
import java.io.*;
import java.math.*;
public class a{
	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);
	
	
	
	
	
	
	
	
	int n, a, b;
	long[] v = new long[100];
	HashMap<Long, Integer> m  = new HashMap<>();
	
	BigInteger fac(int x){
		BigInteger c = new BigInteger("1");
		for(int i=1; i<=x; i++) {
			c = c.multiply(new BigInteger(""+i));
		}
		return c;
	}
	BigInteger ncr(int n, int k){
		return fac(n).divide(fac(k)).divide(fac(n-k));
	}

	void solve(){
		n = in.nextInt();
		a = in.nextInt();
		b = in.nextInt();
		for(int i=1; i<=n; i++){ v[i] = in.nextLong();
			m.put(v[i], m.getOrDefault(v[i], 0) + 1);
		}
		
		Arrays.sort(v, 1, n+1);
		long maxsum = 0;
	
	for(int j=1, i = n; j <= a; j++,i--){
		maxsum += v[i];
	}
	if(a == n){
		out.printf("%.10f\n%d\n", (double)maxsum/(double)n, 1);
	}
	else{
		
		double ans = (double)maxsum/a;
		BigInteger ways = new BigInteger("0");
		if(v[n-a] < v[n-a+1]) ways = new BigInteger("1");
		else{
			int k = n-a+1;
			while(k+1 <= n && v[k+1] == v[k]) k++;
			int occ = k - (n-a+1) + 1;
			// compute X choose occ
			ways = ncr(m.get(v[n-a+1]), occ);
		}
		out.printf("%.10f\n%s\n", ans, ways);
	}
		
	}
	
	
		
	
	
	
	
	
	
	
	
	public static void main(String[] args){
		a m = new a();
		m.solve();
		out.flush();
		out.close();
	}
	
	static class InputReader{
		public BufferedReader reader;
		public StringTokenizer tokenizer;
		public InputReader(InputStream instream){
			reader = new BufferedReader(new InputStreamReader(instream), 1<<15);
			tokenizer = null;
		}
		public String next(){
			while(tokenizer == null || !tokenizer.hasMoreTokens()){
				try{
					tokenizer = new StringTokenizer(reader.readLine());
				}catch(Exception e){
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();	
		}
		public String nextLine(){
			try{
			return reader.readLine();
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		public int nextInt(){
			return Integer.parseInt(next());
		}
		public long nextLong(){
			return Long.parseLong(next());
		}
		public double nextDouble(){
			return Double.parseDouble(next());
		}


	}
}


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

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

public class Main{

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int A = sc.nextInt();
        int B = sc.nextInt();
        long[] w=new long[N];
        for(int i=0;i<N;i++){
            w[i]=sc.nextLong();
        }
        Arrays.sort(w);
        long[] v=new long[N];
        for(int i=0;i<N;i++){
            v[N-1-i]=w[i];
        }
        long border=v[A-1];
        int borderNum=0;
        for(int i=A-1;i>=0;i--){
            if(v[i]!=border){
                break;
            }
            borderNum++;
        }
        int p=borderNum;

        long result=0;
        for(int i=A;i<N;i++){
            if(v[i]!=border){
                break;
            }
            borderNum++;

        }
        if(v[A-1]==v[0]) {
            for (int i = A - 1; i < B; i++) {
                if (v[i] != border) {
                    break;
                }
                result += calcCombination(borderNum,p + i - A + 1);
            }
        }else{
            result += calcCombination(borderNum, p);

        }
        long sum=0;
        for(int i=0;i<A;i++){
            sum+=v[i];
        }
        System.out.println(BigDecimal.valueOf((double)sum/(double)A).toPlainString());
        System.out.println(result);

        return;


    }

Compiler output:
Main.java:59: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,A,B;
ll V[1010];

ll ma[51][51];
ll num[51][51];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>A>>B;
	FOR(i,N) cin>>V[i];
	MINUS(ma);
	ma[0][0]=0;
	num[0][0]=1;
	
	FOR(i,N) {
		FOR(x,N) if(num[i][x]>0) {
			
			// take
			if(ma[i+1][x+1] < ma[i][x]+V[i]) ma[i+1][x+1] = ma[i][x]+V[i], num[i+1][x+1]=0;
			if(ma[i+1][x+1] == ma[i][x]+V[i]) num[i+1][x+1] += num[i][x];
			// not take
			if(ma[i+1][x] < ma[i][x]) ma[i+1][x] = ma[i][x], num[i+1][x]=0;
			if(ma[i+1][x] == ma[i][x]) num[i+1][x] += num[i][x];
		}
	}
	
	ll p=0,q=1;
	ll ret=0;
	for(i=A;i<=B;i++) {
		if(q*ma[N][i] > p*i) p=ma[N][i], q=i, ret=0;
		if(q*ma[N][i] == p*i) ret += num[N][i];
	}
	_P("%.12lf %lld\n",(double)p/q, hoge);
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:48:41: error: 'hoge' was not declared in this scope
   48 |         _P("%.12lf %lld\n",(double)p/q, hoge);
      |                                         ^~~~
a.cc:6:30: note: in definition of macro '_P'
    6 | #define _P(...) (void)printf(__VA_ARGS__)
      |                              ^~~~~~~~~~~
Language: Java

import java.io.*;
import java.util.*;
public final class max_avg
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static Random rnd=new Random();
	static long[][] dp;
	static Map<Long,Integer> m1=new HashMap<>();
	
    public static void main(String args[]) throws Exception
    {
		dp=new long[52][52];dp[0][0]=1;
		
		for(int i=1;i<52;i++)
		{
			for(int j=0;j<52;j++)
			{
				dp[i][j]=dp[i-1][j];
				
				if(j>0)
				{
					dp[i][j]+=dp[i-1][j-1];
				}
			}
		}
		
		int n=sc.nextInt(),a1=sc.nextInt(),b1=sc.nextInt();long[] a=new long[n];double max=-1;
		
		
		ArrayList<Integer> al=new ArrayList<Integer>();
		
		
		for(int i=0;i<n;i++)
		{
			a[i]=sc.nextLong();m1.put(a[i],m1.getOrDefault(a[i],0)+1);
		}
		
		
		Arrays.sort(a);double val1=0,val2=0;
		
		for(int i=n-1;i>=0;i--)
		{
			val1+=a[i];val2++;
			
			if(val2>=a1 && val2<=b1)
			{
				double now=val1/val2;
				
				if(now>max)
				{
					max=now;al.clear();al.add(i);
				}
				else if(now==max)
				{
					al.add(i);
				}
			}
		}
		
		long res=0;
		
		for(int i=0;i<al.size();i++)
		{
			int k=al.get(i);Map<Long,Integer> m2=new HashMap<>();
			
			for(int j=n-1;j>=k;j--)
			{
				m2.put(a[j],m2.getOrDefault(a[j],0)+1);
			}
			
			long curr=1;
			
			for(Map.Entry<Long,Integer> en:m2.entrySet())
			{
				int x=m1.get(en.getKey()),y=en.getValue();
				
				curr=(curr*dp[x][y]);
			}
			
			res=res+curr;
		}
		
		out.printf("%.10f \n%d\n",max,res);out.close();
    }
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }
	
    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }
	
	public String next() throws Exception {
		return nextToken().toString();
	}
	
    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}

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

#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")

using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)

#define ynmes(a) (a) ? mes("Yes") : mes("No")
#define YNmes(a) (a) ? mes("YES") : mes("NO")
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
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; }
struct io { io() { ios::sync_with_stdio(false); cin.tie(0); } };
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

signed main() {
    string a, b;
    cin >> n >> m;
    
    (a == b) ? mes("H") : mes("D");
    
    

    
    
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:76:12: error: 'n' was not declared in this scope
   76 |     cin >> n >> m;
      |            ^
a.cc:76:17: error: 'm' was not declared in this scope
   76 |     cin >> n >> m;
      |                 ^
Language: C++

#include <bits/stdc++.h>
#include<atcoder/all>
using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
typedef long long ll;
const ll MOD=1000000007;
using namespace std;
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; }
template<class T>auto MAX(const T& a) { return *max_element(a.begin(),a.end()); }
template<class T>auto MIN(const T& a) { return *min_element(a.begin(),a.end()); }
template<class T, class U>U SUM(const T& a, const U& v) { return accumulate(a.begin(),a.end(), v); }
template<class T, class U>U COUNT(const T& a, const U& v) { return count(a.begin(),a.end(), v); }
template<class T, class U>int LOWER(const T& a, const U& v) { return lower_bound(a.begin(),a.end(), v) - a.begin(); }
template<class T, class U>int UPPER(const T& a, const U& v) { return upper_bound(a.begin(),a.end(), v) - a.begin(); }
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
int LCM(int a, int b) { int g = GCD(a, b); return a / g * b; }
typedef long double ld;
typedef unsigned long long int ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<ll, ll>> vpll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<vc> vvc;
typedef vector<vs> vvs;
typedef vector<vll> vvll;
typedef map<int, int> mii;
typedef set<int> si;
//---------------------------------------------------------------------------------------------------

int main(void){
    // Your code here!
    char a,b; cin >> a >> b;
    if (a == b) cout << 'H' << endl;
    else cout << 'D' << endl;
}


Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.