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

#include <bits/stdc++.h>

using namespace std;

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = (int) x; i < (int)n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = (int) n; i > (int)x; i--)
#define rrep(i,n) RREP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
#define SZ(x) ((int)(x).size())

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;

int main (){
  ll n;

  cin >> n;
  ll j=99999999999;

 
  // for(int i=1;i*i<=n;i++){
  //if(n%i==0){
  //  if(i>n/i)break;  
      //          printf("%d, %d\n",i,n/i);
         int  a=log10(n/i)+1;
     // printf("aa %d\n",a);
         // if(a<j) 
                   j=a;
             // }
    //    P("A");
         // }
  P(j);
  return 0;
}


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

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

using namespace std;
long N;

long GetDigit(long num) {
	return log10(num) + 1;
}

void solve() {
	long A = 1;
	for (long i = 0; i < N; i++) {
		for (long j = 0; j < N; j++) {
			if (N % A == 0) {
				long d = min(d, GetDigit(N / A));
			}
		}
	}
	cout << d << endl;
}




int main()
{
	// 入力
	cin >> N;
	solve();
    return 0;
}



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

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
 
int main()
{
  long long N;
  cin >> N;
  vector<long long> v;
  v.push_back(1LL);
  long long a = sqrt(N);
  long long i = 2, j = 1, t;
  int n;
  while (i < a)
  {
    if (0LL == N % i)
    {
      N /= i;
      n = v.size();
      t = pow(i, j);
      for (int k=0; k<n; ++k)
      {
        v.push_back(v[k] * t);
      }
      ++j;
    }
    else
    {
      ++i;
      j=1;
    }
  }

  long long b = 1000000000000;
  n = v.size();
  for (int k=n-1; k>=0; --k)
  {
    if (k=>a && b > v[k])
    {
      b = v[k];
    }
  }

  int c = 0;
  while (b > 0)
  {
    b /= 10;
    ++c;
  }
  cout << c << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:11: error: expected primary-expression before '>' token
   39 |     if (k=>a && b > v[k])
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
 
int main()
{
  long long N;
  cin >> N;
  vector<long long> v;
  v.push_back(1LL);
  long long a = sqrt(N);
  long long i = 2, j = 1, t;
  int n;
  while (i < a)
  {
    if (0LL == N % i)
    {
      N /= i;
      n = v.size();
      t = pow(i, j);
      for (int k=0; k<n; ++k)
      {
        v.push_back(v[k] * t);
      }
      ++j;
    }
    else
    {
      ++i;
      j=1;
    }
  }

  long long b = 1000000000000;
  n = v.size();
  for (int k=n-1; k>=0; --k)
  {
    if (k=>a && b > v[k])
    {
      b = v[k];
    }
  }

  cout << b << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:11: error: expected primary-expression before '>' token
   39 |     if (k=>a && b > v[k])
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <math>
using namespace std;
 
int main()
{
  long long N;
  cin >> N;
  vector<long long> v;
  v.push_back(1LL);
  long long a = sqrt(N);
  long long i = 2, j = 1, t;
  int n;
  while (i < a)
  {
    if (0LL == N % i)
    {
      N /= i;
      n = v.size();
      t = pow(i, j);
      for (int k=0; k<n; ++k)
      {
        v.push_back(v[k] * t);
      }
      ++j;
    }
    else
    {
      ++i;
      j=1;
    }
  }

  long long b = 1000000000000;
  n = v.size();
  for (int k=n-1; k>=0; --k)
  {
    if (k=>a && b > v[k])
    {
      b = v[k];
    }
  }

  cout << b << endl;
  return 0;
}

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

#include <iostream>
#include <vector>
using namespace std;
 
int main()
{
  long long N;
  cin >> N;
  vector<long long> v;
  v.push_back(1LL);
  long long a = sqrt(N);
  long long i = 2, j = 1, t;
  int n;
  while (i < a)
  {
    if (0LL == N % i)
    {
      N /= i;
      n = v.size();
      t = pow(i, j);
      for (int k=0; k<n; ++k)
      {
        v.push_back(v[k] * t);
      }
      ++j;
    }
    else
    {
      ++i;
      j=1;
    }
  }

  long long b = 1000000000000;
  n = v.size();
  for (int k=n-1; k>=0; --k)
  {
    if (k=>a && b > v[k])
    {
      b = v[k];
    }
  }

  cout << b << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:17: error: 'sqrt' was not declared in this scope
   11 |   long long a = sqrt(N);
      |                 ^~~~
a.cc:20:11: error: 'pow' was not declared in this scope
   20 |       t = pow(i, j);
      |           ^~~
a.cc:38:11: error: expected primary-expression before '>' token
   38 |     if (k=>a && b > v[k])
      |           ^
Language: C++

#include<cstdio>
#include<algorithm>

using namespace std;
typedef long long int lli;

lli N, ans = 9999999999, ou1, ou2, ou, rN;

lli keta(lli in);

int main(){

  scanf("%lld", &N);
  rN = sqrt(N);

  for(int l = 1; l <= rN; l++){
    if((N % l) == 0){
      ou1=keta(l);
      ou2 = keta(N/l);
      ou = max(ou1, ou2);
      //printf("%lld %llld\n", ou1, ou2);
      if(ans > ou) ans = ou;
      if(ou1 == ou2){
        break;
      }else if(ou1 > ou2){
        break;
      }
    }
  }

  printf("%lld", ans);

  return 0;

}

lli keta(lli in){

  int l = 1;

  while(in >= 10){
    in /= 10;
    //printf("%lld\n", in);
    l++;
  }

  return l;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:8: error: 'sqrt' was not declared in this scope
   14 |   rN = sqrt(N);
      |        ^~~~
Language: C++

#include <cstdio>
#include <cmath>
#include <random>
#define REP(i,n) for (int i=0;i<(n);i++)
int F(double,double);
int main(){
	long long N;
	scanf("%lld",&N);
	int num=1145141919;
	for(int i=1;i<=100000;i++){
		if(N%i==0 && num>F(N/i,i)){
			num=F(N/i,i);
		}
	}
	printf("%d",num);
	return 0;
}

Compiler output:
/usr/bin/ld: /tmp/ccxgFMdF.o: in function `main':
a.cc:(.text+0x80): undefined reference to `F(double, double)'
/usr/bin/ld: a.cc:(.text+0xc9): undefined reference to `F(double, double)'
collect2: error: ld returned 1 exit status
Language: C++

#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iostream>
#include <sstream>
#include <string>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define EPS 1e-14
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) FOR(i, 0, n)
#define PI 2*acos(0.0)
#define ALL(a) (a).begin(),(a).end()
#define DEBUG(x) cout<<#x <<": "<< x << "\n"
#define DEBUG_ARR(a) REP(i, size(a)){ cout << #a << "[" << i << "]: " << a[i] << "\n"; }
const int VX[] = { 0, 1, 0, -1 };
const int VY[] = { 1, 0, -1, 0 };
const long MOD = 1000000007;

int main() {
	//	--- I/O 高速化 ---
	cin.tie(0);
	ios::sync_with_stdio(false);
	// --- ここまで ---

	long long N;
	cin >> N;

	int min = INT_MAX;
	for (long long i = 1; i < sqrt(N); i++) {
		if (N % i == 0) {
			long long A = i;
			long long B = N / i;

			if (max(floor(log10(A)) + 1, floor(log10(B)) + 1) < min) {
				min = max(floor(log10(A)) + 1, floor(log10(B)) + 1);
			}
			else if (max(floor(log10(A)) + 1, floor(log10(B)) + 1) > min) {
				break;
			}
		}
	}
	cout << min << endl;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:34:19: error: 'INT_MAX' was not declared in this scope
   34 |         int min = INT_MAX;
      |                   ^~~~~~~
a.cc:11:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   10 | #include <map>
  +++ |+#include <climits>
   11 |
Language: C++

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

int main(void)
{
	__int64 N;
	cin >> N;

	int a, b;

	for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
		if (N % i == 0) {
			a = i;
			b = N / i;
		}
	}
	
	stringstream ss1;
	ss1 << a;
	stringstream ss2;
	ss2 << b;
	cout << max(ss1.str().length(), ss2.str().length()) << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    9 |         __int64 N;
      |         ^~~~~~~
      |         __ynf64
a.cc:10:16: error: 'N' was not declared in this scope
   10 |         cin >> N;
      |                ^
a.cc:14:21: error: expected ';' before 'i'
   14 |         for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
      |                     ^~
      |                     ;
a.cc:14:29: error: 'i' was not declared in this scope
   14 |         for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
      |                             ^
Language: C++

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

int main(void)
{
	__int64 N;
	cin >> N;

	int a, b;

	for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
		if (N % i == 0) {
			a = i;
			b = N / i;
		}
	}
	
	stringstream ss1;
	ss1 << a;
	stringstream ss2;
	ss2 << b;
	cout << max(ss1.str().length(), ss2.str().length()) << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: '__int64' was not declared in this scope; did you mean '__int64_t'?
    8 |         __int64 N;
      |         ^~~~~~~
      |         __int64_t
a.cc:9:16: error: 'N' was not declared in this scope
    9 |         cin >> N;
      |                ^
a.cc:13:21: error: expected ';' before 'i'
   13 |         for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
      |                     ^~
      |                     ;
a.cc:13:29: error: 'i' was not declared in this scope
   13 |         for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
      |                             ^
a.cc:13:33: error: 'sqrt' was not declared in this scope
   13 |         for (__int64 i = 1; i < sqrt(N) + 1; ++i) {
      |                                 ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

#define int long long
std::pair<std::vector<ll>, std::vector<ll>> prime_factor_decomp(ll n) {
    std::vector<ll> p, e;
    ll m = n;
    for (ll i = 2; i * i <= n; i++) {
        if (m % i != 0) continue;
        int c = 0;
        while (m % i == 0) c++, m /= i;
        p.push_back(i);
        e.push_back(c);
    }
    if (m > 1) {
        p.push_back(m);
        e.push_back(1);
    }
    return std::make_pair(p, e);
}

signed main(void){
	ll n; cin >> n;
	auto ret = prime_factor_decomp_fast(n);
	auto v = ret.fi, u = ret.se;
	ll a = 1, b = 1;
	for (int i = v.size() - 1; i >= 0; --i){
		ll x = v[i], k = u[i]; // x^k
		/*
		printf("%lld %lld\n", x, k);
		if(k % 2){
			if(a > b) a *= pow(x, k / 2), b *= pow(x, k / 2 + 1);
			else  a *= pow(x, k / 2 + 1), b *= pow(x, k / 2);
		}else{
			a *= pow(x, k / 2);
			b *= pow(x, k / 2);
		}
		*/
		rep(i, k){
			if(a > b) b *= x;
			else a *= x;
		}
		// printf("ab %lld %lld\n", a, b);
	}
	string sa = to_string(a), sb = to_string(b);
	// cout << sa << " " << sb << endl;
	int size = max((int)sa.size(), (int)sb.size());
	printf("%d\n", size);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:43:20: error: 'prime_factor_decomp_fast' was not declared in this scope; did you mean 'prime_factor_decomp'?
   43 |         auto ret = prime_factor_decomp_fast(n);
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~
      |                    prime_factor_decomp
a.cc:58:24: error: 'k' was not declared in this scope
   58 |                 rep(i, k){
      |                        ^
a.cc:7:33: note: in definition of macro 'rep'
    7 | #define rep(i,n) for(int i=0;i<(n);i++)
      |                                 ^
Language: C++

#include<cstdio>
#include<conio.h>
#include<math.h>
#include<algorithm>
using namespace std;

int main(){
    long long int n,x,y,i;
    scanf("%lld",&n);
    for(i=sqrt(n);i>0;i--){
       if(n%i==0) break;
    }
    x=i;
    y=n/x;
    i=0;
    while(x!=0){
       x=x/10;
       i++;
    }
    x=i;
    i=0;
    while(y!=0){
       y=y/10;
       i++;
    }
    y=i;
    printf("%lld",max(x,y));
    return 0;
}

Compiler output:
a.cc:2:9: fatal error: conio.h: No such file or directory
    2 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cstdio>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <string>
using namespace std;
#define INF 0x3f3f3f3f
typedef long long LL;
double PI=acos(-1);

LL n;

int f(LL s)
{
    int i=0;
    while(s>=1){
        i++;
        s/=10;
    }
    return i;
}

int main()
{
    while(cin>>n){
        
        int s=sqrt(n*1.0);
        ss=s;
        while(ss<=n){
            if(n%ss==0){
                break;
            }
            ss++;
            if(ss-s>10000){
                break;
            }
        }
        if(ss-s>1000){
            cout<<f(n)<<endl;
        }else{
            cout<<f(s)<<endl;
        }
        
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'ss' was not declared in this scope; did you mean 's'?
   34 |         ss=s;
      |         ^~
      |         s
Language: C++

//#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <math.h>
#include <unordered_map>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

#define PI 3.141592653589793238462643383279502884
#define Max 100005
#define ll long long
#define mod 2
#define EPS 1E-9

vector< pair<int, int> >v;
void get_div(ll n)
{
	for (int i = 1; i <= sqrt(n); i++)
	{
		if (n%i == 0)
		{
			if (i*i != n)
				v.push_back(make_pair(i, (n / i)));
			else
				v.push_back(make_pair(i, i));
		}
	}
}
int get_max_sz(string s1, string s2)
{
	return max(s1.size(), s2.size());
}



int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	ll n;
	cin >> n;
	get_div(n);
	string tmp1, tmp2;
	int mn = INT_MAX;
	int res;
	for (int i = 0; i<v.size(); i++)
	{
		tmp1 = to_string(v[i].first);
		tmp2 = to_string(v[i].second);
		res = get_max_sz(tmp1, tmp2);
		if (res<mn)
			mn = res;
	}
	cout << mn << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:55:18: error: 'INT_MAX' was not declared in this scope
   55 |         int mn = INT_MAX;
      |                  ^~~~~~~
a.cc:14:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   13 | #include <iomanip>
  +++ |+#include <climits>
   14 |
Language: C

#include<stdio.h>

int degits(long long a){
	if(a<10) return 1;
	return 1+degits(a/10);
}

int F(long long a,long long b){
	int ad,bd;
	ad=degits(a);
	bd=degits(b);
	return ((ad>bd)?ad:bd);
}

int main(int argc, char const *argv[]){
	long long n,i;
	int min;
	scanf("%lld",&n);
	min=degits(n);
	for(i=2;i*i<=n;i++){
		if(n%i==0){
			min=(F(i,n/i)<min)?F(i,n/i):min;
		}
	}
	printf("%d",min)
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:25:25: error: expected ';' before 'return'
   25 |         printf("%d",min)
      |                         ^
      |                         ;
   26 |         return 0;
      |         ~~~~~~
Language: C

#include<stdio.h>

int degits(long long a){
	if(a<10) return 1;
	return 1+degit(a/10);
}

int F(long long a,long long b){
	int ad,bd;
	ad=degits(a);
	bd=degits(b);
	return ((ad>bd)?ad:bd);
}

int main(int argc, char const *argv[]){
	long long n,i;
	int min;
	scanf("%lld",&n);
	min=degit(n);
	for(i=2;i*i<=n;i++){
		if(n%i==0){
			min=(F(i,n/i)<min)?F(i,n/i):min;
		}
	}
	printf("%d",min)
	return 0;
}

Compiler output:
main.c: In function 'degits':
main.c:5:18: error: implicit declaration of function 'degit'; did you mean 'degits'? [-Wimplicit-function-declaration]
    5 |         return 1+degit(a/10);
      |                  ^~~~~
      |                  degits
main.c: In function 'main':
main.c:25:25: error: expected ';' before 'return'
   25 |         printf("%d",min)
      |                         ^
      |                         ;
   26 |         return 0;
      |         ~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;

int digit(ll x) {
	int c = 0;
	while (x >= 1) {
		x /= 10;
		c++;
	}
	return c;
}

int main() {
	ll n;
	int ans;
	cin >> n;
	for (int i = 1; pow(i,2) <= n; i++) {
		if (n%i == 0)ans = digit(max(n/i,(ll)i));
	}

	cout << ans << endl;
}

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

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <climits>
using namespace std;

vector<long long> divisor(long long n) {
    vector<long long> res;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            res.push_back(i);
            if (i != n / i) res.push_back(n / i);
        }
    }
    return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long N;
    cin >> N;
    vector<long long> div = divisor(N);

    int ans = 100;
    for(auto d : div){
        int tmp1 = static_cast<int>(log10(d)+1);
        int tmp2 = static_cast<int>(log10(N/d)+1);
        ans = min(ans, max(tmp1, tmp2));
    }
    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:37: error: 'log10' was not declared in this scope
   31 |         int tmp1 = static_cast<int>(log10(d)+1);
      |                                     ^~~~~
Language: C++

#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#define int long long
#define uint unsigned long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
using namespace std;

signed main()
{
	int N;
	cin >> N;

	int min = INT_MAX;
	for (int i = 1; i <= (int)sqrt(N); i++)
	{
		if (N % i == 0)
		{
			int a = MAX(i, N / i);
			int k = 0;
			while (a > 0)
			{
				k++;
				a /= 10;
			}
			if (k < min)
			{
				min = k;
			}
		}
	}
	cout << min << endl;;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:35: error: 'sqrt' was not declared in this scope
   25 |         for (int i = 1; i <= (int)sqrt(N); i++)
      |                                   ^~~~
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long N = sc.nextLong();
		
		long ans = 100;
		for(long i=1; i*i<=N; i++) {
			if(N%i==0) {
				ans = Math.min(ans, getDigits(N/i));
			}
		}
		
		System.out.println(ans);
		sc.close();
	}
	
	static int getDigits(long x) {
		int ans = 0;
		while(x>0) {
			x /= 10;
			ans++;
		}
		return ans;
	}
}


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


#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>

#define in std::cin
#define out std::cout

int64_t N;

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);

	in >> N;
	int32_t min = 11;
	for (int64_t i = 1, end = std::sqrt(N)+1; i <= end; i++)
	{
		if (N%i == 0) {

			int32_t count = 0;
			int32_t tmp = N / i;
			while (tmp>0)
			{
				++count;
				tmp /= 10;
			}
			min = std::min(min, count);
		}
	}
	out << min << endl;

	return 0;
}
#endif


Compiler output:
a.cc: In function 'int main()':
a.cc:35:40: error: 'sqrt' is not a member of 'std'; did you mean 'sort'?
   35 |         for (int64_t i = 1, end = std::sqrt(N)+1; i <= end; i++)
      |                                        ^~~~
      |                                        sort
Language: C++

 #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll v[100];
ll KK1(ll n, ll r)
{
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++)
    {
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1]);
    }
    return C[r];
}
/*
ll KK2(ll n, ll m)
{
	ll ans=1;
	for(int i=1;i<=m;i++)
	{
		ans=ans/i*(n-m+i);
	}
	return ans;
}
*/
int main()
{
    ll tot=0;
    long double ans=0,sum=0,cnt=0;
    map<ll,int>N,R;
    int n,a,b;
    cin>>n>>a>>b;
    for(int i=0; i<n; i++){
       	cin>>v[i];
		N[v[i]]++;
	}
    sort(arr,arr+n);
    ll last ;
    last = v[n-1];
    for(int i=n-1; i>=0; i--)
    {
        sum+=v[i];
        R[v[i]]++;
        cnt++;
        if(cnt>b) break;
        if(cnt==a) ans=sum/cnt; 
        if(cnt>=a)
        {
            if(cnt==a)  
				tot+=KK1(N[v[i]],R[v[i]]);
            else if(v[i]==last)  tot+=KK1(N[v[i]],R[v[i]]); 
        }
    }
        cout<<setprecision(18)<<fixed<<ans<<endl;
        cout<<tot<<endl;
        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:39:10: error: 'arr' was not declared in this scope
   39 |     sort(arr,arr+n);
      |          ^~~
Language: C++

 #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll v[100];
ll KK1(ll n, ll r)
{
    ll C[r+1];
    memset(C, 0, sizeof(C));
    C[0] = 1;
    for (ll i = 1; i <= n; i++)
    {
        for (ll j = min(i, r); j > 0; j--)
            C[j] = (C[j] + C[j-1]);
    }
    return C[r];
}
/*
ll KK2(ll n, ll m)
{
	ll ans=1;
	for(int i=1;i<=m;i++)
	{
		ans=ans/i*(n-m+i);
	}
	return ans;
}
*/
int main()
{
    ll tot=0;
    long double ans=0,sum=0,cnt=0;
    map<ll,int>N,R;
    int n,a,b;
    cin>>n>>a>>b;
    for(int i=0; i<n; i++){
       	cin>>v[i];
		N[v[i]]++;
	}
    sort(arr,arr+n);
    ll last ;
    last = v[n-1];
    for(int i=n-1; i>=0; i--)
    {
        sum+=v[i];
        R[v[i]]++;
        cnt++;
        if(cnt>b) break;
        if(cnt==a) ans=sum/cnt; 
        if(cnt>=a)
        {
           // if(cnt==a)  
				tot+=KK1(N[v[i]],R[v[i]]);
            //else if(v[i]==last)  tot+=KK1(N[v[i]],R[v[i]]); 
        }
    }
        cout<<setprecision(18)<<fixed<<ans<<endl;
        cout<<tot<<endl;
        return 0;
    }


Compiler output:
a.cc: In function 'int main()':
a.cc:39:10: error: 'arr' was not declared in this scope
   39 |     sort(arr,arr+n);
      |          ^~~
Language: C++

 #include<bits/stdc++.h>
    using namespace std;
    #define bug printf("bug\n");
    #define bug2(var) cout<<#var<<" "<<var<<endl;
    #define co(q) cout<<q<<endl;
    #define all(q) (q).begin(),(q).end()
    typedef long long int ll;
    typedef unsigned long long int ull;
    const int MOD = (int)1e9+7;
    const int MAX = 1e6;
    #define pi acos(-1)
    #define inf 1000000000000000LL
    #define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll arr[120];
    ll nCr(ll n, ll r)
    {
        ll C[r+1];
        memset(C, 0, sizeof(C));
        C[0] = 1;
        for (ll i = 1; i <= n; i++)
        {
            for (ll j = min(i, r); j > 0; j--)
                C[j] = (C[j] + C[j-1]);
        }
        return C[r];
    }
    int main()
    {
    	//cout<<nCr(5,2)<<"\\\\\\\\\\\\\\\\\\\\"<<endl;
        ll tot=0;
        long double ans=0,sum=0,cnt=0;
        map<ll,int>N,R;
        int n,a,b;
        cin>>n>>a>>b;
        for(int i=0; i<n; i++){
        	cin>>arr[i];
			N[arr[i]]++;
		}
        sort(arr,arr+n);
        ll last ;
        for(int i=n-1; i>=0; i--)
        {
            sum+=arr[i];
            R[arr[i]]++;
            cnt++;
            if(cnt>b)
                break;
            if(cnt==a)
            {
                last = arr[n-1];
                ans=sum/cnt;
            }
            if(cnt>=a)
            {
                long double cur=(sum/cnt);
                if(cnt==a)
                    {tot+=nCr(N[arr[i]],R[arr[i]]);
                    }
           
        }
        cout<<setprecision(18)<<fixed<<ans<<endl;
        cout<<tot<<endl;
        return 0;
    }

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

ｖ#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,a,b;
    cin>>n>>a>>b;
    long long v[n];
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    sort(v,v+n,greater<long long>());
    long long m=0;
    for(int i=0;i<a;i++)m+=v[i];
    cout<<m/a<<".";
    m%=a;
    m*=1000000000;
    cout<<m/a<<endl;
    a--,b--;
    int l=lower_bound(v,v+n,v[a],greater<long long>())-v,r=upper_bound(v,v+n,v[a],greater<long long>())-v;
    int vali=r-l;
    long long c[vali+1];//combination
    //MAX = 50 C 25 < 1.3*10^14
    long long wa[vali+1];
    c[0]=1;
    wa[0]=1;
    for(int i=1;i<=vali;i++){
        c[i]=c[i-1]*(vali-i+1)/i;
        wa[i]=wa[i-1]+c[i];
    }
    if(v[a]==v[b]){//vali C a+1～b
        if(a==l)cout<<wa[b-l]<<endl;
        else cout<<wa[b-l]-wa[a-l]<<endl;
    }
    else{//vali C a+1～vali
        if(a==l)cout<<wa[vali]<<endl;
        else cout<<wa[vali]-wa[a-l]<<endl;
    }
    return 0;
}


Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | ｖ#include<bits/stdc++.h>
      |   ^
a.cc:1:1: error: '\U0000ff56' does not name a type
    1 | ｖ#include<bits/stdc++.h>
      | ^~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin>>n>>a>>b;
      |     ^~~
a.cc:10:16: error: 'greater' was not declared in this scope
   10 |     sort(v,v+n,greater<long long>());
      |                ^~~~~~~
a.cc:10:24: error: expected primary-expression before 'long'
   10 |     sort(v,v+n,greater<long long>());
      |                        ^~~~
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(v,v+n,greater<long long>());
      |     ^~~~
      |     short
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout<<m/a<<".";
      |     ^~~~
a.cc:16:16: error: 'endl' was not declared in this scope
   16 |     cout<<m/a<<endl;
      |                ^~~~
a.cc:18:42: error: expected primary-expression before 'long'
   18 |     int l=lower_bound(v,v+n,v[a],greater<long long>())-v,r=upper_bound(v,v+n,v[a],greater<long long>())-v;
      |                                          ^~~~
a.cc:18:11: error: 'lower_bound' was not declared in this scope
   18 |     int l=lower_bound(v,v+n,v[a],greater<long long>())-v,r=upper_bound(v,v+n,v[a],greater<long long>())-v;
      |           ^~~~~~~~~~~
a.cc:19:14: error: 'r' was not declared in this scope
   19 |     int vali=r-l;
      |              ^
Language: C++

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

long long fact(int x){
	if(x==0)return 1ll;
	return fact(x-1)*x;
}
long long comb(int x, int y){
	long long ret=1ll;
	for(int i = 1;i <= y;i ++){
		ret=ret*(x+1-i)/i;
	}
	return ret;
}
int main(){
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	vector <long long> v(n);
	for(auto&i:v)
		scanf("%lld", &i);
	sort(v.begin(), v.end());
	long double sum=0.0l;
	for(int i = n;i > n-a;i --){
		sum+=v[i-1];
	}
	printf("%.10Lf\n", sum/a);
	if(v[n-a]!=v[n-1]){//must pick a
		printf("%lld\n", comb(count(v.begin(), v.end(), v[n-a]),count(v.begin()+(n-a), v.end(), v[n-a])));
	}else{//can pick any number
		long long ans=0ll;
		for(int i = a;i <= b;i ++){
			if(v[n-i]!=v[n-1])
				break;
			ans+=comb(count(v.begin(), v.end(), v.back()), i);
		}
		printf("%lld\n", ans);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   22 |         sort(v.begin(), v.end());
      |         ^~~~
      |         short
a.cc:29:39: error: 'count' was not declared in this scope
   29 |                 printf("%lld\n", comb(count(v.begin(), v.end(), v[n-a]),count(v.begin()+(n-a), v.end(), v[n-a])));
      |                                       ^~~~~
a.cc:35:35: error: 'count' was not declared in this scope
   35 |                         ans+=comb(count(v.begin(), v.end(), v.back()), i);
      |                                   ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
enum { };
unordered_map<ll,ll> f, fs;

ll ncr(ll n, ll r) {
	ll ans = 1;
	for (ll i = n; i > max(r, n-r); i--) {
		ans *= i;
	}
	for (ll i = 2; i <= min(r, n-r); i++) {
		ans /= i;
	}
	return ans;
}

int main() {
	ios::sync_with_stdio(false); cin.tie(0); cout.precision(20);
	ll n, a, b; cin >> n >> a >> b;
	vector<ll> arr(n);
	for (ll i = 0; i < n; i++) {
		cin >> arr[i];
		f[arr[i]]++;
	}
	sort(arr.rbegin(), arr.rend());
	ll sum = 0, cnt = 0;
	for (ll i = 0; i < a; i++) {
		sum += arr[i];
		fs[arr[i]]++;
		cnt++;
	}
	for (ll i = a; i < b; i++) {
		if ((sum + arr[i]) * cnt > sum * (cnt+1)) {
			sum += arr[i];
			fs[arr[i]]++;
			cnt++;
		}
	}
	ll ans = 1;
	for (auto fi : fs) {
		ans *= ncr(f[fi.first], fi.second);
	}
	cout << sum / ld(cnt) << endl << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:23: error: 'ld' was not declared in this scope; did you mean 'll'?
   44 |         cout << sum / ld(cnt) << endl << ans << endl;
      |                       ^~
      |                       ll
Language: C++

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

 // Combination Table
long long 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(){
cout << fixed << setprecision(8);
int N,A,counter=0;
int B;
cin>>N>>A>>B;
comb_table(N);
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
for(int i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(int i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(int i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(int j=A-counter2;j<=d;j++){
answer+=C[counter1][j];}
cout<<answer<<endl;}}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:16: error: no matching function for call to 'min(long long int&, int&)'
   40 | long long d=min(counter1,B);
      |             ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:40:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   40 | long long d=min(counter1,B);
      |             ~~~^~~~~~~~~~~~
/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:40:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   40 | long long d=min(counter1,B);
      |             ~~~^~~~~~~~~~~~
Language: C++

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

 // Combination Table
int 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(){
cout << fixed << setprecision(8);
int N,A,counter=0;
int B;
cin>>N>>A>>B;
comb_table(N);
double AA=A;
int counter1=0;
int counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
for(int i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(int i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(int i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
int d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(int j=A-counter2;j<=d;j++){
answer+=[counter1][j];}}
cout<<answer<<endl;}


Compiler output:
a.cc: In lambda function:
a.cc:46:19: error: expected '{' before '[' token
   46 | answer+=[counter1][j];}}
      |                   ^
a.cc: In function 'int main()':
a.cc:46:19: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
Language: C++

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

 // Combination Table
long long C[51][51]; // C[n][k] -> nCk
void comb_table(long long N){
 for(long long i=0;i<=N;++i){
 for(long long 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]);
}}}}
long long main(){
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
comb_table(N);
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(long long j=A-counter2;j<=d;j++){
answer+=[counter1][j];}}
cout<<answer<<endl;}


Compiler output:
cc1plus: error: '::main' must return 'int'
a.cc: In lambda function:
a.cc:50:19: error: expected '{' before '[' token
   50 | answer+=[counter1][j];}}
      |                   ^
a.cc: In function 'int main()':
a.cc:50:19: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'long long int')
Language: C++

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

 // Combination Table
long long C[51][51]; // C[n][k] -> nCk
void comb_table(int K){
 for(int i=0;i<=K;++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(){
comb_table();
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(long long j=A-counter2;j<=d;j++){
answer+=[counter1][j];}}
cout<<answer<<endl;}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: too few arguments to function 'void comb_table(int)'
   16 | comb_table();
      | ~~~~~~~~~~^~
a.cc:7:6: note: declared here
    7 | void comb_table(int K){
      |      ^~~~~~~~~~
a.cc: In lambda function:
a.cc:50:19: error: expected '{' before '[' token
   50 | answer+=[counter1][j];}}
      |                   ^
a.cc: In function 'int main()':
a.cc:50:19: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'long long int')
Language: C++

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

 // Combination Table
long long C[51][51]; // C[n][k] -> nCk
void comb_table(int K){
 for(int i=0;i<=K;++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){
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(long long j=A-counter2;j<=d;j++){
answer+=[counter1][j];}}
cout<<answer<<endl;}


Compiler output:
a.cc: In lambda function:
a.cc:49:19: error: expected '{' before '[' token
   49 | answer+=[counter1][j];}}
      |                   ^
a.cc: In function 'int main()':
a.cc:49:19: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'long long int')
Language: C++

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

 // Combination Table
long long C[51][51]; // C[n][k] -> nCk
void comb_table(int K){
 for(int i=0;i<=K;++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){
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(long long j=A-counter2;j<=d;j++){
answer+=[counter1][j];}
cout<<answer<<endl;}}


Compiler output:
a.cc: In lambda function:
a.cc:49:19: error: expected '{' before '[' token
   49 | answer+=[counter1][j];}
      |                   ^
a.cc: In function 'int main()':
a.cc:49:19: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'long long int')
Language: C++

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

 // Combination Table
long long C[51][51]; // C[n][k] -> nCk
void comb_table(int K){
 for(int i=0;i<=K;++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){
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(int j=A-counter2;j<=d;j++){
answer+=[counter1][j];}
cout<<answer<<endl;}}


Compiler output:
a.cc: In lambda function:
a.cc:49:19: error: expected '{' before '[' token
   49 | answer+=[counter1][j];}
      |                   ^
a.cc: In function 'int main()':
a.cc:49:19: error: no match for 'operator[]' (operand types are 'main()::<lambda()>' and 'int')
Language: C++

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

 // Combination Table
long long C[51][51]; // C[n][k] -> nCk
void comb_table(int K){
 for(int i=0;i<=K;++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){
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(int j=A-counter2;j<=d;j++){
answer+=[counter1][i];}
cout<<answer<<endl;}}


Compiler output:
a.cc: In lambda function:
a.cc:49:19: error: expected '{' before '[' token
   49 | answer+=[counter1][i];}
      |                   ^
a.cc: In function 'int main()':
a.cc:49:20: error: 'i' was not declared in this scope
   49 | answer+=[counter1][i];}
      |                    ^
Language: C++

#include <numeric>
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
2 using R=double;
3
4 // Combination Table
5 ll C[51][51]; // C[n][k] -> nCk
void comb_table(int N){
8 for(int i=0;i<=N;++i){
9 for(int j=0;j<=i;++j){
10 if(j==0 or j==i){
11 C[i][j]=1LL;
12 }else{
13 C[i][j]=(C[i-1][j-1]+C[i-1][j]);
}}}}
int main(){
cout << fixed << setprecision(8);
long long N,A,counter=0;
long long B;
cin>>N>>A>>B;
double AA=A;
long long counter1=0;
long long counter2=0;
long long answer=0;
long long counter3=1;
vector<long long>vec(N);
long long ves[60];
ves[0]=1;
for(long long i=1;i<=50;i++){
ves[i]=i*ves[i-1];}
for(long long i=0;i<N;i++){
cin>>vec.at(i);}
sort(vec.begin(),vec.end());
reverse(vec.begin(), vec.end());
for(long long i=0;i<A;i++){
counter+=vec.at(i);}
double a=counter/AA;
cout<<a<<endl;
for(long long i=0;i<N;i++){
if(vec.at(i)==vec.at(A-1))
counter1++;
else if(vec.at(i)>vec.at(A-1))
counter2++;}
long long d=min(counter1,B);
if(counter2>0){
answer+=C[counter1][A-counter2];
cout<<answer<<endl;}
else{
for(int j=A-counter2;j<=d;j++){
answer+=[counter1][i];}
cout<<answer<<endl;}}


Compiler output:
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 2 using R=double;
      | ^
a.cc:6:1: error: expected unqualified-id before numeric constant
    6 | 3
      | ^
a.cc: In function 'void comb_table(int)':
a.cc:10:2: error: expected ';' before 'for'
   10 | 8 for(int i=0;i<=N;++i){
      |  ^~~~
      |  ;
a.cc:10:15: error: 'i' was not declared in this scope
   10 | 8 for(int i=0;i<=N;++i){
      |               ^
a.cc: In function 'int main()':
a.cc:47:9: error: 'C' was not declared in this scope
   47 | answer+=C[counter1][A-counter2];
      |         ^
a.cc: In lambda function:
a.cc:51:19: error: expected '{' before '[' token
   51 | answer+=[counter1][i];}
      |                   ^
a.cc: In function 'int main()':
a.cc:51:20: error: 'i' was not declared in this scope
   51 | answer+=[counter1][i];}
      |                    ^