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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: request for member 'begin' in 'v', which is of non-class type 'double [N]'
   13 |     sort(v.begin() , v.end());
      |            ^~~~~
a.cc:13:24: error: request for member 'end' in 'v', which is of non-class type 'double [N]'
   13 |     sort(v.begin() , v.end());
      |                        ^~~
a.cc:16:16: error: 'nas' was not declared in this scope; did you mean 'ans'?
   16 |         ans = (nas + v[i]) / 2;
      |                ^~~
      |                ans
Language: C++

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

int main(){

    int N;
    cin >> N;

    vector<double> v(N);
    for (size_t i = 0; i < N; i++)
    {
        cin >> v[i];
    }
    sort(v.begin(),v.end());
    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:15:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |     ans = v[0];
      |     ^~~
      |     abs
Language: C

#include<stdio.h>
void swap(*a,*b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;  
return;  
}


int main(void)
{
int a,i,b,j;
  scanf("%d",&a);
int num[a];
  for(i=0;i<a;++i)
  {
  scanf("%d",&num[i]);
  }
  b=a;
  for(i=1;i<a;++i)
  {
    for(j=1;j<b;++j)
    {
    if(num[j-1]>num[j]) swap(&num[j-1],&num[j]);
    } 
   b--; 
  } 
float ans[a-1];
  ans[0]=(num[0]+num[1])/2;
  
  for(i=0;i<a-2;++i)
  {
  ans[i+1]=(ans[i]+num[i+2])/2;
  }
  
  printf("%f",ans[a-1]);

return 0;
}

Compiler output:
main.c:2:11: error: expected declaration specifiers or '...' before '*' token
    2 | void swap(*a,*b)
      |           ^
main.c:2:14: error: expected declaration specifiers or '...' before '*' token
    2 | void swap(*a,*b)
      |              ^
main.c: In function 'main':
main.c:26:25: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   26 |     if(num[j-1]>num[j]) swap(&num[j-1],&num[j]);
      |                         ^~~~
Language: C

#include<stdio.h>
int void swap(*a,*b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;  
return;  
}


int main(void)
{
int a,i,b,j;
  scanf("%d",&a);
int num[a];
  for(i=0;i<a;++i)
  {
  scanf("%d",&num[i]);
  }
  b=a;
  for(i=1;i<a;++i)
  {
    for(j=1;j<b;++j)
    {
    if(num[j-1]>num[j]) swap(&num[j-1],&num[j]);
    } 
   b--; 
  } 
float ans[a-1];
  ans[0]=(num[0]+num[1])/2;
  
  for(i=0;i<a-2;++i)
  {
  ans[i+1]=(ans[i]+num[i+2])/2;
  }
  
  printf("%f",ans[a-1]);

return 0;
}

Compiler output:
main.c:2:5: error: two or more data types in declaration specifiers
    2 | int void swap(*a,*b)
      |     ^~~~
main.c:2:15: error: expected declaration specifiers or '...' before '*' token
    2 | int void swap(*a,*b)
      |               ^
main.c:2:18: error: expected declaration specifiers or '...' before '*' token
    2 | int void swap(*a,*b)
      |                  ^
main.c: In function 'main':
main.c:26:25: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   26 |     if(num[j-1]>num[j]) swap(&num[j-1],&num[j]);
      |                         ^~~~
Language: C

#include<stdio.h>
int void swap(*a,*b)
{
int temp;
temp=*a;
*a=*b;
*b=temp;  
return;  
}


int main()
{
int a,i,b,j;
  scanf("%d",&a);
int num[a];
  for(i=0;i<a;++i)
  {
  scanf("%d",&num[i]);
  }
  b=a;
  for(i=1;i<a;++i)
  {
    for(j=1;j<b;++j)
    {
    if(num[j-1]>num[j]) swap(&num[j-1],&num[j]);
    } 
   b--; 
  } 
float ans[a-1];
  ans[0]=(num[0]+num[1])/2;
  
  for(i=0;i<a-2;++i)
  {
  ans[i+1]=(ans[i]+num[i+2])/2;
  }
  
  printf("%f",ans[a-1]);

return 0;
}

Compiler output:
main.c:2:5: error: two or more data types in declaration specifiers
    2 | int void swap(*a,*b)
      |     ^~~~
main.c:2:15: error: expected declaration specifiers or '...' before '*' token
    2 | int void swap(*a,*b)
      |               ^
main.c:2:18: error: expected declaration specifiers or '...' before '*' token
    2 | int void swap(*a,*b)
      |                  ^
main.c: In function 'main':
main.c:26:25: error: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
   26 |     if(num[j-1]>num[j]) swap(&num[j-1],&num[j]);
      |                         ^~~~
Language: C

#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    for(int i=0;i<n;i++)cin >> a[i];
    sort(a.begin(),a.end());
    double ans =a[0];
    for(int i=1;i<n;i++){
        ans = (ans + a[i])/2;
    }
    printf("%.5f\n",ans);
}


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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int_64 n;
  cin >> n;
  vector<double> vec(n);
  int64_t i;
  for(i=0;i<n;i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  double sum=vec.at(0)+vec.at(1);
  int64_t ni=2;
  for(i=2;i<n;i++){
    sum+=ni*vec.at(i);
    ni*=2;
  }
  cout << sum/ni;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:4:3: error: 'int_64' was not declared in this scope; did you mean 'rintf64'?
    4 |   int_64 n;
      |   ^~~~~~
      |   rintf64
a.cc:5:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    5 |   cin >> n;
      |          ^
      |          yn
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: expected ';' before 'i'
   12 |   for(int i=1 i<N-1;i++){
      |              ^~
      |              ;
Language: C++

#include<iostream>
#include<vector>
#include<stdlib.h>
#include<algorithm>
#include"cxx-prettyprint/prettyprint.hpp"
#include<math.h>
using namespace std;



int main(int argc,char *argv[]){
    
    int n;
    vector<double> v(50);
    double ans=0.0;

    cin>>n;
    for(int i=0;i<n;i++) cin>>v[i];
    sort(v.begin(),v.end(),greater<double>());
    
    for(int i=0;i<n;i++){
        if(i==n-1)ans+=v[i]/pow(2.0,(double)n-1.0);
        else ans+=v[i]/pow(2.0,(double)i+1.0);
    }
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc:5:9: fatal error: cxx-prettyprint/prettyprint.hpp: No such file or directory
    5 | #include"cxx-prettyprint/prettyprint.hpp"
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<stdlib.h>
#include<algorithm>
#include"cxx-prettyprint/prettyprint.hpp"
#include<math.h>
using namespace std;



int main(int argc,char *argv[]){
    
    int n;
    vector<double> v(50);
    double ans=0.0;

    cin>>n;
    for(int i=0;i<n;i++) cin>>v[i];
    sort(v.begin(),v.end(),greater<double>());
    
    for(int i=0;i<n;i++){
        ans+=v[i]/pow(2.0,(double)i+1.0);
    }
    cout<<ans<<endl;

    return 0;
}

Compiler output:
a.cc:5:9: fatal error: cxx-prettyprint/prettyprint.hpp: No such file or directory
    5 | #include"cxx-prettyprint/prettyprint.hpp"
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

 #include <algorithm>
 #include <string>

 using namespace std;

 #define ipair pair<int,int>
 #define rep(I,N) for(int I=0; I<N; I++)
 #define rrep(I,N) for(int I=N; I>=0; I--)
 #define repj(i,j,n) for(int i=j;i<n;i++)

 #define PB(a,i) (a).push_back(i)
 #define ALL(a) (a).begin(),(a).end()

 #define OK(i) cout<<"OK "<<i<<endl
 #define Yes cout<<"Yes"<<endl
 #define YES cout<<"YES"<<endl
 #define No cout<<"No"<<endl
 #define NO cout<<"NO"<<endl

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

   int v[1000];

   rep (i, N) {
     cin >> v[i];
   }

   std::sort(v, v + N);

   rep (i, N) {
     cout << v[i] << '\n';
   }


   double ans = v[0];
   repj(i, 1, N) {
     ans = (ans + v[i]) / 2.0;
   }

   printf("%lf\n", ans);

   return 0;
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:22:4: error: 'cin' was not declared in this scope
   22 |    cin >> N;
      |    ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 |  #include <string>
  +++ |+#include <iostream>
    3 | 
a.cc:33:6: error: 'cout' was not declared in this scope
   33 |      cout << v[i] << '\n';
      |      ^~~~
a.cc:33:6: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<double> L(N);
  for(int i=0; i<N; i++){
    cin>>L[i];
  }
  sort(L.begin(),L.end());
  double t=L[0];
  for(int i=0; i<N-1; i++){
     t=(t+L[i+1])/2;
  }
  cout<<t<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n;
  cin>>n;
  vector<int>v(n);
  vector<double>d(n);
  rep(i,n) cin>>v[i];
  rep(i,n-1){
    sort(v.begin(),v.end());
    d[i]=(v[0]+v[1])/=2;
  }
  cout<<fixed<<setprecision(5)<<d[n-2]<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:15: error: lvalue required as left operand of assignment
   23 |     d[i]=(v[0]+v[1])/=2;
      |          ~~~~~^~~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) cin >> v[i];
  sort(v.begin(),v.end());
  //doubleのサイズは8バイト
  double ans=v[0];
  for (int i=1;i<n;i++) ans = (ans+v[i])/2;
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   rep(i,n) cin >> v[i];
      |       ^
a.cc:2:23: note: in definition of macro 'rep'
    2 | #define rep(i,n) for (i=0;i<n;i++)
      |                       ^
Language: C++

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


}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: request for member 'begin' in 'v', which is of non-class type 'double [n]'
    9 |     sort(v.begin(),v.end());
      |            ^~~~~
a.cc:9:22: error: request for member 'end' in 'v', which is of non-class type 'double [n]'
    9 |     sort(v.begin(),v.end());
      |                      ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
  cout.setprecision(10);
  int n;
  cin >> n;
  double v[n];
  rep(i,n)cin>>v[i];
  sort(v,v+n);
  for(int i=1;i<n;i++){
    v[i]=(v[i]+v[i-1])/2;
  }
  cout << v[n-1] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:8: error: 'std::ostream' {aka 'class std::basic_ostream<char>'} has no member named 'setprecision'; did you mean 'std::streamsize std::ios_base::_M_precision'? (not accessible from this context)
    5 |   cout.setprecision(10);
      |        ^~~~~~~~~~~~
In file included from /usr/include/c++/14/streambuf:43,
                 from /usr/include/c++/14/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/14/iterator:66,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54,
                 from a.cc:1:
/usr/include/c++/14/bits/ios_base.h:578:25: note: declared protected here
  578 |     streamsize          _M_precision;
      |                         ^~~~~~~~~~~~
Language: C++

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		double[] v = new double[n];
		
		Arrays.setAll(v, i -> sc.nextDouble());
		Arrays.sort(v);
		
		double ave = (v[0] + v[1]) / 2.0;
		for (int i = 2; i < n; i++) {
			ave = (ave + v[i]) / 2.0;
		}
		
		System.out.println(ave);
		
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Arrays;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.util.Scanner;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

N = int(input())
V = list(map(int, input().split()))
V.sort()
m = V[0]
for i in range(1, N):
  m += (2**(i-1)) * V[i]
m /= 2**(N-1)
print(m)

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N = int(input())
      | ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: expected ';' before 'sort'
   11 |         for(int i = 0; i < n; i++) cin >> v[i]
      |                                               ^
      |                                               ;
   12 |         sort(v.begin(), v.end());
      |         ~~~~
Language: C++

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

int main()
{
  	int n;
    double ans;
  	vector<double> v;
  
  	cin >> n;
  	for(int i = 0; i < n; i++) cin >> v[i]
	sort(v);
  	ans = (v[0]+v[1])/2.0;
  	for(int i = 2; i < n; i++)
    {
      ans = (ans+v[1])/2.0;
    }
  	cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:47: error: expected ';' before 'sort'
   11 |         for(int i = 0; i < n; i++) cin >> v[i]
      |                                               ^
      |                                               ;
   12 |         sort(v);
      |         ~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

int main()
{
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  double ans = 0.5 * (v[0] + v[1]);
  rep(i, n) {
    if (i==0 || i==1) continue;
    ans = 0.5 * (ans+a[i]);
  }
  printf("%.10f", ans);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:22: error: 'a' was not declared in this scope
   21 |     ans = 0.5 * (ans+a[i]);
      |                      ^
Language: C++


#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;
// << fixed << setprecision(0) <<
// sort(ALL(),greater<int>());

int main() {
int n;
cin >> n;
int v[n];
int ans=0
REP(i,n) {
  cin >> v[i];
  ans+=v[i];
}
ans/=n;
cout << ans << endl;
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:4:19: error: expected ',' or ';' before 'for'
    4 | #define REP(i, n) for(int i = 0; i < (n); i++)
      |                   ^~~
a.cc:19:1: note: in expansion of macro 'REP'
   19 | REP(i,n) {
      | ^~~
a.cc:19:5: error: 'i' was not declared in this scope
   19 | REP(i,n) {
      |     ^
a.cc:4:34: note: in definition of macro 'REP'
    4 | #define REP(i, n) for(int i = 0; i < (n); i++)
      |                                  ^
Language: Java

import java.util.Arrays;
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] indegrients = new int[n];
    for(int i = 0; i < n; i++){
      indegrients[i] = Integer.parseInt(i);
    }
    Arrays.sort(indegrients);
    for(int i = 0; i < n - 1; i++){
      indegrients[i + 1] = (indegrients[i] + indegrients[i + 1]) / 2;
    }
    System.out.println(indegrients[n - 1]);
  }
}

Compiler output:
Main.java:9: error: incompatible types: int cannot be converted to String
      indegrients[i] = Integer.parseInt(i);
                                        ^
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] indegrients = new int[n];
    for(int i = 0; i < n; i++){
      indegrients[i] = Integer.parseInt(i);
    }
    Arrays.sort(indegrients);
    for(int = 0; i < n - 1; i++){
      indegrients[i + 1] = (indegrients[i] + indegrients[i + 1]) / 2;
    }
    System.out.println(indegrients[n - 1]);
  }
}

Compiler output:
Main.java:12: error: not a statement
    for(int = 0; i < n - 1; i++){
        ^
Main.java:12: error: ';' expected
    for(int = 0; i < n - 1; i++){
           ^
Main.java:12: error: illegal start of expression
    for(int = 0; i < n - 1; i++){
            ^
Main.java:12: error: not a statement
    for(int = 0; i < n - 1; i++){
                   ^
Main.java:12: error: ')' expected
    for(int = 0; i < n - 1; i++){
                          ^
Main.java:12: error: ';' expected
    for(int = 0; i < n - 1; i++){
                               ^
6 errors
Language: C++

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

int main() {
    int n;
    cin >> n;
    priority_queue<double, vector<double>, greater<double>> q;
    rep(i,n) {
        double a;
        cin >> a;
        q.push(a);
    }

    double ans = 0;
    rep(i,n-1) {
        double q1 = q.top(); q.pop();
        double q2 = q.top(); q.pop();
        double q_mean = (q1 + q2) / 2;
        ans += q_mean;
        q.push(q_mean);
    }

    printf("%.10f",q.top())
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:28: error: expected ';' before 'return'
   24 |     printf("%.10f",q.top())
      |                            ^
      |                            ;
   25 |     return 0;
      |     ~~~~~~
Language: C++

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

int main() {
    int n;
    cin >> n;
    priority_queue<double, vector<double>, greater<double>> q;
    rep(i,n) {
        double a;
        cin >> a;
        q.push(a);
    }

    double ans = 0;
    rep(i,n-1) {
        double q1 = q.top(); q.pop();
        double q2 = q.top(); q.pop();
        double q_mean = (q1 + q2) / 2;
        ans += q_mean;
        q.push(q_mean);
    }

    printg("%.10f",q.top())
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'printg' was not declared in this scope; did you mean 'printf'?
   24 |     printg("%.10f",q.top())
      |     ^~~~~~
      |     printf
Language: C++

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

int main() {
    int n;
    cin >> n;
    auto v = vector<double>(n);
    for (auto &v_i : v)
        double v_i;

    while (v.size() >= 2) {
        sort(v.begin(), v.end(), greater<double>());
        auto a = v.back();
        v.pop_back();
        auto b = v.back();
        v.pop_back();
        v.push_back((a + b) * 0.5);
    }

    printf("%.10f\n", v.front());
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: redeclaration of 'double v_i'
   12 |         double v_i;
      |                ^~~
a.cc:11:16: note: 'double& v_i' previously declared here
   11 |     for (auto &v_i : v)
      |                ^~~
Language: C

#include <stdio.h>
int main(void) {
    
    int N;
    int v[50];
    int length = sizeof(v) / sizeof(int);
    
    for (int i = 0; i < length - 1; i++) {
        for (int j = length - 1; j > i; i--) {
            if (v[j] < v[j-1]) {
                int tmp = v[j];
                v[j] = v[j-1];
                v[j-1] = tmp;
            }
        }
    }
  
    float sum = (a[0] + a[1]) / 2;
    if(N = 2) {
      printf("%f", sum);
    } else {
      for(int i = 2; i < N -1; i++) {
        sum = (sum + a[i]) / 2;
      }
      printf("%f", sum);
    }
}

Compiler output:
main.c: In function 'main':
main.c:18:18: error: 'a' undeclared (first use in this function)
   18 |     float sum = (a[0] + a[1]) / 2;
      |                  ^
main.c:18:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(void) {
    int N;
    int a[50];
    int length = sizeof(a) / sizeof(int);
    int step, i, j;
    for(step = length / 2; step > 0; step /= 2) {
        for(i = step; i < length; i++){
            int tmp = a[i];
            int j = i;
            for(j = i; j >= step; j -= step) {
                if(a[j-step] > tmp) {
                    a[j] = a[j-step];
                } else {
                    break;
                }
            }
            a[j] = tmp;
        }
    
    float sum = (a[0] + a[1]) / 2;
    if(N = 2) {
      printf("%f", sum);
    } else {
      for(int i = 2; i < N -1; i++) {
        sum = (int)(sum + a[i]) / 2;
      }
      printf("%f", sum);
    }
      
    }

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

#include<stdio.h>
int main(void) {
    int N;
    int a[50];
    int length = sizeof(a) / sizeof(int);
    int step, i, j;
    for(step = length / 2; step > 0; step /= 2) {
        for(i = step; i < length; i++){
            int tmp = a[i];
            int j = i;
            for(j = i; j >= step; j -= step) {
                if(a[j-step] > tmp) {
                    a[j] = a[j-step];
                } else {
                    break;
                }
            }
            a[j] = tmp;
        }
    
    float sum = (a[0] + a[1]) / 2;
    if(N = 2) {
      printf("%f", sum);
    } else {
      for(int i = 2; i < N -1; i++) {
        sum = (int)(sum + a[i]) / 2;
      }
      printf("%f", sum);
    }

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

#include<stdio.h>
int main(void) {
    int N;
    int a[50];
    int length = sizeof(a) / sizeof(int);
    int step, i, j;
    for(step = length / 2; step > 0; step /= 2) {
        for(i = step; i < length; i++){
            int tmp = a[i];
            int j = i;
            for(j = i; j >= step; j -= step) {
                if(a[j-step] > tmp) {
                    a[j] = a[j-step];
                } else {
                    break;
                }
            }
            a[j] = tmp;
        }
    
    float sum = (a[0] + a[1]) / 2;
    if(N = 2) {
      printf("%d", sum);
    } else {
      for(int i = 2; i < N -1; i++) {
        sum = (int)(sum + a[i]) / 2;
      }
      printf("%d", sum);
    }
    }
      

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

#include <stdio.h>

int* bubbleSort(int* v, int N){
  
  int tmp;

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

int main(){
  int N;
  int v[50];
  
  scanf("%d",&N); 
  for(int i = 0; i < N; i++) {
    sanf("%d", &v[i]);
  }

  bubbleSort(v, N); // 小さいもの順に並べる
  
  double sum = (v[0] + v[1]) / 2;
    if(N >= 3) {
      for(int i = 2; i < N - 1; i++) {
        sum = (sum + v[i]) / 2;
      }
    }
    printf("%f", sum); 

}


Compiler output:
main.c: In function 'main':
main.c:25:5: error: implicit declaration of function 'sanf'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   25 |     sanf("%d", &v[i]);
      |     ^~~~
      |     scanf
Language: C

#include <stdio.h>
void quickSort(int *a, int startID, int endID) {
    int pivot = v[(int)((startID + endID) / 2)];
    int left = startID;
    int right = endID;

    while (1) {
        while (v[left] < pivot) {
            left++;
        }
        while (pivot < v[left]) {
            right--;
        }
        if (right <= left) {
            break;
        }
        int tmp = v[left];
        v[left] = v[right];
        v[right] = tmp;
        left++;
        right--;
    }

    if (startID < left - 1) {
        quickSort(v, startID, left - 1);
    }
    if (right + 1 < endID) {
        quickSort(v, right + 1, endID);
    }   
}

int main (void) {
    int N;
    int v[50];
    scanf("%d", &N);
    for(int i = 0; i < N; i++) {
      scanf("%d", &v[i]);
    }
    int length = sizeof(v) / sizeof(int);
    quickSort(v, 0, length - 1);
  
    int sum = (v[0] + v[1]) / 2;
    if(N >= 3) {
      for(int i = 2; i < N - 1; i++) {
        sum = (sum + v[i]) / 2;
      }
    }
    printf("%d", sum); 
}


Compiler output:
main.c: In function 'quickSort':
main.c:3:17: error: 'v' undeclared (first use in this function)
    3 |     int pivot = v[(int)((startID + endID) / 2)];
      |                 ^
main.c:3:17: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main()
{
  int n,tmp;
    double ans;
  vector<int> all;
  cin>>n;
  for(int i = 0;i<n;i++)
  {
    cin>>tmp;
    all.push_back(tmp);
  }
    sort(all.begin(),all.end());
    ans=all.at(0);
    for(int i = 1;i<all.size();i++)
{
    
    ans=(ans+all.at(i))/2.0;
}
  
  
  cout<<ans<<endl;
  return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define int double
int n,a[110001],sum;
signed main()
{    cin>>n;
	for(int i=1;i<=n;i++)
	{cin>>a[i];sum+=a[i];
	}
   printf("%5lf\n",sum/n);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: invalid types 'double [110001][double]' for array subscript
    8 |         {cin>>a[i];sum+=a[i];
      |                ^
a.cc:8:26: error: invalid types 'double [110001][double]' for array subscript
    8 |         {cin>>a[i];sum+=a[i];
      |                          ^
Language: C++

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

int main(){
    int n,res;
    cin >> n;
    vector<int> v(n);
    for(int i = 0;i < n;i++){
        cin >> v.at(i);
    }
    sort(v.begin(),v.end());
    res = v.at(0);
    for(int i = 1;i < n;i++){
        res = (res+v.at(i))/2;
    }
    cout << res << endl;
}

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

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

int main(){
    int n,res;
    cin >> n;
    vector<int> v(n);
    for(int i = 0;i < n;i++){
        cin >> v.at(i);
    }
    res = v.at(0);
    for(i = 1;i < n;i++){
        res = (res+v.at(i))/2;
    }
    cout << res << endl;
}

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

#include <iostream>
#include <vector>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> v;
  for (int i = 0; i < N; i++) {
    int V;
    cin >> V;
    v.push_back(V);
  }
  
  while (v.size() != 1) {
    vector<int> v2;
    sort(v.begin(), v.end());
    int res = 0;
    for (int i = 0; i < v.size()/2; i++) {
      v2.push_back((v[i] + v[v.size() - 1 - i]) / 2);
    }
    v = v2;
  }
  cout << res << endl;
}

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

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

int main() {
  int N;
  cin >> N;
  vector<int> v;
  for (int i = 0; i < N; i++) {
    int V;
    cin >> V;
    v.push_back(V);
  }
  sort(v.begin(), v.end());
  int res = 0;
  for (int i = 0; i < N/2; i++) {
    res += (v[i] + v[v.size() - 1 - i]) / 2
  }
  cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |   sort(v.begin(), v.end());
      |   ^~~~
      |   short
a.cc:17:44: error: expected ';' before '}' token
   17 |     res += (v[i] + v[v.size() - 1 - i]) / 2
      |                                            ^
      |                                            ;
   18 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
int main()
{
  int n;
  cin>>n;
  vector<int> v;
  for(int i=0;i<n;i++)
  {
    int a;
    cin>>a;
    v.push_back(a);
  }
  float f=0;
  sort(v.begin(),v.end());
  
  f=v[0];
  for(int i=1;i<n;i++)
  { f=(f+v[i])/2;
  }
  cout<<f;
}
    
  

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: 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:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> v;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> v;
      |          ^~~
a.cc:11:5: error: 'v' was not declared in this scope
   11 |     v.push_back(a);
      |     ^
a.cc:14:8: error: 'v' was not declared in this scope
   14 |   sort(v.begin(),v.end());
      |        ^
a.cc:14:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   14 |   sort(v.begin(),v.end());
      |   ^~~~
      |   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:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   cout<<f;
      |   ^~~~
      |   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;
const int N = 2e5 + 25, M = 1e6 + 25, oo = 1e9+7, mxmsk = 1 << 16;
const long long OO = 1e18+25;
    
#define par pair<pair<int,int>, int>
#define f first
#define s second

int c,d, a[N],b,n, t, e,mx;

int main() {
	scanf("%d",&n);
    for(int i=0; i<n; i++) scanf("%d",a+i);
    for(int i=1; <n; i++)
    {
        if(a[i] <= a[i-1]) c++;
        else c = 0;
        mx = max(c, mx);
    }
    printf("%d\n",mx);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected primary-expression before '<' token
   15 |     for(int i=1; <n; i++)
      |                  ^
Language: C++

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

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

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

#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  rep(i,n) {
    cin >> v[i];
  } 
  sort(v.begin(), v.end());
  double ans = v[0];
  for(int i = 1; i < n; i++) ans = (ans+v[i])/2;
  printf("%.10f\n", ans);
  return 0;

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

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

long long int n;
long double d[3000],dres=0;

int main() {
	cout << fixed << setprecision(10);
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>d[i];
    }
    sort(d,d+n);
    dres=(d[0]+d[1])/2.0;
    for(int i=2;i<n;i++){
        dres=(dres+d[i])/2.0;
    }
    cout<<dres<<endl;
    
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:9:26: error: 'setprecision' was not declared in this scope
    9 |         cout << fixed << setprecision(10);
      |                          ^~~~~~~~~~~~
a.cc:3:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    2 | #include<algorithm>
  +++ |+#include <iomanip>
    3 | using namespace std;
Language: C++

n = int(input())
li = list(map(int, input().split())) 
li.sort()
res=li[0]
for i in range(1,len(li)):
    res+=li[i]
    res/=2
print(res)


Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
Language: C++

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

#define int long long

signed main(){
  int n;
  cin >> n;
  
  int a[n+1];
  for(int i = 1;i<=n;i++)cin >> a[i];
  
  sort(a+1,a+n+1);
  int ans = a[1];
  
  for(int i = 2;i<=n;i++){
    ans = (ans+a[i])/2;
  }
  cout << ans << endl;
  
  return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
const int N=100;
int main()
{
    int n;
    double x[N];
    while(~scanf("%d",&n))
    {
        for(int i=0;i<n;i++)
            scanf("%lf",&x[i]);
        sort(x,x+n);
        double ans =x[0];
        for(int i=1;i<n;i++)
            ans *=0.5,x[i] *=0.5,ans +=x[i];
        printf("%f\n",ans);
    }
    return 0;
}
v

Compiler output:
a.cc:20:1: error: 'v' does not name a type
   20 | v
      | ^
Language: C++

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

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

    for(int i = 1; i < n; i++) {
        v[i] = (v[i-1] + v[i])/2;
    }

    cout << v[n-1] << endl;
}


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

#include <iostream>
#include <vector>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;

int main(){
    int n,v[50];
    cin >> n;
    rep(i,n) cin >> v[i];
    sort(v,v+n);
    for(int i=0;i<n-1;i++){
        v[i+1] = (v[i] + v[i+1])/2.0;
    }
    cout << v[n-1];
    return 0;
}

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

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

int main(){
  int count=0;
  int N;
  cin>>N;
  vector<int>H(N);
  vector<int>Hc(N);
  rep(i,N){
    cin>>H[i];
  }
  sort(H.begin(),H.end());
    count+=H[0];
  rep(i,N-1){
    count+=H[i+1]*pow(2,i);
  }
  double K=count/pow(2,N-1);
  cout<<K;

Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: expected '}' at end of input
   20 |   cout<<K;
      |           ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int n,tmp;
    double ans=0;
    cin>>n;
    double num[n];
    for(int k=0;k<n;k++){
        cin>>num[k];
    }
        for (int i=0; i<n; ++i) {
            for (int j=i+1; j<n; ++j) {
                if (num[i] > num[j]) {
                    tmp =  num[i];
                    num[i] = num[j];
                    num[j] = tmp;
      }
    }
  }
  ans=num[0];
  for(int i=0;i<n-1;i++){
      ans=(ans+num[i+1])/2;
  }
  cout<<ans;
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:25:3: error: 'cout' was not declared in this scope
   25 |   cout<<ans;
      |   ^~~~
Language: C++

include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int n,tmp;
    double ans=0;
    cin>>n;
    double num[n];
    for(int k=0;k<n;k++){
        cin>>num[k];
    }
        for (int i=0; i<n; ++i) {
            for (int j=i+1; j<n; ++j) {
                if (num[i] > num[j]) {
                    tmp =  num[i];
                    num[i] = num[j];
                    num[j] = tmp;
      }
    }
  }
  ans=num[0];
  for(int i=0;i<n-1;i++){
      ans=(ans+num[i+1])/2;
  }
  /*for(int i=0;i<n;i++){
      cout<<i;
      cout<<num[i]<<endl;
  }*/
  cout<<ans;
  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:5: error: 'cin' was not declared in this scope
    7 |     cin>>n;
      |     ^~~
a.cc:29:3: error: 'cout' was not declared in this scope
   29 |   cout<<ans;
      |   ^~~~
Language: C++


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

int main()
{
  int N;
  cin >> N;
  vector<int> _v;
  auto * const v = &_v[0];
  for (int i = 0; i < N; ++i)
    cin >> v[i];
  sort(v, v + N);
  double den = 2.;
  double sum = 0.;
  for (int i = N - 1; 1 <= i; --i)
  {
    v[i] /= den;
    sum += v[i];
    den *= 2.;
  }
  v[0] /= (den/2.);
  sum += v[0];
  cout << sum;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   vector<int> _v;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <iostream>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> _v;
      |          ^~~
a.cc:11:21: error: '_v' was not declared in this scope; did you mean 'v'?
   11 |   auto * const v = &_v[0];
      |                     ^~
      |                     v
Language: C++

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

using namespace std;

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

    vector<double> res;

    double maxval = 0;
    double current = 0;
    if (n == 1) cout << v[0] << endl;
    else if (n == 2) {
        printf("%lf", (v[0] + v[1]) / 2);
    } else {
        do {
            current = pow(2,n-2)*v[0] + pow(2,n-2)*v[1];
            for(int i = 2; i < n; i++){
                current += pow(2,n-1)*v[i];
            }
            if(maxval < current){
                maxval = current;
                res = v;
            }
        } while (next_permutation(v.begin(), v.end()));
        maxval = res[0];
        for(int i = 1; i < n; i++){
            maxval = (maxval + res[i])/2;
        }
        printf("%lf", maxval);
    }
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:26:23: error: 'pow' was not declared in this scope
   26 |             current = pow(2,n-2)*v[0] + pow(2,n-2)*v[1];
      |                       ^~~
Language: C++

<?php
$n = intval(fgets(STDIN));
$a = array_map("intval", explode(" ", trim(fgets(STDIN))));
sort($a);
$c = $a[0];
for($i = 1; $i < $n; $i++){
  $c = ($c + $a[$i])/2;
}
echo $c;

Compiler output:
a.cc:1:1: error: expected unqualified-id before '<' token
    1 | <?php
      | ^
a.cc:3:1: error: '$a' does not name a type
    3 | $a = array_map("intval", explode(" ", trim(fgets(STDIN))));
      | ^~
a.cc:4:5: error: expected constructor, destructor, or type conversion before '(' token
    4 | sort($a);
      |     ^
a.cc:5:1: error: '$c' does not name a type
    5 | $c = $a[0];
      | ^~
a.cc:6:1: error: expected unqualified-id before 'for'
    6 | for($i = 1; $i < $n; $i++){
      | ^~~
a.cc:6:13: error: '$i' does not name a type
    6 | for($i = 1; $i < $n; $i++){
      |             ^~
a.cc:6:22: error: '$i' does not name a type
    6 | for($i = 1; $i < $n; $i++){
      |                      ^~
a.cc:9:1: error: 'echo' does not name a type
    9 | echo $c;
      | ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  
  int N;
  cin >> N;
  
  vector<double> u(N);
  
  for(int i = 0;i < N;++i){
    cin >> u[i];
  }
  
  sort(u.begin(),u.end());
  
  double num;
  double num2 = 0.0;
  
  for(int i = 0;i < N;++i){
    num = (u[num2] + u[i + 1]) / 2;
    num2 = num
  }
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:15: error: expected ';' before '}' token
   21 |     num2 = num
      |               ^
      |               ;
   22 |   }
      |   ~
Language: C++

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

int main(){
  int64_t n,f=0,b=0,j=0,c;
  cin >> n;
  vector<int64_t> a(n);
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  
  sort(a.begin(),a.end());
  for(int i=0;i<n;i++){
      c=2;
      j=0;
      while(j<i-1){
        a[i] *= 2;
        c *= 2;
        j++;
      }
    b += a[i];
  }

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

import java.util.Scanner;
import java.util.Arrays;
public class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int[] b = new int[a];
    for(i = 0;i < b.length;i++){
      b[i] = sc.nextInt();
    }
    Arrays.sort(b);
    double c = (double)(b[0] + b[1]) / 2;
    for(j = 2; j < b.length; j++){
      c = (double)(tmp + b[j]) / 2;
    }
    System.out.println(c);
  }
}

Compiler output:
Main.java:8: error: cannot find symbol
    for(i = 0;i < b.length;i++){
        ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for(i = 0;i < b.length;i++){
              ^
  symbol:   variable i
  location: class Main
Main.java:8: error: cannot find symbol
    for(i = 0;i < b.length;i++){
                           ^
  symbol:   variable i
  location: class Main
Main.java:9: error: cannot find symbol
      b[i] = sc.nextInt();
        ^
  symbol:   variable i
  location: class Main
Main.java:13: error: cannot find symbol
    for(j = 2; j < b.length; j++){
        ^
  symbol:   variable j
  location: class Main
Main.java:13: error: cannot find symbol
    for(j = 2; j < b.length; j++){
               ^
  symbol:   variable j
  location: class Main
Main.java:13: error: cannot find symbol
    for(j = 2; j < b.length; j++){
                             ^
  symbol:   variable j
  location: class Main
Main.java:14: error: cannot find symbol
      c = (double)(tmp + b[j]) / 2;
                   ^
  symbol:   variable tmp
  location: class Main
Main.java:14: error: cannot find symbol
      c = (double)(tmp + b[j]) / 2;
                           ^
  symbol:   variable j
  location: class Main
9 errors
Language: C++

#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include <sstream>
#include<map>
#include<cmath>
#include<queue>
#include <functional>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define PI 3.141592

using namespace std;

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

	//vector<int> vNum(N, 0);
	priority_queue<long double, vector<long double>, greater<long double> > vNum;

	rep(i, N)
	{
		long double tmp = 0;
		cin >> tmp;
		vNum.push(tmp);
	}

	while (true)
	{
		if (vNum.size() == 1)
		{
			break;
		}

		#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include <sstream>
#include<map>
#include<cmath>
#include<queue>
#include <functional>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define PI 3.141592

using namespace std;

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

	priority_queue<long double, vector<long double>, greater<long double> > vNum;

	rep(i, N)
	{
		long double tmp = 0;
		cin >> tmp;
		vNum.push(tmp);
	}

	while (true)
	{
		if (vNum.size() == 1)
		{
			break;
		}

		long double AA = vNum.top();
		vNum.pop();
		long double BB = vNum.top();
		vNum.pop();

		vNum.push((AA + BB) / 2.0f);
	}


	printf("%.6f", vNum.top());
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   54 | int main() {
      |         ^~
a.cc:54:9: note: remove parentheses to default-initialize a variable
   54 | int main() {
      |         ^~
      |         --
a.cc:54:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:54:12: error: a function-definition is not allowed here before '{' token
   54 | int main() {
      |            ^
a.cc:84:2: error: expected '}' at end of input
   84 | }
      |  ^
a.cc:32:9: note: to match this '{'
   32 |         {
      |         ^
a.cc:84:2: error: expected '}' at end of input
   84 | }
      |  ^
a.cc:17:12: note: to match this '{'
   17 | int main() {
      |            ^