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

#include <bits/stdc++.h>

#define 	ll 						long double
#define 	pb 						push_back
#define 	mp 						make_pair
#define 	fast 					ios_base::sync_with_stdio(false);cin.tie(NULL);
#define 	ff 						first
#define 	ss 						second
#define 	nil 					-10e+9
#define 	initial 				0
#define 	waiting 				1
#define 	visit 					2
#define 	inf  					10e+9
#define 	mx   					200005
#define 	mxx  					1000005
#define 	mod  					1000000007
#define 	pr   					pair<ll,ll>
#define 	pp_queue 			priority_queue<pr,vector<pr>, greater<pr> >
#define 	dp_queue 			priority_queue<int,vector<int>, greater<int> >
#define 	sp_queue 			priority_queue<int>
#define 	fr(i,p,q)			for(int i=p;i<q;++i)
#define 	frr(i,p,q) 		for(int i=p;i<=q;++i)
#define 	mem(a,b) 			memset(a,b,sizeof(a))
#define 	len(a)   			(int)a.size()
#define 	input  				freopen("input.txt", "r", stdin);
#define 	output 				freopen("output.txt", "w", stdout);
#define 	debug(arr,j,n) fr(i,j,n) cout<<arr[i]<<" ";

ll power(ll a,ll b){ll aa=1;while(b){if(b&1){aa=aa*a;aa%=mod;}a=a*a;a%=mod;b/=2;}return aa;}

using namespace std;

int main()
{
  int n;
	cin>>n;
	ll a[n];
	fr(i,0,n) cin>>a[i];
	sort(a,a+n);


	ll deno=(a[0]+a[1])/2.0;

	fr(i,2,n){
		deno=(a[i]+deno)/2.0;
	}
	cout<<setprecision(15)<<deno<<"\n";

}


Compiler output:
a.cc: In function 'long double power(long double, long double)':
a.cc:29:42: error: invalid operands of types 'long double' and 'int' to binary 'operator&'
   29 | ll power(ll a,ll b){ll aa=1;while(b){if(b&1){aa=aa*a;aa%=mod;}a=a*a;a%=mod;b/=2;}return aa;}
      |                                         ~^~
      |                                         | |
      |                                         | int
      |                                         long double
a.cc:29:56: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
   29 | ll power(ll a,ll b){ll aa=1;while(b){if(b&1){aa=aa*a;aa%=mod;}a=a*a;a%=mod;b/=2;}return aa;}
      |                                                        ^
a.cc:29:56: note:   in evaluation of 'operator%=(long double, int)'
a.cc:29:70: error: invalid operands of types 'long double' and 'int' to binary 'operator%'
   29 | ll power(ll a,ll b){ll aa=1;while(b){if(b&1){aa=aa*a;aa%=mod;}a=a*a;a%=mod;b/=2;}return aa;}
      |                                                                      ^
a.cc:29:70: note:   in evaluation of 'operator%=(long double, int)'
Language: C++

#include <iostream>

using namespace std;

int main(){
  int N;
  cin >> N;
  double v[N], ans;
  for(int i=0; i<N; i++) cin >> v[i];
  sort(v, v+N);
  for(int i=0; i<N; i++){
    if(i==0) ans = v[i];
    else ans = (ans + v[i]) / 2;
  }
  cout << ans << endl;
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std；
int main (){
	int n;
	cin >> n;
	int a[n+1];
	for (int i=1;i<=n;i++)
	cin >> a[i];
	sort(a+1,a+1+n);
	int x;
	x = (a[1]+a[2])*1.0/2;
	for(int i=3;i<=n;i++){
		x = (a[i]+x)*1.0/2;
	}
	cout << x;
	return 0;
}

Compiler output:
a.cc:2:17: error: 'std\U0000ff1b' is not a namespace-name
    2 | using namespace std；
      |                 ^~~~~
a.cc:2:22: error: expected ';' before 'int'
    2 | using namespace std；
      |                      ^
      |                      ;
    3 | int main (){
      | ~~~                   
a.cc: In function 'int main()':
a.cc:5:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:9:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
    9 |         sort(a+1,a+1+n);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << x;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

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

int main()
{
  int n;
  cin>>n;
  int *ar = new int[n];
  for(int i = 0;i<n;i++)
   	cin>>ar[i];
  for(int i = n-1;i > 0;i--)
  {
    for(int j = 0;j<i;j++)
    {
      if(ar[j] > ar[j+1])
      {
        int temp = ar[j];
        ar[j] = ar[j+1];
        ar[j+1] = temp;
      }
    }
  }
  float sum = (ar[0] + ar[1])/2.0;
  for(int i = 2;i<n-1;i++)
  {
    sum = (sum + ar[i])/2.0;
  }
  cot<<sum;
  return 0;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:28:3: error: 'cot' was not declared in this scope; did you mean 'cos'?
   28 |   cot<<sum;
      |   ^~~
      |   cos
Language: C++

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

void fast(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
}

int main(){
	fast();
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	double ans=a[0];
	for(ll i=1;i<n;i++){
		ans=(double)(ans+v[i])/2;
	}
	cout<<fixed<<setprecision(10)<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: 'v' was not declared in this scope
   20 |                 ans=(double)(ans+v[i])/2;
      |                                  ^
Language: C++

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

void fast(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
}

int main(){
	fast();
	ll n;
	cin>>n;
	ll a[n];
	for(ll i=0;i<n;i++)cin>>a[i];
	sort(a,a+n);
	double ans=a[0];
	for(ll i=1;i<n;i++){
		ans=(double)(ans+v[i])/2;
	}
	cout<<fixed<<ssetprecision(10)<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: 'v' was not declared in this scope
   20 |                 ans=(double)(ans+v[i])/2;
      |                                  ^
a.cc:22:22: error: 'ssetprecision' was not declared in this scope
   22 |         cout<<fixed<<ssetprecision(10)<<ans;
      |                      ^~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
using namespace std;



int main(){
    int N; cin>> N;
    vector<int> V(N);
    for (int i = 0;i < N;i++){
        cin >> V[i];
    }
    sort(V.begin(),V.end());
    
    double ans = 0.0;
    ans += (double)V[0];
    for (int i = 1; i <N;i++){
        ans += (double)V[i];
        ans = (double) ans/2;
    }
    cout << ans<<endl;
    return 0;
}


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

#include<stdio.h>
int main()
{
	int i,N,v[100],a,j;
	float sum=0.0;
	scanf("\n%d",&N);
	for (i=0;i<N;i++)
	{
		scanf("%d",&v[i]);
	}


	for (i=0;i<N-1;i++) 
	{
		for(j=0;j<N-i-1;j++)
		{
			if( v[j]>v[j+1] )
			{	a=v[j];
				v[j] = v[j+1];
				v[j+1]=a;
			}
		}
	}

        sum= (float) a[0]/2+a[1]/2;
	if(N>2)
	{
	for(i=2;i<N;i++)
	{
		sum = sum/2 + (float)v[i]/2;
	}
	}
	printf("\n%f",sum);
	return 0;
}




Compiler output:
main.c: In function 'main':
main.c:25:23: error: subscripted value is neither array nor pointer nor vector
   25 |         sum= (float) a[0]/2+a[1]/2;
      |                       ^
main.c:25:30: error: subscripted value is neither array nor pointer nor vector
   25 |         sum= (float) a[0]/2+a[1]/2;
      |                              ^
Language: C++

#include <iostream>
#include <iomanip>
#include <vector>

using namespace std;

int main(int argc, char const* argv[])
{
    int n;
    cin >> n;

    vector<double> v(n);
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(v.begin(), v.end());

    double ans = (v[0] + v[1]) / 2;
    for (int i = 2; i < n; i++) {
        ans = (ans + v[i]) / 2.0;
    }

    cout << setprecision(16) << ans << endl;

    return 0;
}

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

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

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i,j,n,t;
  cin>>n;
  int a[n];
  for(i=0;i<n;i++)
  {
    cin>>a[i];
  }
  sort(a,a+n);
  j=a[0]+a[1]/2;
  for(i=2;i<n;i++)
  {
    j=(j+a[i])/2;
  }
  cout<<j;
}
    


Compiler output:
a.cc:1:10: fatal error: bits/stdc+.h: No such file or directory
    1 | #include <bits/stdc+.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

//
//  main.cpp
//  ABC138C
//
//  Created by KJC of Kindai University on 2019/08/29.
#include <iostream>
#include<vector>
using namespace std;

int main(int argc, const char * argv[]) {
    int N;
    cin >> N;
    vector<double>v(N);
    for (int i=0; i<N; i++) {
        cin >> v.at(i);
    }
    //昇順にソート
    sort(v.begin(),v.end());
    double ans=(v.at(0)+v.at(1))/2.0;
    for (int i=2; i<N; i++) {
        ans=(v.at(i)+ans)/2.0;
    }
    cout << ans<<endl;
    return 0;
}


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

#include<stdio.h>
#include<stdlib.h>
void main()
{
	int n;
	scanf("%d", &n);
	int temp;

	int *value = malloc(n*sizeof(int));

	for(int i=0; i<n; i++)
		scanf("%d", value+i);
		
	for(int i=0; i<n-1; i++)
	{
		for(int j=0; j<n-i-1; j++)
		{
			if(value[j]>value[j+1])
			{
				temp = value[j];
				value[j] = value[j+1];
				value[j+1] = temp;
			}
		}
	}

	float sum = 0.5 * (float)(value[0]+value[1]);

	for(int i=2; i<n; i++)
	{
		sum = 0.5 * (sum + (float)(value[i]));
	}

	printf("%f", sum);
}


Compiler output:
a.cc:3:1: error: '::main' must return 'int'
    3 | void main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:28: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
    9 |         int *value = malloc(n*sizeof(int));
      |                      ~~~~~~^~~~~~~~~~~~~~~
      |                            |
      |                            void*
Language: C

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

int main(void){
  int n;
  char str1[5],str2[5000];
  char *s;
  fgets(str1,sizeof(str1),stdin);
  n=atof(str1);
  double a[n],b;
  fgets(str2,sizeof(str2),stdin);
  int i,j,k;
  i=0;
  s=strtok(str2," ");
  while(s!=NULL){
    a[i]=atof(s);
    i++;
    s=strtok(NULL," ");
  }
  
  for(i=0;i<n;i++){
    b=0;
    for(j=i;j<n;j++){
      if(a[j]>b){
        b=a[j];
        k=j;
      }
    }
    a[k]=a[i];
    a[i]=b;
  }
  double sum;
  sum=0;
  for(i=0;i<n-1;i++){
    sum+=a[i]/(pow(2.0,i+1));
  }
  sum+=a[n-1]/(pow(2.0,n-1);
  printf("%lf\n",sum);
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:39:28: error: expected ')' before ';' token
   39 |   sum+=a[n-1]/(pow(2.0,n-1);
      |               ~            ^
      |                            )
main.c:41:12: error: expected ';' before '}' token
   41 |   return 0;
      |            ^
      |            ;
   42 | }
      | ~
Language: C

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

int main(void){
  int n;
  char str1[5],str2[5000],s[5];
  fgets(str1,sizeof(str1),stdin);
  n=atof(str1);
  double a[n],b;
  fgets(str2,sizeof(str2),stdin);
  int i,j,k;
  i=0;
  s=strtok(str2," ");
  while(s!=NULL){
    a[i]=atof(s);
    i++;
    s=strtok(NULL," ");
  }
  
  for(i=0;i<n;i++){
    b=0;
    for(j=i;j<n;j++){
      if(a[j]>b){
        b=a[j];
        k=j;
      }
    }
    a[k]=a[i];
    a[i]=b;
  }
  double sum;
  sum=0;
  for(i=0;i<n;i++){
    sum+=a[i]/(pow(2.0,i+1));
  }
  printf("%lf\n",sum);
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:15:4: error: assignment to expression with array type
   15 |   s=strtok(str2," ");
      |    ^
main.c:19:6: error: assignment to expression with array type
   19 |     s=strtok(NULL," ");
      |      ^
Language: C

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

int main(void){
  int n;
  char str1[5],str2[5000],s[5];
  fgets(str1,sizeof(str1),stdin);
  n=atof(str1);
  double a[n],b;
  fgets(str2,sizeof(str2),stdin);
  int i,j,k;
  i=0;
  a[i]=atof(strtok(str2," "));
  while((s=strtok(NULL," "))!=NULL){
    i++;
    a[i]=atof(s);
  }
  
  for(i=0;i<n;i++){
    b=0;
    for(j=i;j<n;j++){
      if(a[j]>b){
        b=a[j];
        k=j;
      }
    }
    a[k]=a[i];
    a[i]=b;
  }
  double sum;
  sum=0;
  for(i=0;i<n;i++){
    sum+=a[i]/(pow(2.0,i));
  }
  printf("%lf\n",sum);
  return 0;
}
    

Compiler output:
main.c: In function 'main':
main.c:16:11: error: assignment to expression with array type
   16 |   while((s=strtok(NULL," "))!=NULL){
      |           ^
Language: C++

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

using namespace std;

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

    vector<int> v(N);

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

    sort(v.begin, v.end);

    int ans = v[0];
    
    for (int i = 1; i < N; i++){
        ans += v[i];
        ans /= 2;
    }

    cout << ans;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: no matching function for call to 'sort(<unresolved overloaded function type>, <unresolved overloaded function type>)'
   17 |     sort(v.begin, v.end);
      |     ~~~~^~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'template<class _RAIter> void std::sort(_RAIter, _RAIter)'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:5: note:   template argument deduction/substitution failed:
a.cc:17:9: note:   couldn't deduce template parameter '_RAIter'
   17 |     sort(v.begin, v.end);
      |     ~~~~^~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

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

int main(){
    int n;
	cin >> n;
	vector<int> input;
	for(int i=0; i<n; i++){
		double tmp;
		cin >> tmp;
		input.push_back(tmp);
	}
	sort(iput.begin(), input.end());
	
	double prev=input[0];
	double cur=input[1];
	int i=1;
	while(i<input.size()){
		cur = input[i];
		prev = (prev+cur)/2.0;
		i++;
	}
	cout << prev << endl;
	
    return 0;
}


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

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
    int N;
    cin >> N;
    int array[N];
    for(int i=0;i<N;i++){
        cin >> array[i];
    }
    double d=0.0;
    array.sort();
    d=array[0];
    for(int i=1;i<N;i++){
        d = (d+array[i])/2;
    }
    return d;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: request for member 'sort' in 'array', which is of non-class type 'int [N]'
   14 |     array.sort();
      |           ^~~~
Language: C++

#include<iostream>
#include<algorythm>

using namespace std;

int main(){
    int N;
    cin >> N;
    int array[N];
    for(int i=0;i<N;i++){
        cin >> array[i];
    }
    double d;
    
}

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

#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <string>
using namespace std;

int main(){
  int n;
  std::cin>>n;
  std::vector<double> v(n);
  for(int i = 0;i<n;i++){
    std::cin >> v[i];
  }
  std::sort(v.begin(), v.end() );
  for(int i=0;i<n-1;i++){
    v[i+1] = (v[i] + v[i+1])/2.0;
  }
  std::cout << v[n-1] << '\n';
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:8: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   16 |   std::sort(v.begin(), v.end() );
      |        ^~~~
      |        qsort
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int a[100],j;
	double k;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
	}
	for(int i=1;i<n;i++)
	{
		j=i;
		temp=a[i];
		while(j>0;temp<a[j-1])
		{
			a[j]=a[j-1];
			j--;
		}
		a[j]=temp;
	}
	k=a[0];
	for(int i=1;i<n;i++)
	{
		k=(k+a[i])/2;
	}
	cout<<k;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:14: error: 'n' was not declared in this scope
    7 |         cin>>n;
      |              ^
a.cc:15:17: error: 'temp' was not declared in this scope; did you mean 'tm'?
   15 |                 temp=a[i];
      |                 ^~~~
      |                 tm
a.cc:16:26: error: expected ')' before ';' token
   16 |                 while(j>0;temp<a[j-1])
      |                      ~   ^
      |                          )
Language: C++

import sys
from heapq import *
input = sys.stdin.readline

def main():
    """ main """
    N = int(input())
    VS = list(map(int, input().split()))
    heapify(VS)
    for _ in range(N-1):
        a, b = heappop(VS), heappop(VS)
        new_item = (a+b)/2
        heappush(VS, new_item)
    print(VS[0])

if __name__ == '__main__':
    main()

Compiler output:
a.cc:16:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
   16 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:1:1: error: 'import' does not name a type
    1 | import sys
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
   int t;
  cin >> t;
  int a[t];
  for (int i =0 ;i < t; i++){
    cin >> a[i];
  }
  
  sort(a,a+t);
  double rtr = t[0];
  for (int i = 1; i < t; i++){
    rtr = (rtr + t[i])/2;
  }
  
  cout << rtr;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |   double rtr = t[0];
      |                 ^
a.cc:15:19: error: invalid types 'int[int]' for array subscript
   15 |     rtr = (rtr + t[i])/2;
      |                   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main(){
   int t;
  cin >> t;
  int[t] a;
  for (int i =0 ;i < t; i++){
    cin >> a[i];
  }
  
  sort(a,a+t);
  double rtr = t[0];
  for (int i = 1; i < t; i++){
    rtr = (rtr + t[i])/2;
  }
  
  cout << rtr;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:6: error: structured binding declaration cannot have type 'int'
    7 |   int[t] a;
      |      ^~~
a.cc:7:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:7:7: error: conflicting declaration 'auto t'
    7 |   int[t] a;
      |       ^
a.cc:5:8: note: previous declaration as 'int t'
    5 |    int t;
      |        ^
a.cc:7:10: error: expected initializer before 'a'
    7 |   int[t] a;
      |          ^
a.cc:9:12: error: 'a' was not declared in this scope
    9 |     cin >> a[i];
      |            ^
a.cc:12:8: error: 'a' was not declared in this scope
   12 |   sort(a,a+t);
      |        ^
a.cc:13:17: error: invalid types 'int[int]' for array subscript
   13 |   double rtr = t[0];
      |                 ^
a.cc:15:19: error: invalid types 'int[int]' for array subscript
   15 |     rtr = (rtr + t[i])/2;
      |                   ^
Language: C++

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

int main(){
   int t;
  cin >> t;
  int[t] a;
  for (int i =0 ;i < t; i++){
    cin >> a[i];
  }
  
  sort(a,a+t);
  double rtr = t[0];
  for (int i = 1; i < t; i++){
    rtr = (rtr + t[i])/2;
  }
  
  cout << rtr;
}

Compiler output:
a.cc:1:9: fatal error: bits/stdc++: No such file or directory
    1 | #include<bits/stdc++>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
using namespace std;

void bsort(double a[], int n)
{
	for (int i = 0; i < n - 1; i++) {
		for (int j = n - 1; j > i; j--) {
			if (a[j - 1] > a[j]) {
				int temp = a[j];
				a[j] = a[j - 1];
				a[j - 1] = temp;
			}
		}
	}
}

int main()
{
	int N = 0;
	double v[1000] = { 0 };
	double res = 0;

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

	bsort(v, N);

	res += v[0] / pow(2, N - 1);
	for (int i = 1; i < N; i++) {
		res += v[i] / pow(2, N - i);
	}
	
	cout << res;

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:30:23: error: 'pow' was not declared in this scope
   30 |         res += v[0] / pow(2, N - 1);
      |                       ^~~
Language: C++

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

int main() {
  int N;
  cin >> N;
  vector<double> A(N);
  double ans=0;
  for (int i=0; i<N; i++) {
  	cin >> A.at(i);
  }
  sort(A.begin(), A.end());
  for (int i=0; i<N-1; i++) {
    ans += A.at(i)/(2)**(N-i+1);
  }
  cout << ans << endl;
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: invalid type argument of unary '*' (have 'int')
   14 |     ans += A.at(i)/(2)**(N-i+1);
      |                        ^~~~~~~~
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		float array[] = new float[2 * n - 1];
		for (int i = 0; i < n; i++) {
			array[i] = scan.nextInt();
		}
		if (n == 1) {
			System.out.print(array[n-1]);
		} else {
			for (int i = 0; i < n - 1; i++) {
				Arrays.sort(array);
				array[i] = (array[n + i - 1] + array[n + i]) / 2;
				array[n - 1] = 0;
				array[n] = 0;
			}
			System.out.print(array[n - 2]);
		}

	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner scan = new Scanner(System.in);
		                   ^
  symbol:   class Scanner
  location: class Main
Main.java:13: error: cannot find symbol
				Arrays.sort(array);
				^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include <iostream>
#include <vector>

int main(int argc, char** argv)
{
    int N;
    std::cin >> N;
    std::vector<double> values;
    for (int i = 0; i < N; ++i) {
        double V;
        std::cin >> V;
        values.push_back(V);
    }

    std::sort(std::begin(values), std::end(values));

    double x = values[0];
    for (int i = 1; i < N; ++i) {
        double y = values[i];
        x = (x + y) * 0.5; 
    }

    std::cout << std::int(x) << std::endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:10: error: 'sort' is not a member of 'std'; did you mean 'qsort'?
   15 |     std::sort(std::begin(values), std::end(values));
      |          ^~~~
      |          qsort
a.cc:23:23: error: expected unqualified-id before 'int'
   23 |     std::cout << std::int(x) << std::endl;
      |                       ^~~
Language: Java

public class Main{
	 public static void main(String[] args) {
	        Scanner scan = new Scanner(System.in);
	        int n=scan.nextInt();
	        float array[]=new float[2*n-1];
	        for(int i=0;i<n;i++){
	        	array[i]=scan.nextInt();
	        }
	        for(int i=0;i<n-1;i++){
	            Arrays.sort(array);
	            array[i]=(array[2*n-2]+array[2*n-3])/2;
	            array[2*n-2]=0;
	            array[2*n-3]=0;
	        }
	        System.out.print(array[n-2]);
	    }
	}

Compiler output:
Main.java:3: error: cannot find symbol
	        Scanner scan = new Scanner(System.in);
	        ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
	        Scanner scan = new Scanner(System.in);
	                           ^
  symbol:   class Scanner
  location: class Main
Main.java:10: error: cannot find symbol
	            Arrays.sort(array);
	            ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

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

int main(){
	int n;cin >> n;
  	vector<int> a;
  	while(n--){int x;cin >> x;a.push_back(x);}
  	sort(a.begin(),a.end());
  	int best = 0;
  	do{
      	int now = a[0];
    	for(auto i : a){now = (i+now)/2;}
      	best = max(best,now);
    }while(next_permutation(a.begin(),a.end());
	cout << fixed << setprecision(6) << best << "\n";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:47: error: expected ')' before ';' token
   14 |     }while(next_permutation(a.begin(),a.end());
      |           ~                                   ^
      |                                               )
Language: Java

 
package problemsolving;
 
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main2 {
     public static void main(String[]args){
         Scanner scan = new Scanner(System.in);
         int x = scan.nextInt();
         double arr[] = new double[x];
         for(int i = 0 ; i < x ;i++){
             arr[i] = scan.nextInt();
         }
         Arrays.sort(arr);
         for(int i = 0 ;i<x-1 ; i++){
             
             arr[i+1] = (arr[i] + arr[i+1])/2 ;
         }
         if(arr[arr.length-1]  - (int)arr[arr.length-1] == 0 ){
             System.out.println((int)arr[arr.length-1]);
         }else{
         System.out.println(arr[arr.length-1]);
     
         }
     }
}


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

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

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> n;
  	vector<int> v(n, 0);
  	rep(i, n) cin >> v[i];
  	
  	sort(all(v));
  	
  	float ans = v[0];
  	Rep(i,1, n){
      ans += v[i];
      ans /= 2;
    }
  	
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'Rep' was not declared in this scope; did you mean 'rep'?
   18 |         Rep(i,1, n){
      |         ^~~
      |         rep
Language: C++

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

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> n;
  	vector<int> v(n) = {0};
  	rep(i, n) cin >> v[i];
  	
  	sort(all(v));
  	
  	float ans = v[0];
  	Rep(i,1, n){
      ans += v[i];
      ans /= 2;
    }
  	
  	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ',' or ';' before '=' token
   12 |         vector<int> v(n) = {0};
      |                          ^
a.cc:18:9: error: 'Rep' was not declared in this scope; did you mean 'rep'?
   18 |         Rep(i,1, n){
      |         ^~~
      |         rep
Language: C++

#include <iostream>


int main(void)｛
int N;
int v[100];
int result;

std :: cin >> N;
for(int i=0;i<N;i++)｛
std :: cin >> v[i];
if(i > 1)｛
result = (v[i]+v[i - 1])/2;
｝
｝

Compiler output:
a.cc:4:15: error: expected initializer before '\U0000ff5b'
    4 | int main(void)｛
      |               ^~
a.cc:9:8: error: 'cin' in namespace 'std' does not name a type
    9 | std :: cin >> N;
      |        ^~~
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:10:1: error: expected unqualified-id before 'for'
   10 | for(int i=0;i<N;i++)｛
      | ^~~
a.cc:10:13: error: 'i' does not name a type
   10 | for(int i=0;i<N;i++)｛
      |             ^
a.cc:10:17: error: 'i' does not name a type
   10 | for(int i=0;i<N;i++)｛
      |                 ^
a.cc:12:1: error: expected unqualified-id before 'if'
   12 | if(i > 1)｛
      | ^~
a.cc:14:1: error: '\U0000ff5d' does not name a type
   14 | ｝
      | ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    sort(v.begin(),v.end();
    double ans = v[0];
    for(int i=1;i < n; i++)ans = (ans+v[i])/2;
    cout<<"ans"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: expected ')' before ';' token
   10 |     sort(v.begin(),v.end();
      |         ~                 ^
      |                           )
Language: C++


#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
template<typename T>
void vprint(std::vector<T>& vector)
{
  int len = int(vector.size());
  for(int i =0;i<len;i++){
    cout << vector[i] <<",";
  }
  cout <<endl;
}

double mean(double x,double y){
  return (x +y)/2;
}

int main(){
  int N;
  cin >> N;
  std::vector<double> v(N);
  for(int i = 0;i<N;i++)cin >>v[i]; 
  double sum = 0.0;
  for(int i = 0;i<N;i++)sum += v[i];
  cout << sum;
//   // vprint(v);
//   // sort(v.begin(),v.end());
//   // vprint(v);
//   // remove(v,0);
//   // vprint(v);
//   // double x,y;
//   // for(int i = 0;i<N-1;i++){
//   //   x = v[0];
//   //   y = v[1];
//   //   v[1] = (x + y)/2.0;
//   //   remove(v,0);
//   // }
//   sort(v.begin(),v.end());
//   double val = 0.0;
//   int index;
//   for(int i =1;i <= N-1;i++){
//     index = N - i;
//     if(i == 1){
//       val = (v[0] +v[1]) /pow(2,index);
//     }else{
//       val += v[i]/pow(2,index);
//     }
//   }
//   vprint(v);
  printf("%f",val);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:15: error: 'val' was not declared in this scope
   62 |   printf("%f",val);
      |               ^~~
Language: C++

#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}
template<typename T>
void vprint(std::vector<T>& vector)
{
  int len = int(vector.size());
  for(int i =0;i<len;i++){
    cout << vector[i] <<",";
  }
  cout <<endl;
}

double mean(double x,double y){
  return (x +y)/2;
}

int main(){
  int N;
  cin >> N;
  std::vector<double> v(N);
  for(int i = 0;i<N;i++)cin >>v[i];
  // vprint(v);
  // sort(v.begin(),v.end());
  // vprint(v);
  // remove(v,0);
  // vprint(v);
  sort(v.begin(),v.end());
  double x,y;
  for(int i = 0;i<N-1;i++){
    x = v[0];
    y = v[1];
    v[1] = (x + y)/2.0;
    remove(v,0);
  }
  // double val = 0.0;
  // int index;
  // for(int i =1;i <= N-1;i++){
  //   index = N - i;
  //   if(i == 1){
  //     val = (v[0] +v[1]) /pow(2,index);
  //   }else{
  //     val = v[i]/pow(2,index);
  //   }
  // }
  cout << val;  
  return 0;
}

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

#include <iostream>

void Swap(float& a, float& b)
{
	float temp = a;
	a = b;
	b = temp;
	
}
void InsertSor(float src[],int n)
{
	
	for (int i = 1; i < n; ++i)
	{
		for (int j = i; j >= 1; --j)
		{
			Swap(src[i], src[j]);
		}
	}
}


int main()
{

	int N;
	std::cin >> N;
	float* ana;
	ana = new float[N];
	for (int i = 0; i < N; i++)
	{
		std::cin >> ana[i];
	}
	/*
	for (int i = 0; i < N-1; ++i)
	{
		InsertSor(ana, N - i );
		float new_gu = (ana[N-i-1] + ana[N-i-2]) / 2.0;
		ana[N-i-2] = new_gu;

	}
	std::cout << ana[0];
*/
	InsertSor(ana, N);
	double sum=ana[N-1]/pow(2,N-1);
	for (int i = N-2; i >-1;--i)
	{

		sum += ana[i]/(pow(2,i+1));
	}
	std::cout << sum;
	delete[] ana;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:45:29: error: 'pow' was not declared in this scope
   45 |         double sum=ana[N-1]/pow(2,N-1);
      |                             ^~~
Language: C++

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

#include <bits/stdc++.h>


using namespace std;

#define INPUT_INT(valName) int valName; cin >> valName;
#define INPUT_STR(valName) string valName; cin >> valName;
#define INPUT_LINE(valName) string valName; getline(cin,s);
#define INPUT_VECTOR_INT(valName, N) vector<int> valName(N); for(int i=0; i < N; ++i) { cin >> valName[i]; }
#define INPUT_VECTOR_DOUBLE(valName, N) vector<double> valName(N); for(int i=0; i < N; ++i) { cin >> valName[i]; }

#define OUTPUT(A) cout << (A) << endl;
#define OUTPUT2(A, B) cout << (A) << " " << (B) << endl;
#define OUTPUT3(A, B, C) cout << (A) << " " << (B) << " " << (C) << endl;

#define REP(valName, N) for(int valName = 0; valName < N; ++valName)

vector<string> split(const string &str, char delimiter) {
	vector<string> ret;
	string tmp = "";
	for (auto c : str) {
		if (c != delimiter) {
			tmp.push_back(c);
		} else {
			ret.push_back(tmp);
			tmp = "";
		}
	}
	ret.push_back(tmp);
	return ret;
}

template <typename T> void sortAsc(vector<T>& v) { sort(v.begin(), v.end(), less<T>()); }
template <typename T> void sortDesc(vector<T>& v) { sort(v.begin(), v.end(), greater<T>()); }


int main() {

	INPUT_INT(N);
	INPUT_VECTOR_DOUBLE(v, N);

	sortDesc(v);
	while (v.size() > 1) {
		v[0] = (v[0] + v[1]) / 2.0;
		v.erase(v.begin+1);
	}

	OUTPUT(v[0]);

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:48:32: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator+'
   48 |                 v.erase(v.begin+1);
      |                         ~~~~~~~^~
      |                           |     |
      |                           |     int
      |                           <unresolved overloaded function type>
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  int N;
  cin >> N;
  
  double v[N]
  for(int i=0;i<M;i++){
    cin >> v[i];
  }
  
  sort(v,v+N);

  double tmp = (v[0] + v[1])/2.0;
  double sum = 0.0;
  for(int i=3;i<N;i++){
    sum = (tmp + v[i])/2.0;
  }

  cout << sum << endl;
  return 0;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: expected initializer before 'for'
   10 |   for(int i=0;i<M;i++){
      |   ^~~
a.cc:10:15: error: 'i' was not declared in this scope
   10 |   for(int i=0;i<M;i++){
      |               ^
a.cc:10:17: error: 'M' was not declared in this scope
   10 |   for(int i=0;i<M;i++){
      |                 ^
a.cc:14:8: error: 'v' was not declared in this scope
   14 |   sort(v,v+N);
      |        ^
Language: Java

class Main {	
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] v = new int[N];
        for (int i = 0; i < N; i++) {
        	v[i] = sc.nextInt();
        }
        Arrays.sort(v);
        double x = (v[0] + v[1]) / 2;
        for (int i = 2; i < N; i++) {
        		x = (v[i] + x) / 2;
        	}
        System.out.println(x);
    }
}

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
Main.java:9: error: cannot find symbol
        Arrays.sort(v);
        ^
  symbol:   variable Arrays
  location: class Main
3 errors
Language: C++

#include<bits/stdc++.h>

using namespace std;

int main() {
  int n, x;
  cin >> n;
  vector<int> data(n);
  priority_queue<int, vector<int>, greater<int> > pq;
  for (int i = 0; i < n; i++) {
    cin >> x;
    pq.push(x);
  }
  double res = 0;
  while (!pq.empty()) {
    x = pq.top();
    pq.pop();
    if (res == 0) {
      res = x;
    } else {
      res = (res + x) / 2; 
  }
  cout << res << endl;
  return 0;
}

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

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

int main() {
	// your code goes here
	long long int n;
	cin>>n;
	long long int arr[n],i;
	double s;
	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}
	sort(arr,arr+n);
	//s=(arr[0]+arr[1])/2;
	s=(double)arr[0];
	for(i=0;i<n;i++)
	{
		s=((double)(s+arr[i])/2;
	}
	cout<<s<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:40: error: expected ')' before ';' token
   19 |                 s=((double)(s+arr[i])/2;
      |                   ~                    ^
      |                                        )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  double *arr = new double[n];
  int i=0;
  for(i=0;i<n;i++){
   cin>>arr[i]; 
  }
  sort(arr,arr+n);
  i=0;
  double su=0;
  while(n!=1){
    i=0;
    sum =0;
    while(i<n){
     sum = arr[i];
      if(i+1<n){
        sum+= arr[i+1];
        arr[i] = sum/2;
        i+=2;
      }else{
        arr[i] = sum;
        i+=1;
      }
    }
    n = i;
  }
  cout<<arr[0]<<endl;
  delete []arr;
 return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'sum' was not declared in this scope; did you mean 'su'?
   16 |     sum =0;
      |     ^~~
      |     su
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<long double> V(n);
  for (int i = 0; i < n; ++i){
  	cin >> V[i];
  }
  sort(V.begin(), V.end());
  long double factor = 2;
  long double max = V[n-1]/2;
  for (int i = n - 2; i >= 0; --i){
  	if (i != 0) factor *= 2;
    max += V[i]/factor;
  }
  cout << max;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<long double> V(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'long'
    7 |   vector<long double> V(n);
      |          ^~~~
a.cc:9:16: error: 'V' was not declared in this scope
    9 |         cin >> V[i];
      |                ^
a.cc:11:8: error: 'V' was not declared in this scope
   11 |   sort(V.begin(), V.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(V.begin(), V.end());
      |   ^~~~
      |   short
Language: C

#include<stdio.h>
void mergesort(double v[],int left,int right)
{
  int temp[50];
  int mid,i,j,k;
  if(left>=right)
    return;
  mid=(left+right)/2;
  mergesort(v,left,mid);
  mergesort(v,mid+1,right);
  for(i=left;i<=mid;i++)
    temp[i]=v[i];
  for(i=mid+1,j=right;i<=right;i++,j--)
    temp[i]=v[j];
  i=left;
  j=right;
  for(k=left;k<=right;k++)
  {
    if(temp[i]<=temp[j])
      v[k]=temp[i++];
    else
      v[k]=temp[j--];
  }
void main(void)
{
  int N,i;
  scanf("%d",&N);
  double v[N];
  for(i=0;i<N;i++)
    scanf("%lf",&v[i]);
  mergesort(v,0,N-1);
  for(i=0;i<N-1;i++)
    v[i+1]=(v[i]+v[i+1])/2;
  printf("%lf",v[N-1]);
}

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

#include<stdio.h>
void mergesort(int v[],int left,int right)
{
  int temp[50];
  int mid,i,j,k;
  if(left>=right)
    return;
  mid=(left+right)/2;
  mergesort(v,left,mid);
  mergesort(v,mid+1,right);
  for(i=left;i<=mid;i++)
    temp[i]=v[i];
  for(i=mid+1,j=right;i<=right;i++,j--)
    temp[i]=v[j];
  i=left;
  j=right;
  for(k=left;k<=right;k++)
  {
    if(temp[i]<=temp[j])
      v[k]=temp[i++];
    else
      v[k]=temp[j--];
  }
void main(void)
{
  int N,i;
  scanf("%d",&N);
  double v[N];
  for(i=0;i<N;i++)
    scanf("%lf",&v[i]);
  mergesort(v,0,N-1);
  for(i=0;i<N-1;i++)
    v[i+1]=(v[i]+v[i+1])/2;
  printf("%lf",v[N-1]);
}

Compiler output:
main.c: In function 'main':
main.c:31:13: error: passing argument 1 of 'mergesort' from incompatible pointer type [-Wincompatible-pointer-types]
   31 |   mergesort(v,0,N-1);
      |             ^
      |             |
      |             double *
main.c:2:20: note: expected 'int *' but argument is of type 'double *'
    2 | void mergesort(int v[],int left,int right)
      |                ~~~~^~~
main.c: In function 'mergesort':
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C

#include<stdio.h>
void mergesort(int v[],int left,int right)
{
  int temp[50];
  int mid,i,j,k;
  if(left>=right)
    return;
  mid=(left+right)/2;
  mergesort(v,left,mid);
  mergesort(v,mid+1,right);
  for(i=left;i<=mid;i++)
    temp[i]=v[i];
  for(i=mid+1,j=right;i<=right;i++,j--)
    temp[i]=v[j];
  i=left;
  j=right;
  for(k=left;k<=right;k++)
  {
    if(temp[i]<=temp[j])
      v[k]=temp[i++];
    else
      v[k]=temp[j--];
  }
int main()
{
  int N,i;
  scanf("%d",&N);
  double v[N];
  for(i=0;i<N;i++)
    scanf("%lf",&v[i]);
  mergesort(v,0,N-1);
  for(i=0;i<N-1;i++)
    v[i+1]=(v[i]+v[i+1])/2;
  printf("%lf",v[N-1]);
}

Compiler output:
main.c: In function 'main':
main.c:31:13: error: passing argument 1 of 'mergesort' from incompatible pointer type [-Wincompatible-pointer-types]
   31 |   mergesort(v,0,N-1);
      |             ^
      |             |
      |             double *
main.c:2:20: note: expected 'int *' but argument is of type 'double *'
    2 | void mergesort(int v[],int left,int right)
      |                ~~~~^~~
main.c: In function 'mergesort':
main.c:35:1: error: expected declaration or statement at end of input
   35 | }
      | ^
Language: C

#include<stdio.h>
int temp[50];
void mergesort(int v[],int left,int right)
{
  int mid,i,j,k;
  if(left>=right)
    return;
  mid=(left+right)/2;
  mergesort(v,left,mid);
  mergesort(v,mid+1,right);
  for(i=left;i<=mid;i++)
    temp[i]=v[i];
  for(i=mid+1,j=right;i<=right;i++,j--)
    temp[i]=v[j];
  i=left;
  j=right;
  for(k=left;k<=right;k++)
  {
    if(temp[i]<=temp[j])
      v[k]=temp[i++];
    else
      v[k]=temp[j--];
  }
int main()
  int N,i;
  scanf("%d",&N);
  double v[N];
  for(i=0;i<N;i++)
  {
    scanf("%lf",&v[i]);
  }
  mergesort(v,0,N-1);
  for(i=0;i<N-1;i++)
  {
    v[i+1]=(v[i]+v[i+1])/2;
  }
  printf("%lf",v[N-1]);
}

Compiler output:
main.c: In function 'main':
main.c:26:3: error: expected declaration specifiers before 'scanf'
   26 |   scanf("%d",&N);
      |   ^~~~~
main.c:28:3: error: expected declaration specifiers before 'for'
   28 |   for(i=0;i<N;i++)
      |   ^~~
main.c:28:11: error: expected declaration specifiers before 'i'
   28 |   for(i=0;i<N;i++)
      |           ^
main.c:28:15: error: expected declaration specifiers before 'i'
   28 |   for(i=0;i<N;i++)
      |               ^
main.c:32:3: error: expected declaration specifiers before 'mergesort'
   32 |   mergesort(v,0,N-1);
      |   ^~~~~~~~~
main.c:33:3: error: expected declaration specifiers before 'for'
   33 |   for(i=0;i<N-1;i++)
      |   ^~~
main.c:33:11: error: expected declaration specifiers before 'i'
   33 |   for(i=0;i<N-1;i++)
      |           ^
main.c:33:17: error: expected declaration specifiers before 'i'
   33 |   for(i=0;i<N-1;i++)
      |                 ^
main.c:37:3: error: expected declaration specifiers before 'printf'
   37 |   printf("%lf",v[N-1]);
      |   ^~~~~~
main.c:38:1: error: expected declaration specifiers before '}' token
   38 | }
      | ^
main.c:27:10: error: declaration for parameter 'v' but no such parameter
   27 |   double v[N];
      |          ^
main.c:25:9: error: declaration for parameter 'i' but no such parameter
   25 |   int N,i;
      |         ^
main.c:25:7: error: declaration for parameter 'N' but no such parameter
   25 |   int N,i;
      |       ^
main.c:39: error: expected '{' at end of input
main.c: In function 'mergesort':
main.c:38:1: error: expected declaration or statement at end of input
   38 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N;
  double v[N];
  cin >> N;
  for(int i=0;i<N;i++) cin >> v[i];
  qsort(v, N, sizeof *v, [](const double* a, const double* b)
  {
    if(a < b) return -1;
    if(a > b) return 1;
    return 0;
  });
    
  double ans = v[0];
  for(int i=1;i<N;i++) ans = (ans+v[i])/2.0;
  cout << ans <<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:26: error: invalid user-defined conversion from 'main()::<lambda(const double*, const double*)>' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'} [-fpermissive]
    8 |   qsort(v, N, sizeof *v, [](const double* a, const double* b)
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    9 |   {
      |   ~                       
   10 |     if(a < b) return -1;
      |     ~~~~~~~~~~~~~~~~~~~~  
   11 |     if(a > b) return 1;
      |     ~~~~~~~~~~~~~~~~~~~   
   12 |     return 0;
      |     ~~~~~~~~~             
   13 |   });
      |   ~                       
a.cc:8:26: note: candidate is: 'constexpr main()::<lambda(const double*, const double*)>::operator int (*)(const double*, const double*)() const' (near match)
    8 |   qsort(v, N, sizeof *v, [](const double* a, const double* b)
      |                          ^
a.cc:8:26: note:   no known conversion from 'int (*)(const double*, const double*)' to '__compar_fn_t' {aka 'int (*)(const void*, const void*)'}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:971:34: note:   initializing argument 4 of 'void qsort(void*, size_t, size_t, __compar_fn_t)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

    #include<bits/stdc++.h>
    using namespace std;
    typedef long ll;
    int main()
    {
      ll n; cin>>n;
      ll double a[n];
      for(int i = 0 ; i < n ; i++)
        cin>>a[i];
      sort(a,a+n);
      ll ans = 0;
      for(int i = 1; i < n ; i++)
      {
        a[0]+=a[i];
        a[0]/=2;
      }
      cout<<a[0]<<endl;
      
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:7: error: two or more data types in declaration of 'a'
    7 |       ll double a[n];
      |       ^~
a.cc:9:14: error: 'a' was not declared in this scope
    9 |         cin>>a[i];
      |              ^
a.cc:10:12: error: 'a' was not declared in this scope
   10 |       sort(a,a+n);
      |            ^