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

#include<algorithm>
#include<iomanip>
using namespace std;
int main(){
  int N;
  cin>>N;
  double a[N];
  for(int j=0; j<N; j++){
      cin>>a[j];
  }
  long double sum=0;
  sort(a,a+N);
  
  for(int i=0; i<N; i++){
     sum=sum+a[N-1]/a[i];
  }
  cout<<fixed<<setprecision(7)<<(1/sum)*a[N-1];
  return 0;
}  

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope
    6 |   cin>>N;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<iomanip>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout<<fixed<<setprecision(7)<<(1/sum)*a[N-1];
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include<set>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
  int N;
  cin>>N;
  int a[100];
  for(int j=0; j<N; j++){
      cin>>a[j];
  }
  double sum=0;
  sort(a,a+N);
  
  for(int i=0; i<N; i++){
     sum=sum+a[N-1]/a[i];
  }
  cout<<(1/sum)*a[N-1]<<endl;
}  
  
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>N;
      |   ^~~
a.cc:4:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    3 | #include<cmath>
  +++ |+#include <iostream>
    4 | using namespace std;
a.cc:18:3: error: 'cout' was not declared in this scope
   18 |   cout<<(1/sum)*a[N-1]<<endl;
      |   ^~~~
a.cc:18:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:25: error: 'endl' was not declared in this scope
   18 |   cout<<(1/sum)*a[N-1]<<endl;
      |                         ^~~~
a.cc:4:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    3 | #include<cmath>
  +++ |+#include <ostream>
    4 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[100005],h[100005];
int main() {
	int n;
	cin>>n;double s=0,a;
	while(n-->0)
	{
	    cin>>a;
	    s+=1/a;
	}printf("%.5lf\n",1/s);
	}
	return 0;
}

Compiler output:
a.cc:14:9: error: expected unqualified-id before 'return'
   14 |         return 0;
      |         ^~~~~~
a.cc:15:1: error: expected declaration before '}' token
   15 | }
      | ^
Language: C++

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

int main() {
    int N;
    return 0;
    double ans = 0.0, A;
    cin >> N;
    for (int i=1; i<N; ++i) {
        cin >> A;
        double += 1 / A;
    }
    cout << setprecision(16) << 1.0 / ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: expected unqualified-id before '+=' token
   12 |         double += 1 / A;
      |                ^~
Language: C++

    #include <iostream>
    using namespace std;
     
    int a[100];
     
    int main() {
      int N;
      cin >> N;
      int mul = 1;
      int sum = 0;
      for (int i=0; i < N; ++i) {
        cin >> a[i];
        mul *= a[i];
        sum += a[i];
      }
      cout << setprecision(16) << (float)(mul * mul) / sum << endl;
      return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:16:15: error: 'setprecision' was not declared in this scope
   16 |       cout << setprecision(16) << (float)(mul * mul) / sum << endl;
      |               ^~~~~~~~~~~~
a.cc:2:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
    1 |     #include <iostream>
  +++ |+#include <iomanip>
    2 |     using namespace std;
Language: C++

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

main(){
  int n;
  double sum = 0;
  rep(i, n){
    int a;
    cin >> a;
    sum += 1.0/a;
  }
  double ans = 1/sum;
  printf("%.10f\n", ans); 
  return 0;
}

Compiler output:
a.cc:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:2:37: error: expected ';' before '<' token
    2 | #define rep(i, n) for (int i = 0, i < (n); ++i)
      |                                     ^
a.cc:8:3: note: in expansion of macro 'rep'
    8 |   rep(i, n){
      |   ^~~
a.cc:2:37: error: expected primary-expression before '<' token
    2 | #define rep(i, n) for (int i = 0, i < (n); ++i)
      |                                     ^
a.cc:8:3: note: in expansion of macro 'rep'
    8 |   rep(i, n){
      |   ^~~
Language: C++

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

main(){
  int n;
  double sum = 0;
  rep(i, n){
    int a;
    cin >> a;
    sum += 1.0/a;
  }
  double ans = 1/sum;
  printf("%.10f\n", ans); 
  return 0;
}

Compiler output:
a.cc:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:7:7: error: 'i' was not declared in this scope
    7 |   rep(i, n){
      |       ^
a.cc:7:3: error: 'rep' was not declared in this scope
    7 |   rep(i, n){
      |   ^~~
Language: C++

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

int main(){
 long long N,b,c,d,ans,ans2,p;
cin>>N;
  double ans,ans2;
  ans2=0;
  vector<double>a(N);
  for(int i=0;i<N;i++){
    cin>>a[i];
    ans2+=1.0/a[i];
  }
  ans=1.0/ans2;
    cout<<std::setprecision(10)<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:10: error: conflicting declaration 'double ans'
    7 |   double ans,ans2;
      |          ^~~
a.cc:5:20: note: previous declaration as 'long long int ans'
    5 |  long long N,b,c,d,ans,ans2,p;
      |                    ^~~
a.cc:7:14: error: conflicting declaration 'double ans2'
    7 |   double ans,ans2;
      |              ^~~~
a.cc:5:24: note: previous declaration as 'long long int ans2'
    5 |  long long N,b,c,d,ans,ans2,p;
      |                        ^~~~
Language: C++

#include <iostream>
#include <string>

using namespace std;

int main() {
  int n;
  cin >> n;
  int[] a = new int[n];
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  double r = 0.0;
  for (int i = 0; i < n; ++i) {
    r += 1.0 / (double)a[i];
  }
  return 1.0 / r;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:6: error: structured binding declaration cannot have type 'int'
    9 |   int[] a = new int[n];
      |      ^~
a.cc:9:6: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:9:6: error: empty structured binding declaration
a.cc:9:9: error: expected initializer before 'a'
    9 |   int[] a = new int[n];
      |         ^
a.cc:11:12: error: 'a' was not declared in this scope
   11 |     cin >> a[i];
      |            ^
a.cc:15:24: error: 'a' was not declared in this scope
   15 |     r += 1.0 / (double)a[i];
      |                        ^
Language: C

#include <stdio.h>
main()
{
  int N,i;
  int A[100]=0;
  double sum;
  scanf("%d",&N);
  for(i=0;i<N-1;i++)
  {
 	scanf("%d ",&A[i]);
  }
  scanf("%d",&%A[i]);
  for(i=sum=0;i<N;i++)
  {
    sum+=1.0/(double)A[i];
  }
  printf("%lf",1.0/sum);
  return 0;
}
  

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:5:14: error: invalid initializer
    5 |   int A[100]=0;
      |              ^
main.c:12:15: error: expected expression before '%' token
   12 |   scanf("%d",&%A[i]);
      |               ^
Language: C

#include <stdio.h>
main()
{
  int N,i;
  int A[100]=0;
  double sum=0;
  scanf("%d",&N);
  for(i=0;i<N;i++)
  {
 	 scanf("%d ",&A[i]);
  }
  for(i=0;i<N;i++)
  {
    sum+=1/(double)A[i];
  }
  printf("%lf",1/sum);
  return 0;
}
  

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | main()
      | ^~~~
main.c: In function 'main':
main.c:5:14: error: invalid initializer
    5 |   int A[100]=0;
      |              ^
Language: C++

#include<bits/stdc++.h>

using namespace std;

#define X first
#define Y second
#define eps  1e-5
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))

typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;

const int maxn = 1e5+7;
const int INF  = 1<<30;
const int mod  = 1e9+7;

int s[maxn];

void solve(){
    int n;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>s[i];
    long long g = 0,sum = 1,xx = 0;
    for(int i=1;i<=n;i++){
        g = gcd(g,s[i]);
        sum *= s[i];
    }
    sum /= g;
    for(int i=1;i<=n;i++){
        xx += sum/s[i];
    }
    printf("%.15f\n",1.0*sum/xx );
    return;
}

int main()
{
#ifndef ONLINE_JUDGE
   // freopen("in.txt","r",stdin);
#endif
//    freopen("out.txt","w",stdout);
//    ios::sync_with_stdio(false);
    int t = 1;
    //scanf("%d",&t);
    while(t--){
    //    printf("Case %d: ",cas++);
        solve();
    }
#ifndef ONLINE_JUDGE
   // printf("%.10f\n",1.0*clock()/CLOCKS_PER_SEC);
#endif
    return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:32:16: error: no matching function for call to '__gcd(long long int&, int&)'
   32 |         g = gcd(g,s[i]);
      |                ^
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:32:16: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('long long int' and 'int')
   32 |         g = gcd(g,s[i]);
      |                ^
Language: C++

#include <iostream>
#include <vector>

int main(void){
	int n,su=0;
  vector<int> a(100);
  for(int i=0;i<n;i++){
  std::cin>> a.at(i);
    su+=a.at(i);
  }
  double k=1/su;
  std::cout<< k << std:: endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> a(100);
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:2:
/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> a(100);
      |          ^~~
a.cc:8:14: error: 'a' was not declared in this scope
    8 |   std::cin>> a.at(i);
      |              ^
Language: C++

#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
int main()
{
  int i,n;
  cin>>n;
  double one = 1.0;
  double sum = 0.0;
  double x;
  for(i=0;i<n;i++)
  {
    cin>>x;
    x = one/x;
    sum += x;
  }
  sum = one/sum;
  cout<<setprecision(12)<<sum<<endl;
}

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

#include <bits/stdc++.h>

using namespace std;

int main() {
  int n;
  cin >> n;
  double res = 0;
  for (int i = 0;i < n; i++) {
    double x;
    cin >> x;
    res += 1 / x;
  }
  cout << fixed << setprecision(10) << 1 / res << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:14:56: error: expected '}' at end of input
   14 |   cout << fixed << setprecision(10) << 1 / res << endl;
      |                                                        ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: Java

import static org.junit.jupiter.api.Assertions.assertEquals;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import org.junit.jupiter.api.Test;

public class Main {

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

            List<Integer> list = new ArrayList<>();
            for (int i = 0; i < n; i++) {
                list.add(Integer.parseInt(sc.next()));
            }

            System.out.println(calc(list));
        }
    }

    private static double calc(List<Integer> list) {
        BigDecimal child = BigDecimal.ONE;
        BigDecimal sum = BigDecimal.ZERO;
        for (int i = 0; i < list.size(); i++) {
            BigDecimal cache = BigDecimal.ONE;
            for (int j = 0; j < list.size(); j++) {
                if (i != j) {
                    cache = cache.multiply(BigDecimal.valueOf(list.get(j)));
                }
            }
            System.out.println("i = " + i + ";cache = " + cache);

            sum = sum.add(cache);
            child = child.multiply(BigDecimal.valueOf(list.get(i)));
        }
        System.out.println("sum = " + sum);

        return child.divide(sum).doubleValue();
    }

    @Test
    public void test() {
        assertEquals(0.5, calc(List.of(1, 1)));
        assertEquals(7.5, calc(List.of(10, 30)));
        // assertEquals(66.66666666666667, calc(List.of(200, 200, 200)));
        assertEquals(1000, calc(List.of(1000)));
        assertEquals(500, calc(List.of(1000, 1000)));
        assertEquals(250, calc(List.of(1000, 1000, 1000, 1000)));
    }
}


Compiler output:
Main.java:1: error: package org.junit.jupiter.api does not exist
import static org.junit.jupiter.api.Assertions.assertEquals;
                                   ^
Main.java:1: error: static import only from classes and interfaces
import static org.junit.jupiter.api.Assertions.assertEquals;
^
Main.java:8: error: package org.junit.jupiter.api does not exist
import org.junit.jupiter.api.Test;
                            ^
Main.java:45: error: cannot find symbol
    @Test
     ^
  symbol:   class Test
  location: class Main
Main.java:47: error: cannot find symbol
        assertEquals(0.5, calc(List.of(1, 1)));
        ^
  symbol:   method assertEquals(double,double)
  location: class Main
Main.java:48: error: cannot find symbol
        assertEquals(7.5, calc(List.of(10, 30)));
        ^
  symbol:   method assertEquals(double,double)
  location: class Main
Main.java:50: error: cannot find symbol
        assertEquals(1000, calc(List.of(1000)));
        ^
  symbol:   method assertEquals(int,double)
  location: class Main
Main.java:51: error: cannot find symbol
        assertEquals(500, calc(List.of(1000, 1000)));
        ^
  symbol:   method assertEquals(int,double)
  location: class Main
Main.java:52: error: cannot find symbol
        assertEquals(250, calc(List.of(1000, 1000, 1000, 1000)));
        ^
  symbol:   method assertEquals(int,double)
  location: class Main
9 errors
Language: C++

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

int main(){
  int a,i;
  double b;
  b=0;
  a>=1;
  
  cin >> a;
  
  vector<int> vec(a);
  
  for(i=0;i<a;i++){
    cin >> vec[i]
  }
   
  for(i=0;i<a;i++){
    vec[i]>=1;
  }
  
  for(i=0;i<a;i++){
    vec[i] = 1/vec[i];
  }
  for(i=0;i<a;i++){
    b=b+vec[i];
  }
  cout << 1/b;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: expected ';' before '}' token
   15 |     cin >> vec[i]
      |                  ^
      |                  ;
   16 |   }
      |   ~
Language: C++

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

int main(){
  int a,b,i;
  b=0;
  
  cin >> a;
  
  vector<int> vec(a);
  
  for(i=0;i<a;i++){
    vec(i) = 1/vec(i);
  }
  for(i=0;i<a;i++){
    b=b+vec(i);
  }
  cout << 1/b;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: no match for call to '(std::vector<int>) (int&)'
   13 |     vec(i) = 1/vec(i);
      |     ~~~^~~
a.cc:13:19: error: no match for call to '(std::vector<int>) (int&)'
   13 |     vec(i) = 1/vec(i);
      |                ~~~^~~
a.cc:16:12: error: no match for call to '(std::vector<int>) (int&)'
   16 |     b=b+vec(i);
      |         ~~~^~~
Language: C

#include <stdio.h>

int main(){
 int n;
 double a[100], a_inv[100];
 double ans, don = 0;
  
  scanf("%d", &n);
  for(int i = 0; i < n; i++ ){
    scanf("%lf", &a[i]);
    a_inv = 1 / a[i];
  }
  
  for(int i = 0; i < n; i++)
    don += a_inv[i];
  ans = 1 / don;
  
  printf("%f\n", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:11: error: assignment to expression with array type
   11 |     a_inv = 1 / a[i];
      |           ^
Language: C++

#include <iostream>
//#include <string>
#include <vector>
#include <stdlib>

using namespace std;

int main(){
  vector<double> a, a_inv;
  int n;
  double ans, don = 0;
  
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    a_inv[i] = 1 / a[i];
  }
  
  for(int i = 0; i < a_inv.length; i++)
    don += a_inv[i];
  
  ans = 1 / don;
  cout << ans << endl;
  
  return 0;
}

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

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(){
  vector<double> a, a_inv;
  int n;
  double ans, don = 0;
  
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    a_inv[i] = 1 / a[i];
  }
  
  for(int i = 0; i < a_inv.length; i++)
    don += a_inv[i];
  
  ans = 1 / don;
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: 'class std::vector<double>' has no member named 'length'
   18 |   for(int i = 0; i < a_inv.length; i++)
      |                            ^~~~~~
Language: C++

#include <iostream>
#include <string>
#include <vector>

int main(){
  vector<double> a, a_inv;
  int n;
  double ans, don = 0;
  
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
    a_inv[i] = 1 / a[i];
  }
  
  for(int i = 0; i < a_inv.length; i++)
    don += a_inv[i];
  
  ans = 1 / don;
  cout << ans << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<double> a, a_inv;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/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 'double'
    6 |   vector<double> a, a_inv;
      |          ^~~~~~
a.cc:10:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |   cin >> n;
      |   ^~~
      |   std::cin
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:12:12: error: 'a' was not declared in this scope
   12 |     cin >> a[i];
      |            ^
a.cc:13:5: error: 'a_inv' was not declared in this scope
   13 |     a_inv[i] = 1 / a[i];
      |     ^~~~~
a.cc:16:22: error: 'a_inv' was not declared in this scope
   16 |   for(int i = 0; i < a_inv.length; i++)
      |                      ^~~~~
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:20:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<stdio.h>
int main (void)
{
  int n;
  scanf("%d",&n);
  int a[n];
  double sum=0;
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(int i=0;i<n;i++){
    sum+=1/a[i];
  }
  printf("%d",1\sum);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:16: error: stray '\' in program
   14 |   printf("%d",1\sum);
      |                ^
main.c:14:16: error: expected ')' before 'sum'
   14 |   printf("%d",1\sum);
      |         ~      ^~~~
      |                )
Language: C++

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

int main() {
  int N;
  double ans = 0.0, A;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> A;
    ans += 1.0/A;
  }
  
  ans = 1.0/ans;
  
  cout << setprecision(16) << ans << endl;
}

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

#include<stdio.h>
int main(void)
{
  int N,s[100010];
  double M[100010];
  double sum=0;
  scanf("%d",&N);
  for(int i=0;i<N;i++)
  {
    scanf("%d",&s[i]);
    M[i]=(double)1/S[i];
    sum+=M[i];
  }
  printf("%lld",(double)1/sum);
  return 0;
}

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

#include<iostream>
using namespace std;
int main(){
  int n;
  cin>>n;int arr[n];
  long  product=1;
  for(int i=0;i<n;i++){
    cin>>arr[i];
    product*=arr[i];
  }
  long sum=0;
  for(int i=0;i<n;i++)
    sum+=product/arr[i];
  double x= (product*1.0)/sum;
  cout<<fixed<<setprecision(18)<<x;
  return 0;
}
  


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

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

int main() {
	int n;
	cin >> n;
	double sum = 0;
	rep(i, n) {
		int a;
		cin >> a;
		ans += 1.0 / a;
	}
	cout << 1.0 / ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |                 ans += 1.0 / a;
      |                 ^~~
      |                 abs
a.cc:15:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         cout << 1.0 / ans << endl;
      |                       ^~~
      |                       abs
Language: C++

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

int main() {
  int N;
  int A = 0, B = 1;
  vector<int> vec;
  vector<int> vec(N);
  for ( int i = 0; i < N; i++ ){
    cin >> vec.at(i);
  }
  for ( int j = 0; j <N; j++ ){
    A = A + vec.at(j);
    B = B * vec.at(j);
  }
  cout << B / A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: redeclaration of 'std::vector<int> vec'
   10 |   vector<int> vec(N);
      |               ^~~
a.cc:9:15: note: 'std::vector<int> vec' previously declared here
    9 |   vector<int> vec;
      |               ^~~
Language: C++

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

int main() {
  int N;
  int A = 0, B = 1;
  vector<int> vec;
  vector<int> vec(N);
  for ( int i = 0; i < N; i++ ){
    cin >> vec.at(i);
  }
  for ( int j = 0; j <N; j++ ){
    A = A + vec.at(j);
    B = B * vec.at(j);
  }
  cout << B / A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec;
      |   ^~~~~~
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 | #include <string>
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec;
      |          ^~~
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> vec(N);
      |          ^~~
a.cc:11:12: error: 'vec' was not declared in this scope
   11 |     cin >> vec.at(i);
      |            ^~~
a.cc:14:13: error: 'vec' was not declared in this scope
   14 |     A = A + vec.at(j);
      |             ^~~
Language: C++

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

int main() {
  int N;
  int A = 0, B = 1;
  vector<int> vec(N);
  for ( int i = 0; i < N; i++ ){
    cin >> vec.at(i);
  }
  for ( int j = 0; j <N; j++ ){
    A = A + vec.at(j);
    B = B * vec.at(j);
  }
  cout << B / A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> vec(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 | #include <string>
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> vec(N);
      |          ^~~
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:13:13: error: 'vec' was not declared in this scope
   13 |     A = A + vec.at(j);
      |             ^~~
Language: C++

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

int main() {
  int N;
  int A = 0, B = 1;
  vector(int) vec(N);
  for ( int i = 0; i < N; i++ ){
    cin >> vec.at(i);
  }
  for ( int j = 0; j <N; j++ ){
    A = A + vec.at(j);
    B = B * vec.at(j);
  }
  cout << B / A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector(int) vec(N);
      |          ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector(int) vec(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 | #include <string>
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:13:13: error: 'vec' was not declared in this scope
   13 |     A = A + vec.at(j);
      |             ^~~
Language: C++

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

int main() {
  int N;
  int A = 0, B = 1;
  vector(int) vec(N);
  for ( int i = 0, i < N, i++ ){
    cin >> vec.at(i);
  }
  for ( int j = 0, j <N, j++ ){
    A = A + vec.at(j);
    B = B * vec.at(j);
  }
  cout << B / A << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector(int) vec(N);
      |          ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector(int) vec(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 | #include <string>
a.cc:9:21: error: expected ';' before '<' token
    9 |   for ( int i = 0, i < N, i++ ){
      |                     ^~
      |                     ;
a.cc:9:22: error: expected primary-expression before '<' token
    9 |   for ( int i = 0, i < N, i++ ){
      |                      ^
a.cc:9:30: error: expected ';' before ')' token
    9 |   for ( int i = 0, i < N, i++ ){
      |                              ^~
      |                              ;
a.cc:10:12: error: 'vec' was not declared in this scope
   10 |     cin >> vec.at(i);
      |            ^~~
a.cc:12:21: error: expected ';' before '<' token
   12 |   for ( int j = 0, j <N, j++ ){
      |                     ^~
      |                     ;
a.cc:12:22: error: expected primary-expression before '<' token
   12 |   for ( int j = 0, j <N, j++ ){
      |                      ^
a.cc:12:29: error: expected ';' before ')' token
   12 |   for ( int j = 0, j <N, j++ ){
      |                             ^~
      |                             ;
a.cc:13:13: error: 'vec' was not declared in this scope
   13 |     A = A + vec.at(j);
      |             ^~~
Language: C++

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


    vector<double> P(N);
    cin>>P;

    double b =0;
    for(int i=0;i<N;i++){

        b += 1.0 /P[i];
    }
    double ans = 1.0/b;
    FOUT_L(20,ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin>>N;
      |     ^~~
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<double> P(N);
      |     ^~~~~~
a.cc:6:12: error: expected primary-expression before 'double'
    6 |     vector<double> P(N);
      |            ^~~~~~
a.cc:7:10: error: 'P' was not declared in this scope
    7 |     cin>>P;
      |          ^
a.cc:15:5: error: 'FOUT_L' was not declared in this scope
   15 |     FOUT_L(20,ans);
      |     ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int N;
double a[102];
double ans;
int main(){
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> a[i];
		ans += 1.0/a[i];
	}
	cout << 1.0/ans << endl;
	return 0
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:17: error: expected ';' before '}' token
   32 |         return 0
      |                 ^
      |                 ;
   33 | }
      | ~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <numeric>

using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

typedef long long LL;
typedef vector<int> VI;

int64_t gcd(int64_t a, int64_t b) {
  if(a < b) return gcd(b, a);
  int64_t r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  int64_t mul = 1;
  for (int i = 0; i < N; i++) {
    mul *= A[i];
  }
  int64_t sum = 0;
  for (int i = 0; i < N; i++) {
    sum += mul/A[i];
  }
  int64_t v = gcd(mul, sum);
  mul /= v;
  sum /= v;
  cout << fixed << setprecision(10) << (double)mul/sum << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:47:20: error: 'setprecision' was not declared in this scope
   47 |   cout << fixed << setprecision(10) << (double)mul/sum << endl;
      |                    ^~~~~~~~~~~~
a.cc:11:1: note: 'std::setprecision' is defined in header '<iomanip>'; this is probably fixable by adding '#include <iomanip>'
   10 | #include <numeric>
  +++ |+#include <iomanip>
   11 |
Language: Java

import java.util.Scanner;
public class Main2 {

	public static void main(String[] args) {
		Scanner st=new Scanner(System.in);
		int n=st.nextInt();
		int[] a=new int[n];
		for(int i=0;i<n;i++) {
			a[i]=st.nextInt();
		}
		double kotae=0;
		for(int i=0;i<n;i++) {
			kotae+=1.0/(double)a[i];
		}
		double kotae1=0.0;
		kotae1=1.0/kotae;
		System.out.printf("%f",kotae1);

	}

}


Compiler output:
Main.java:2: 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>
#define repear(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<long long> A(N);
  repeat(i,N) cin >> A[i];
  
  long long sum = 0;
  repeat(i,N)sum += 1/A[i];
  
  long long ans = 1/sum;
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'i' was not declared in this scope
    9 |   repeat(i,N) cin >> A[i];
      |          ^
a.cc:9:3: error: 'repeat' was not declared in this scope; did you mean 'repear'?
    9 |   repeat(i,N) cin >> A[i];
      |   ^~~~~~
      |   repear
Language: C++

#include <iostream>
using namespace std;

int main(void) {
  int n;
  int array[101];
  int sum;
  int ans;
  cin >> n;
  for (int i = 0; i < 100; i++) {
    cin >> array[i];
  }
  for (int i = 0; i < 100; i++) {
    num += (1 / array[i]);
  }
  ans = 1 / num;

  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'num' was not declared in this scope; did you mean 'sum'?
   14 |     num += (1 / array[i]);
      |     ^~~
      |     sum
a.cc:16:13: error: 'num' was not declared in this scope; did you mean 'sum'?
   16 |   ans = 1 / num;
      |             ^~~
      |             sum
Language: C++

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

int main(){
  int N;
  cin >> N;
  vector<long long> A(N);
  repeat(i,N) cin >> A[i];
  
  long long sum = 0;
  repeat(i,N){
    sum += 1/A[i];
  }
  
  long long ans = 1/sum;
  
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:10: error: 'i' was not declared in this scope
    9 |   repeat(i,N) cin >> A[i];
      |          ^
a.cc:9:3: error: 'repeat' was not declared in this scope; did you mean 'repear'?
    9 |   repeat(i,N) cin >> A[i];
      |   ^~~~~~
      |   repear
Language: C

#include<stdio.h>
int main(void)
{
  int n;
  scanf("%d",&n);
  int a[n];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  long long int s[n];
  for(int i=0;i<n;i++){
    s[i]=1;
  }
  long long int sum1=0;
  long long int seki1=1;
  long long int sum2=0;
  long long int seki2=1;
  for(int i=0;i<n/2;i++){
    for(int j=0;j<n/2;j++){
      if(j!=i){
        s[i]*=a[j];
      }
    }
    sum1+=s[i];
    seki1*=a[i];
  }
  for(int i=n/2;i<n;i++){
    for(int j=n/2;j<n;j++){
      if(j!=i){
        s[i]*=a[j];
      }
    }
    sum2+=s[i];
    seki2*=a[i];
  }
  printf("%f",(double)((seki1/sum1)+(seki2/sum2));
  return 0;
}



Compiler output:
main.c: In function 'main':
main.c:36:50: error: expected ')' before ';' token
   36 |   printf("%f",(double)((seki1/sum1)+(seki2/sum2));
      |         ~                                        ^
      |                                                  )
main.c:37:12: error: expected ';' before '}' token
   37 |   return 0;
      |            ^
      |            ;
   38 | }
      | ~
Language: C

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

int main(){
    int n,bun=1,si=0; cin >> n;
    vector <int> A(n);
    
    for (int i=0; i<n; i++) cin >> A[i];
    for (int i=0; i<n; i++){
        bun=lcm(bun,A[i]);
    } 
    for (int i=0; i<n; i++){
        si+=bun/A[i];
    }
    
    cout << (double)bun/si;
}

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


import java.util.Scanner;

public class Resist {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner jk = new Scanner(System.in);
		double n = jk.nextDouble();
		double[] arr = new double[(int) n];
		double den = 0.0;
		for (int i=0; i<n; i++)
		{
			arr[i] = jk.nextDouble();
			den+=(1/arr[i]);
		}
		System.out.println(1/den);
		
		
	}

}


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

#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<bitset>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<numeric>
#include<set>
#include<stdio.h>
using namespace std;

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

#define rep(i,x) for(int i=0;i<x;i++)
#define re(i,x,y) for(int i=x;i<y;i++)

long long INF=1e9;
const long long mod=2019;
#define ll long long
int main(){
    int n;
    cin>>n;
    vector<double>a(n);
    double x=0;
    double y=1;
    double sum=0;
    rep(i,n){
        cin>>a[i];
        x=__gcd(x,a[i]);
    }
    rep(i,n){
        y*=(a[i]/x);
        sum+=(a[i]/x);
    }
    y*=x;
    printf("%.64f",y/sum);
    return 0;
}

Compiler output:
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:10:
/usr/include/c++/14/bits/stl_algo.h: In instantiation of '_EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement) [with _EuclideanRingElement = double]':
a.cc:35:16:   required from here
   35 |         x=__gcd(x,a[i]);
      |           ~~~~~^~~~~~~~
/usr/include/c++/14/bits/stl_algo.h:1141:43: error: invalid operands of types 'double' and 'double' to binary 'operator%'
 1141 |           _EuclideanRingElement __t = __m % __n;
      |                                       ~~~~^~~~~
Language: C++

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

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

  vector<int> An(N); // N個のAnの整数データ

  // 整数データを受け取る
  for (int i = 0; i < N; i++) {
    cin >> An.at(i);
  }

  // 合計を出力
  for (int i = 0; i < N; i++) {
    int sum;
    sum = An.at(i);
  }
  // 積和を出力
  for (int i = 0; i < N; i *= i){
    int = pro;
    pro = An.at(i);
  }
  int result;
  result = pro/sum;
  cout << result << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:9: error: expected unqualified-id before '=' token
   22 |     int = pro;
      |         ^
a.cc:23:5: error: 'pro' was not declared in this scope
   23 |     pro = An.at(i);
      |     ^~~
a.cc:26:12: error: 'pro' was not declared in this scope
   26 |   result = pro/sum;
      |            ^~~
a.cc:26:16: error: 'sum' was not declared in this scope
   26 |   result = pro/sum;
      |                ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int n;
  vector<int> input;
  
  cin >> n;
  for(int i = 0;i < n;i++){
    input.push_back(0);
    cin >> input[i];
  }
  
  unsigned long long a = 0;
  unsigned long long b = 1;
  
  for(int i = 0;i < n;i++){
    b *= input[i];
  }
  
  for(int i = 0;i < n;i++){
    a += b / input[i];
  }
  
  cout << (unsigned long double)b / a << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:12: error: 'unsigned' specified with 'long double'
   27 |   cout << (unsigned long double)b / a << endl;
      |            ^~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <float.h>

#include <cstdio>
#include <iomanip>


using namespace std;
typedef long long ll;
#define loop(i, N) for(int i=0; i<N; ++i)


int main(void) {
	int n;
	cin >> n;
	double a[110];
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	long double sum = 0.000000000;
	for (int i = 0; i < n; i++)
	{
		sum += 1.00000000000 / long double(a[i]);
		cout << sum << endl;
	}
	cout << std::fixed << std::setprecision(20) << 1.0/sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:40: error: expected primary-expression before 'long'
   29 |                 sum += 1.00000000000 / long double(a[i]);
      |                                        ^~~~
Language: C++

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

void main() {
  int N;
  vector<double> A(N);
  
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  
  double res = 0.000000;
  double ans;
  for (int i = 0; i < N; i++) {
    res += ((double) 1)/A[i];
  }
  
  ans = ((double) 1) / res;
  
  cout << ans << endl;
  
  
}


Compiler output:
a.cc:4:1: error: '::main' must return 'int'
    4 | void main() {
      | ^~~~
Language: Java

  import java.util.*;

  public class Main {
      public static void main (String[]args){

          Scanner scanner = new Scanner(System.in);
          
          int N = scanner.nextInt();

          int cnt = 0;

          List <Integer> AList  = new ArrayList<Integer>();

          // 入力数に従って標準入力
          while (cnt < N){

            Integer A = scanner.nextInt();

            Alist.add(A);

            cnt++;
          }
          scanner.close();

          List <double> DList  = new ArrayList<double>();
          
          // 逆数への変換
          for (Integer A :Alist){
            double d = 1 / A;

            DList.add(d);
          }

          // 逆数を総和
          double dAll;
          for (double d:DList){
            dAll += d;
          }

          // 総和を逆数とする
          double result = 1 / dAll;
          
          // 出力
          System.out.println(result);
                  
      }
  } 

Compiler output:
Main.java:19: error: cannot find symbol
            Alist.add(A);
            ^
  symbol:   variable Alist
  location: class Main
Main.java:25: error: unexpected type
          List <double> DList  = new ArrayList<double>();
                ^
  required: reference
  found:    double
Main.java:25: error: unexpected type
          List <double> DList  = new ArrayList<double>();
                                               ^
  required: reference
  found:    double
Main.java:28: error: cannot find symbol
          for (Integer A :Alist){
                          ^
  symbol:   variable Alist
  location: class Main
4 errors
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int n;
  vector<int> input;
  
  cin >> n;
  for(int i = 0;i < n;i++){
    input.push_back(0);
    cin >> input[i];
  }
  
  unsigned int a = 0;
  unsigned int b = 1;
  
  for(int i = 0;i < n;i++){
    b *= input[i];
  }
  
  for(int i = 0;i < n;i++){
    a += b / input[i];
  }
  
  cout << (long long double)b / a << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:17: error: 'long long' specified with 'double'
   27 |   cout << (long long double)b / a << endl;
      |                 ^~~~
Language: C++

#include<iostream>
#include<string.h>
using namespace std;

int main(void)
{
  long double ans=0;
  int a, l[101];
  cin >> a;
  for(int i=0; i<a; i++)
    cin >> l[i];
  for(int i=0; i<a; i++
    ans += 1.0/l[i];
  ans = 1.0/ans;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: expected ')' before 'ans'
   12 |   for(int i=0; i<a; i++
      |      ~                 ^
      |                        )
   13 |     ans += 1.0/l[i];
      |     ~~~
Language: C++


#include "stdafx.h"
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<stack>
#include<cmath>
#include<complex>


//#include<bits/stdc++.h>

#define X real()
#define Y imag()
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define FastF freopen("in.txt","r",stdin); freopen("out.txt","w",stdout)
#define Fast cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0)
using ll = long long;
using namespace std;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vi::iterator vii;
typedef vector<ll> vl;
typedef vl::iterator vli;
typedef long double C;
typedef complex<C> P;
const int INF = 1e9 + 5;
const ll INFF = 1e18 + 5;
const int M = 1e9 + 7;
const double pi = acos(-1);

int main()
{
	//FastF;
	Fast;
	int n, a;
	cin >> n;
	double ans = 0;
	for (int i = 1; i <= n; ++i) {
		cin >> a;
		ans += 1.00 / a;
	}
	ans = 1 / ans;
	printf("%.6lf", ans);
	return 0;
}

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

#include<iostream>
#include<string.h>
using namespace std;

int main(void)
{
  long double ans=0;
  int a, l[101];
  cin >> a;
  for(int i=0; i<a; i++)
    cin >> l[i];
  while(i--)
    ans += 1.0/l[i-1];
  ans = 1.0/ans;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |   while(i--)
      |         ^
Language: C++

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

int main(){
  int N;
  double sum=0.0,kei;
  vector<int> vec;
  cin >> N;
  vector<int> vec(N);
  if(N != 0){
    for(int i=0;i<N;i++){
      cin >> vec.at(i);
    }
    for(int i=0;i<N;i++){
      if(vec.at(i) != 0){
        sum += (1/vec.at(i));
      }
    }
    if(sum != 0.0){
      kei = 1 / sum;
    }
  }
}
     


Compiler output:
a.cc: In function 'int main()':
a.cc:9:15: error: redeclaration of 'std::vector<int> vec'
    9 |   vector<int> vec(N);
      |               ^~~
a.cc:7:15: note: 'std::vector<int> vec' previously declared here
    7 |   vector<int> vec;
      |               ^~~
Language: C++

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

int main(){
	int n;
	double sum=0;
	cin>>n;
	for(int i =0;i<n;i++){
		cin>>ai;
		sum+=(1/ai);
	}
	cout<<(1/sum)<<'\n';
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: 'ai' was not declared in this scope; did you mean 'i'?
   10 |                 cin>>ai;
      |                      ^~
      |                      i
Language: C++

#include<iostream>

using namespace std;

int main()
{
   int N;
   cin>>N;
  
   int A[N];
   float sum = 0.0;
    
   for (int i = 0; i < N; i++)
   {
      cin>>A[i];
      sum += A[i];
   }

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

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

int main() {
int N;
  cin>>N;
 float S=0;
  vector<int> vec(N);
  for(i=0;i<N;i++){
    cin>>vec.at(i);
    S+=1/vec.at(i);
  }
  cout<<1/S<<endl;
}

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

#include<iostream>

using namespace std;

int main()
{
   int N;
   cin>>N;
  
   int A[N];
   float sum = 0.0;
    
   for (i = 0; i < N; i++)
   {
      cin>>A[i];
      sum += A[i];
   }
   sum = 1 / sum;
   cout<<sum;
  
  return 0; 
}
      
       

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

import java.util.*;
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
float N = sc.nextInt();
float f = 0;
flort s=0;
Float a[]=new Float[N];
for(int i=0;i<N;i++){
f=sc.nextInt();
a[i]=1/f;
}
for(int i=0;i<N;i++){
s=s+a[i];
}
float T = 1/s;
System.out.println(T);
}
}

Compiler output:
Main.java:7: error: cannot find symbol
flort s=0;
^
  symbol:   class flort
  location: class Main
Main.java:8: error: incompatible types: possible lossy conversion from float to int
Float a[]=new Float[N];
                    ^
2 errors
Language: C++

#include <iostream>

int main()
{
    int a,i;
    double j=0.0,sum=0.0;
    int c[100];
    std::sin>>a;
    for(i=0;i<a;i++)
    {
       std::cin>>c[i];
    }
    for(i=0;i<a;i++)
    {
        j=j+(1.0/c[i]);
    }
    sum=1.0/j;
    std::cout<<sum;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'sin' is not a member of 'std'; did you mean 'min'?
    8 |     std::sin>>a;
      |          ^~~
      |          min
Language: C

#include <stdio.h>
int main(){
  int n;
  int a[1000];
  int i;
  int b=1, c=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  
  for(i=0; i<n; i++) {
    b *= a[i];
  }
  
  for(i=0; i<n; i++) {
    c += b / a[i];
  }
  
  printf("%f", b/c);

Compiler output:
main.c: In function 'main':
main.c:20:3: error: expected declaration or statement at end of input
   20 |   printf("%f", b/c);
      |   ^~~~~~