criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String args[]){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            int N = Integer.parseInt(br.readLine());
            int v;
            int save = 1;
            int box[] = new int[N];
            for (int i=0; i<N ; i++) {
                v = Integer.parseInt(br.readLine());
                box[i] = v;
                save = save*v/gcd(save,v);
            }
            
            int denomi = 0;
            int nume = 1;
            for (int j=0; i<N ; j++) {
            		donomi += save/box[i];
            		nume = nume*box[i];
            }
            
            float result = nume/denomi;
            
        } catch (Exception e) {
            //TODO: handle exception
        }
        
        System.out.println(result);
    }
}

Compiler output:
Main.java:16: error: cannot find symbol
                save = save*v/gcd(save,v);
                              ^
  symbol:   method gcd(int,int)
  location: class Main
Main.java:21: error: cannot find symbol
            for (int j=0; i<N ; j++) {
                          ^
  symbol:   variable i
  location: class Main
Main.java:22: error: cannot find symbol
            		donomi += save/box[i];
            		^
  symbol:   variable donomi
  location: class Main
Main.java:22: error: cannot find symbol
            		donomi += save/box[i];
            		                   ^
  symbol:   variable i
  location: class Main
Main.java:23: error: cannot find symbol
            		nume = nume*box[i];
            		                ^
  symbol:   variable i
  location: class Main
Main.java:32: error: cannot find symbol
        System.out.println(result);
                           ^
  symbol:   variable result
  location: class Main
6 errors
Language: C++

include<iostream>

using namespace std;

int main()
{
  int n,a;
  float r=0.0;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    cin>>a;
    r+=(1/a);
  }
  cout<<1/r;
}

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

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

int main(void){
  float A;
  float p;
  int n;
  char str[5000];
  
  scanf("%d",&n);
  scanf("%s",str);
  
  p=(float)(strtok(str," "));
  A=1.0/p;
  while(p=(float)(strtok(NULL," "))){
    A+=1.0/p;
  }
  A=1.0/A;
  
  printf("%f",A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: pointer value used where a floating-point was expected
   14 |   p=(float)(strtok(str," "));
      |   ^
main.c:16:3: error: pointer value used where a floating-point was expected
   16 |   while(p=(float)(strtok(NULL," "))){
      |   ^~~~~
Language: C

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

int main(void){
  float A;
  float p;
  int n;
  char str[5000];
  
  scanf("%d",&n);
  scanf("%s",str);
  
  p=(float)strtok(str," ");
  A=1.0/p;
  while(p=(float)strtok(NULL," ")){
    A+=1.0/p;
  }
  A=1.0/A;
  
  printf("%f",A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: pointer value used where a floating-point was expected
   14 |   p=(float)strtok(str," ");
      |   ^
main.c:16:3: error: pointer value used where a floating-point was expected
   16 |   while(p=(float)strtok(NULL," ")){
      |   ^~~~~
Language: C

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

int main(void){
  double A;
  double p;
  int n;
  char str[5000];
  
  scanf("%d",&n);
  scanf("%s",str);
  
  p=(double)strtok(str," ");
  A=1.0/p;
  while(p=(double)strtok(NULL," ")){
    A+=1.0/p;
  }
  A=1.0/A;
  
  printf("%lf",A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:3: error: pointer value used where a floating-point was expected
   14 |   p=(double)strtok(str," ");
      |   ^
main.c:16:3: error: pointer value used where a floating-point was expected
   16 |   while(p=(double)strtok(NULL," ")){
      |   ^~~~~
Language: C

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

int main(void){
  double A;
  double p;
  int n;
  char str[5000];
  
  scanf("%d",&n);
  scanf("%s",str);
  
  A=0.0;
  while(p=(double)strtok(str," ")){
    A+=1.0/p;
  }
  A=1.0/A;
  
  printf("%lf",A);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:3: error: pointer value used where a floating-point was expected
   15 |   while(p=(double)strtok(str," ")){
      |   ^~~~~
Language: C++

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

int main(){
  int N;
  cin >> N;
  for (auto i : intvector){
    cout << i << endl;
  }
}

Compiler output:
a.cc:4:7: error: expected nested-name-specifier before 'nameplace'
    4 | using nameplace std;
      |       ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |   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:9:17: error: 'intvector' was not declared in this scope
    9 |   for (auto i : intvector){
      |                 ^~~~~~~~~
a.cc:10:5: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   10 |     cout << i << 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:10:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   10 |     cout << i << 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: Java

import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    double S = 0 ;
    double[] A = new double[N];
    for(int i = 0;i<N;i++){
      A[i] = scan.nextDouble();
      A[i] =1/A[i];
      S+=A[i];
    }
    System.out.println(1/S);
  }


Compiler output:
Main.java:17: error: reached end of file while parsing
  }
   ^
1 error
Language: Java

import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int N = scan.nextInt();
    double S=0 ; 
    double[] A = new double[N];
    for(int i = 0;i<N;i++){
      A[i] = scan.nextDouble();
      A[i] =1/A[i];
      S+=A[i];
    }
    System.out.println(1/S);
  }
}
}

Compiler output:
Main.java:19: error: class, interface, enum, or record expected
}
^
1 error
Language: C

#include <stdio.h>

int main(void){
  int N;
  double sum = 0,ans;
  int j;
  
  scanf("%d", &N);
  
  int A;
  
  for(j=1;j<=N;j++){
    scanf("%d", &A);
 
    sum = sum + 1/A[j];
  }
  
  ans = 1/sum;
  
  printf("%lf\n", ans);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:15:20: error: subscripted value is neither array nor pointer nor vector
   15 |     sum = sum + 1/A[j];
      |                    ^
Language: C

#include <stdio.h>

int main(void){
  int N;
  int A[100];
  double sum = 0,ans;
  int i;
  
  scanf("%d", &N);
  
  for(j=1;j<=N;j++){
    scanf("%d", A[j]);
  }
  
  for(i=1;i<=N;i++){
    sum = sum + 1/A[i];
  }
  
  ans = 1/sum;
  
  printf("%lf\n", ans);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:7: error: 'j' undeclared (first use in this function)
   11 |   for(j=1;j<=N;j++){
      |       ^
main.c:11:7: 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[100];
  double sum = 0,ans;
  int i;
  
  scanf("%d", &N);
  
  for(j=1;j<=N;j++){
    scanf("%d", A);
  }
  
  for(i=1;i<=N;i++){
    sum = sum + 1/A[i];
  }
  
  ans = 1/sum;
  
  printf("%lf\n", ans);
  
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:11:7: error: 'j' undeclared (first use in this function)
   11 |   for(j=1;j<=N;j++){
      |       ^
main.c:11:7: 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[100];
  double sum = 0;
  int i;
  
  scanf("%d", &N);
  scanf("%d", A);
  
  for(i=1;i<=N;i++){
    sum = sum + 1/A[i];
  }
  
  ans = 1/sum;
  
  printf("%d", ans);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:3: error: 'ans' undeclared (first use in this function)
   16 |   ans = 1/sum;
      |   ^~~
main.c:16:3: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include <iostream>

int main(int argc, char** argv)
{
  int N;
  std::cin >> N;
  
  double sum = 0.0;
  for (int i = 0; i < N; i++) {
    int A;
    std::cin >> A;
    sum += 1.0 / (double)A;
  }
  
  std::cout << sum << std::endl
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:32: error: expected ';' before 'return'
   15 |   std::cout << sum << std::endl
      |                                ^
      |                                ;
   16 |   return 0;
      |   ~~~~~~
Language: C++

#include <iostream>

int main(int argc, char** argv)
{
  int N;
  std::cin >> N;
  
  double sum = 0.0;
  for (int i = 0; i < N; i++) {
    int A;
    std::cin >> A;
    sum += 1.0 / (double)A;
  }
  
  std::out << sum << std::endl
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:15:8: error: 'out' is not a member of 'std'; did you mean 'oct'?
   15 |   std::out << sum << std::endl
      |        ^~~
      |        oct
Language: C++

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

int main() {
	std::cout << std::setprecision(std::numeric_limits<double>::max_digits10);

	int N;
	std::cin >> N;

	std::vector<int> A(N);
	for(auto &a : A) {
		std::cin >> a;
	}

	double result = 0;
	for(const auto &a : A) {
		result += 1.0 / a;
	}
	result = 1.0 / result;

	std::cout << result << std::endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:45: error: 'numeric_limits' is not a member of 'std'
    6 |         std::cout << std::setprecision(std::numeric_limits<double>::max_digits10);
      |                                             ^~~~~~~~~~~~~~
a.cc:6:60: error: expected primary-expression before 'double'
    6 |         std::cout << std::setprecision(std::numeric_limits<double>::max_digits10);
      |                                                            ^~~~~~
Language: C++

#include <iostream>

int main(){
	int N,a,total=0;
	for(int i; i<N; i++){
		cin >> a;
		total += 1/total;
	}
	total = 1/total;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |                 cin >> a;
      |                 ^~~
      |                 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
      |                  ^~~
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.at(i);
  }
  double B=0;
  for(int i=0;i<N;i++){
    B =　B + 1/A.at(i);
  }
  
  cout << 1/B << endl;
}

Compiler output:
a.cc:13:8: error: extended character 　 is not valid in an identifier
   13 |     B =　B + 1/A.at(i);
      |        ^
a.cc: In function 'int main()':
a.cc:13:8: error: '\U00003000B' was not declared in this scope
   13 |     B =　B + 1/A.at(i);
      |        ^~~
Language: C++

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

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> n;
  	vector<int> a(n) = {0} ;
  	float sum = 0;
 	rep(i, n){
      int a;
      cin >> a;
      sum += 1/a;
    }
  
  	cout << 1 / sum << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:26: error: expected ',' or ';' before '=' token
   12 |         vector<int> a(n) = {0} ;
      |                          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< long long > vll;
typedef pair< int,int > ii;
typedef long long ll;
#define F first
#define S second
#define mem(a) memset(a,0,sizeof(a))
#define sz(a) int(a.size())
#define pb push_back
#define all(c) c.begin(),c.end()
#define tr(container,it) for(auto it=container.begin();it!=container.end();it++)
#define present(container, element) (container.find(element) != container.end())
#define vpresent(container, element) (find(all(container),element) != container.end()) //for vectors

int main()
{
    /*freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("error.txt","w",stderr);*/
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
  cin>>n;
 int x;
  for(int i=0;i<n;i++)
  {
    cin>>x;
    double sum+=(1.0/x);
  }
  cout<<fixed<<setprecision(12)<<(1.0/sum);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: expected initializer before '+=' token
   31 |     double sum+=(1.0/x);
      |               ^~
a.cc:33:39: error: 'sum' was not declared in this scope
   33 |   cout<<fixed<<setprecision(12)<<(1.0/sum);
      |                                       ^~~
Language: C++

#include <iostream>
#include <vector>
 
using namespace std;
 
int main(){
  int N;
  double v[110] = {};
  double sum = 0.0;
  
  cin >> N;
  for(int i = 0;i<N;i++)cin >>v[i];
  for(int i = 0;i<N;i++)sum += 1.0/v[i];
  sum = 1.0/sum;
  cout << sum　<<endl;
  
  return 0;
}

Compiler output:
a.cc:15:11: error: extended character 　 is not valid in an identifier
   15 |   cout << sum　<<endl;
      |           ^
a.cc: In function 'int main()':
a.cc:15:11: error: 'sum\U00003000' was not declared in this scope
   15 |   cout << sum　<<endl;
      |           ^~~~~
Language: C++

#include <iostream>
#include <vector>
 
using namespace std;
 
int main(){
  int N;
  double v[110];
  double sum = 0.0;
  
  cin >> N;
  for(int i = 0;i<N;i++)cin >>v[i];
  for(int i = 0;i<N;i++)sum += 1.0/v[i];
  sum = 1.0/sum;
  cout << sum　<<endl;
  
  return 0;
}

Compiler output:
a.cc:15:11: error: extended character 　 is not valid in an identifier
   15 |   cout << sum　<<endl;
      |           ^
a.cc: In function 'int main()':
a.cc:15:11: error: 'sum\U00003000' was not declared in this scope
   15 |   cout << sum　<<endl;
      |           ^~~~~
Language: C++

#include <iostream>
#include <vector>
 
using namespace std;
 
int main(){
  int N;
  double v[110];
  double val = 0.0;
  
  cin >> N;
  for(int i = 0;i<N;i++)cin >>v[i];
  for(int i = 0;i<N;i++)val += 1.0/v[i];
  val = 1.0/val;
  cout << val　<<endl;
  
  return 0;
}

Compiler output:
a.cc:15:11: error: extended character 　 is not valid in an identifier
   15 |   cout << val　<<endl;
      |           ^
a.cc: In function 'int main()':
a.cc:15:11: error: 'val\U00003000' was not declared in this scope
   15 |   cout << val　<<endl;
      |           ^~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int N;
  double v[110];
  double val = 0.0;
  
  cin >> N;
  for(int i = 0;i<N;i++)cin >>v[i];
  for(int i = 0;i<N;i++)val += 1.0/v[i];
  val = 1.0/val;
  cout << val　<<endl;
  
  return 0;
}

Compiler output:
a.cc:15:11: error: extended character 　 is not valid in an identifier
   15 |   cout << val　<<endl;
      |           ^
a.cc: In function 'int main()':
a.cc:15:11: error: 'val\U00003000' was not declared in this scope
   15 |   cout << val　<<endl;
      |           ^~~~~
Language: C++

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

using namespace std;

int main(){
  int N;
  std::vector<int> v(N);
  double val = 0.0;
  
  cin >> N;
  for(int i == 0;i<N;i++)cin >>v[i];
  for(int i == 0;i<N;i++)val += 1/v[i];
  val = 1/val;
  cout << val;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: expected ';' before '==' token
   13 |   for(int i == 0;i<N;i++)cin >>v[i];
      |            ^~~
      |            ;
a.cc:13:13: error: expected primary-expression before '==' token
   13 |   for(int i == 0;i<N;i++)cin >>v[i];
      |             ^~
a.cc:13:21: error: expected ')' before ';' token
   13 |   for(int i == 0;i<N;i++)cin >>v[i];
      |      ~              ^
      |                     )
a.cc:13:22: error: 'i' was not declared in this scope
   13 |   for(int i == 0;i<N;i++)cin >>v[i];
      |                      ^
a.cc:14:12: error: expected ';' before '==' token
   14 |   for(int i == 0;i<N;i++)val += 1/v[i];
      |            ^~~
      |            ;
a.cc:14:13: error: expected primary-expression before '==' token
   14 |   for(int i == 0;i<N;i++)val += 1/v[i];
      |             ^~
a.cc:14:21: error: expected ')' before ';' token
   14 |   for(int i == 0;i<N;i++)val += 1/v[i];
      |      ~              ^
      |                     )
Language: C++

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

int main() {
   int N;
   cin >> N;
   vector<int> A(N);
   for(int &x : A) cin >> x;

   double ans = 0.0;
   for(int &x : A) ans += 1/(double)A;
   ans = 1 / ans;

   printf("%.5lf\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:29: error: invalid cast from type 'std::vector<int>' to type 'double'
   11 |    for(int &x : A) ans += 1/(double)A;
      |                             ^~~~~~~~~
Language: C++

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

int main() {
   int N;
   cin >> N;
   vector<int> A(N);
   for(int &x : A) cin >> x;

   for(int &x : A) ans += 1/(double)A;
   ans = 1 / ans;

   printf("%.5lf\n", ans);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |    for(int &x : A) ans += 1/(double)A;
      |                    ^~~
      |                    abs
a.cc:10:29: error: invalid cast from type 'std::vector<int>' to type 'double'
   10 |    for(int &x : A) ans += 1/(double)A;
      |                             ^~~~~~~~~
a.cc:11:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |    ans = 1 / ans;
      |    ^~~
      |    abs
Language: C

#include<stdio.h>

int main(){
 float n,sum=0;
 int i;
 scanf("%d", &n);
 float aa[n];
 for(i=0;i<n;i++){
	scanf("%f ", &aa[i]);
 }
 for(i=0;i<n;i++){
   sum += 1/aa[i]
 }
 printf("%f" , 1/sum);
}

Compiler output:
main.c: In function 'main':
main.c:7:8: error: size of array 'aa' has non-integer type
    7 |  float aa[n];
      |        ^~
main.c:12:18: error: expected ';' before '}' token
   12 |    sum += 1/aa[i]
      |                  ^
      |                  ;
   13 |  }
      |  ~
Language: C++

#include <iostream>
using namespace std;
int main()
{
	int n;
	cin >> n;
	double a,total=0;
	for(i=0;i<n;i++){
		cin >> a;
		total += 1/a;
	} 
	cout << 1/total << endl;
	return 0;
}


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

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

int main(){
    int n;
    double ans,g;
    cin>>n;
    rep(i,n){
        cin>>g;
        ans+=1/g;
        }
    cout<<setprecision(16)<<1/ans<<endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: expected '}' at end of input
   13 |     cout<<setprecision(16)<<1/ans<<endl;
      |                                         ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C

#include <stdio.h>

int main(){

  int n;
  int i;
  double result = 0.0, a;

  scanf("%d", &n);

  for (i = 0; i < n; i++){
    scanf("%lf", &a);
    a = 1 / a;
    result += a;
  }
  result = 1 / result;

  printf("%f\n", result);

  return 0;
}
B_Re

Compiler output:
main.c:22:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input
   22 | B_Re
      | ^~~~
Language: Java

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a =    sc.nextInt();
		double num = 0;
		for(int i = 0; i < a;i++) {
			int b =    sc.nextInt();
			num += 1 /b;
		}
		 num = 1.0 / num;  
       System.out.println(num);
	}
}


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

#include <iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  auto A = vector<long double>(n);
  for (int i = 0; i < n; ++i){
  	cin >> A[i];
  }
  long double sum = 0.0;
  for (auto& a : A){
  	sum += 1.0/a;
  }
  cout << 1.0/sum;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'vector' was not declared in this scope
    7 |   auto A = vector<long double>(n);
      |            ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:19: error: expected primary-expression before 'long'
    7 |   auto A = vector<long double>(n);
      |                   ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; ++i){
  	cin >> A[i];
  }
  double sum = 0.0d;
  for (auto& a : A){
  	sum += 1.0d/a;
  }
  cout << 1.0d/sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> A(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:10: error: expected primary-expression before 'int'
    7 |   vector<int> A(n);
      |          ^~~
a.cc:9:16: error: 'A' was not declared in this scope
    9 |         cin >> A[i];
      |                ^
a.cc:12:18: error: 'A' was not declared in this scope
   12 |   for (auto& a : A){
      |                  ^
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<N;i++)
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<N;i++)
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:7: error: 'i' undeclared (first use in this function)
    7 |   for(i=0;i<N;i++)
      |       ^
main.c:7:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:3: error: implicit declaration of function 'prntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   13 |   prntf("%d",1/sum);
      |   ^~~~~
      |   printf
Language: C++

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

int main() {
  int N;
  int A;
  int S=0;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>A;
    S=S+1/A
  }
  cout<<1/S<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before '}' token
   11 |     S=S+1/A
      |            ^
      |            ;
   12 |   }
      |   ~
Language: Java

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

public class main {

	public static void main(String[] args) {

		Scanner in = new Scanner(System.in);
		int N = Integer.valueOf(in.nextLine());
		
		if(N == 1) System.out.println(in.next());
		else {
			int[] a = Arrays.stream(in.nextLine().split(" ", -1)).mapToInt(Integer::valueOf).toArray();
			int x = call(a, 0);
			double sum = 0;
			for(int i : a) sum += 1 * x / i;
			System.out.println(x / sum);
		}

	}

	public static int a(int a, int b) {
		return a > b ? a % b == 0 ? a : a * b
				: b % a == 0 ? b : a * b;
	}

	public static int call(int[] a, int idx) {
		return a(a[idx], idx != a.length - 1 ? call(a, idx + 1) : 1);
	}
}


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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'snanf' was not declared in this scope; did you mean 'scanf'?
    9 |         snanf("%f",&nums[i]);
      |         ^~~~~
      |         scanf
a.cc:13:20: error: 'num' was not declared in this scope; did you mean 'sum'?
   13 |         sum=sum+(1/num[i]);
      |                    ^~~
      |                    sum
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'snanf' was not declared in this scope; did you mean 'scanf'?
    9 |         snanf("%d",&nums[i]);
      |         ^~~~~
      |         scanf
a.cc:13:20: error: 'num' was not declared in this scope; did you mean 'sum'?
   13 |         sum=sum+(1/num[i]);
      |                    ^~~
      |                    sum
Language: C++

#include<stdio.h>

int main(void){
	int k,nums[1000],sum=0;
  
  	scanf("%d",&k);
  	
  	for(int i=0;i<k;i++){
      	snanf("%d",&nums[i]);
    }
  
  	for(int i=0;i<k;i++){
    	sum=sum+(1/num[i]);
    }
  
  	printf("%d\n",1/sum);
  
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:9: error: 'snanf' was not declared in this scope; did you mean 'scanf'?
    9 |         snanf("%d",&nums[i]);
      |         ^~~~~
      |         scanf
a.cc:13:20: error: 'num' was not declared in this scope; did you mean 'sum'?
   13 |         sum=sum+(1/num[i]);
      |                    ^~~
      |                    sum
Language: Java

import java.util.*;
import java.io.*;
class Main{
	public static void main(String[] args){
    
    		Scanner sc = new Scanner(System.in);
      		int n = sc.nextInt();
      		float sum = 0.0;
      		for(int i=0;i<n;i++){
            
            	float x = sc.nextFloat();
            	
            	sum += (1/x);
            }
    		System.out.println(1/sum);
    
    }



}

Compiler output:
Main.java:8: error: incompatible types: possible lossy conversion from double to float
      		float sum = 0.0;
      		            ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double sum;
  int s,a;

  cin >> s;
  sum = 0;

  for (i = 0; i < s; i++){
    cin >> a;
    sum += (1 / a);
  }
  cout << 1 / sum << endl;
}

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

import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double A = 0;
		
		for(int i = 0; i <N; i++){
			A += 1/sc.nextDouble();
			}
		}
		System.out.print(1/A);
	}


Compiler output:
Main.java:13: error: <identifier> expected
		System.out.print(1/A);
		                ^
Main.java:13: error: illegal start of type
		System.out.print(1/A);
		                 ^
2 errors
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double A = 0;
		
		for(int i = 0; i <N; i++){
			A+=1/N.nextDouble();
			}
		}
		System.out.print(1/A);
	}


Compiler output:
Main.java:13: error: <identifier> expected
		System.out.print(1/A);
		                ^
Main.java:13: error: illegal start of type
		System.out.print(1/A);
		                 ^
2 errors
Language: Java

import java.util.*;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		double A = 0;

		for(int i = 0; i <N; i++){
			A += N.nextDouble();
			}
		}
		System.out.print(1/A);
	}


Compiler output:
Main.java:13: error: <identifier> expected
		System.out.print(1/A);
		                ^
Main.java:13: error: illegal start of type
		System.out.print(1/A);
		                 ^
2 errors
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		int A = sc.nextInt();
		int[] a = new int[A];
		
		int smax = 1000;
		int imax = Collections.max(a);
		int ans;
		
		for(int i = 0; i <a.length; i++){
			ans = imax / (N + A);
			}
		}
		System.out.print(ans);
	}



Compiler output:
Main.java:18: error: <identifier> expected
		System.out.print(ans);
		                ^
Main.java:18: error: <identifier> expected
		System.out.print(ans);
		                    ^
2 errors
Language: C++

#include<iostream>
using  namespace std;

int main()
{
  int n;
  cin>>n;
  
  int ar[n+1];
  for(int i=0;i<n;i++)
  cin>>ar[i];
  
  double ans=0.0;
  double tmp=0.0;
  
  for(int i=0;i<n;i++)
  tmp+=(1/ar[i]);
  
  ans=double(1)/(tmp);
  
  cout << fixed << setprecision(12) << 1.0 / sum << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:20: error: 'setprecision' was not declared in this scope
   21 |   cout << fixed << setprecision(12) << 1.0 / 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;
a.cc:21:46: error: 'sum' was not declared in this scope
   21 |   cout << fixed << setprecision(12) << 1.0 / sum << endl;
      |                                              ^~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main ()
{
  float resis;
  int N;
  float sum=0;
  resis=malloc(N*sizeof(int));
  scanf("%d",&N);
  printf("\n");
  for(int i=0;i<N;i++)
  {
    scanf("%d",&resis[i]);
    sum+=1/resis[i];
  }
  printf("%f",1/sum);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:9:9: error: incompatible types when assigning to type 'float' from type 'void *'
    9 |   resis=malloc(N*sizeof(int));
      |         ^~~~~~
main.c:14:22: error: subscripted value is neither array nor pointer nor vector
   14 |     scanf("%d",&resis[i]);
      |                      ^
main.c:15:17: error: subscripted value is neither array nor pointer nor vector
   15 |     sum+=1/resis[i];
      |                 ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main ()
{
  int* resistance=NULL;
  int ,i=0,N;
  float sum=0, inverse;
  scanf("%d",&N);
  resistance=malloc(N*sizeof(int));
  for(i=0;i<N;i++)
  {
    scanf("%d",&resistance[i]);
  }

  for(i=0;i<100;i++)
  {
    sum+=(float)1/(resistance[i]);
  }
  inverse=(float)1/sum;
  printf("\n%f",inverse);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:7:7: error: expected identifier or '(' before ',' token
    7 |   int ,i=0,N;
      |       ^
main.c:9:15: error: 'N' undeclared (first use in this function)
    9 |   scanf("%d",&N);
      |               ^
main.c:9:15: note: each undeclared identifier is reported only once for each function it appears in
main.c:11:7: error: 'i' undeclared (first use in this function)
   11 |   for(i=0;i<N;i++)
      |       ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main ()
{
  int resistance[100];
  int sum=0,i,N;
  float inverse;
  scanf("%d",&N);
  resistance=malloc(N*sizeof(int));
  for(i=0;i<N;i++)
  {
    scanf("%d",&resistance[i]);
  }

  for(i=0;i<100;i++)
  {
    sum+=1./(resistance[i]);
  }
  inverse=1./sum;
  printf("%f",inverse);
  return 0;

}


Compiler output:
main.c: In function 'main':
main.c:10:13: error: assignment to expression with array type
   10 |   resistance=malloc(N*sizeof(int));
      |             ^
Language: C++

#include "bits/stdc++.h"
using namespace std;
int main() {
	int N;
	long float sum = 0;
	long float s = 0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> s;
		sum = sum + 1 / s;
	}
	cout << 1 / sum;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:9: error: 'long' specified with 'float'
    5 |         long float sum = 0;
      |         ^~~~
a.cc:6:9: error: 'long' specified with 'float'
    6 |         long float s = 0;
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
#define REP(i,N) for (int i=0;i<(N); ++i)
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

int main(){
    int N;
    cin >>N;
    vector<double>A(N);
    REP(i,N) cin >>A[i];
    double inv1=0,inv2=0;
    REP(i,N) inv1=inv1+1/A(N);
    inv2=1/inv1;
    cout <<inv2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:27: error: no match for call to '(std::vector<double>) (int&)'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |                          ~^~~
Language: C++

#include<bits/stdc++.h>
#define REP(i,N) for ({int i=0;i<(N); ++i})
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

int main(){
    int N;
    cin >>N;
    vector<double>A(N);
    REP(i,N) cin >>A[i];
    double inv1=0,inv2=0;
    REP(i,N) inv1=inv1+1/A(N);
    inv2=1/inv1;
    cout <<inv2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:23: error: expected primary-expression before '{' token
    2 | #define REP(i,N) for ({int i=0;i<(N); ++i})
      |                       ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N) cin >>A[i];
      |     ^~~
a.cc:2:43: error: expected primary-expression before ')' token
    2 | #define REP(i,N) for ({int i=0;i<(N); ++i})
      |                                           ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N) cin >>A[i];
      |     ^~~
a.cc:2:43: error: expected ';' before ')' token
    2 | #define REP(i,N) for ({int i=0;i<(N); ++i})
      |                                           ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N) cin >>A[i];
      |     ^~~
a.cc:15:22: error: 'i' was not declared in this scope
   15 |     REP(i,N) cin >>A[i];
      |                      ^
a.cc:2:23: error: expected primary-expression before '{' token
    2 | #define REP(i,N) for ({int i=0;i<(N); ++i})
      |                       ^
a.cc:17:5: note: in expansion of macro 'REP'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |     ^~~
a.cc:2:43: error: expected primary-expression before ')' token
    2 | #define REP(i,N) for ({int i=0;i<(N); ++i})
      |                                           ^
a.cc:17:5: note: in expansion of macro 'REP'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |     ^~~
a.cc:2:43: error: expected ';' before ')' token
    2 | #define REP(i,N) for ({int i=0;i<(N); ++i})
      |                                           ^
a.cc:17:5: note: in expansion of macro 'REP'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |     ^~~
a.cc:17:27: error: no match for call to '(std::vector<double>) (int&)'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |                          ~^~~
Language: C++

#include<bits/stdc++.h>
#define REP(i,N) for {int i=0;i<(N); ++i}
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

int main(){
    int N;
    cin >>N;
    vector<double>A(N);
    REP(i,N) cin >>A[i];
    double inv1=0,inv2=0;
    REP(i,N) inv1=inv1+1/A(N);
    inv2=1/inv1;
    cout <<inv2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:22: error: expected '(' before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N) cin >>A[i];
      |     ^~~
a.cc:2:22: error: expected primary-expression before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N) cin >>A[i];
      |     ^~~
a.cc:15:22: error: 'i' was not declared in this scope
   15 |     REP(i,N) cin >>A[i];
      |                      ^
a.cc:16:5: error: expected primary-expression before 'double'
   16 |     double inv1=0,inv2=0;
      |     ^~~~~~
a.cc:15:25: error: expected ')' before 'double'
   15 |     REP(i,N) cin >>A[i];
      |                         ^
      |                         )
   16 |     double inv1=0,inv2=0;
      |     ~~~~~~               
a.cc:2:22: note: to match this '('
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N) cin >>A[i];
      |     ^~~
a.cc:2:22: error: expected '(' before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:17:5: note: in expansion of macro 'REP'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |     ^~~
a.cc:2:22: error: expected primary-expression before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:17:5: note: in expansion of macro 'REP'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |     ^~~
a.cc:17:14: error: 'inv1' was not declared in this scope
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |              ^~~~
a.cc:17:27: error: no match for call to '(std::vector<double>) (int&)'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |                          ~^~~
a.cc:18:5: error: 'inv2' was not declared in this scope
   18 |     inv2=1/inv1;
      |     ^~~~
a.cc:18:16: error: expected ')' before ';' token
   18 |     inv2=1/inv1;
      |                ^
      |                )
a.cc:2:22: note: to match this '('
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:17:5: note: in expansion of macro 'REP'
   17 |     REP(i,N) inv1=inv1+1/A(N);
      |     ^~~
a.cc:19:12: error: 'inv2' was not declared in this scope
   19 |     cout <<inv2<<endl;
      |            ^~~~
Language: C++

#include<bits/stdc++.h>
#define REP(i,N) for {int i=0;i<(N); ++i}
#define ALL(x) (x).begin(), (x).end()
#define MOD 1000000007
#define PB push_back
#define MP make_pair
using namespace std;
typedef long long ll;
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}

int main(){
    int N;
    cin >>N;
    vector<double>A(N);
    REP(i,N){
        cin >>A[i];
    }
    double inv1=0,inv2=0;
    REP(i,N){
        inv1=inv1+1/A(N);
    }
    inv2=1/inv1;
    cout <<inv2<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:22: error: expected '(' before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N){
      |     ^~~
a.cc:2:22: error: expected primary-expression before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N){
      |     ^~~
a.cc:15:13: error: expected primary-expression before '{' token
   15 |     REP(i,N){
      |             ^
a.cc:15:13: error: expected ';' before '{' token
a.cc:15:13: error: expected primary-expression before '{' token
a.cc:15:13: error: expected ')' before '{' token
a.cc:2:22: note: to match this '('
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:15:5: note: in expansion of macro 'REP'
   15 |     REP(i,N){
      |     ^~~
a.cc:16:17: error: 'i' was not declared in this scope
   16 |         cin >>A[i];
      |                 ^
a.cc:2:22: error: expected '(' before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:19:5: note: in expansion of macro 'REP'
   19 |     REP(i,N){
      |     ^~~
a.cc:2:22: error: expected primary-expression before '{' token
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:19:5: note: in expansion of macro 'REP'
   19 |     REP(i,N){
      |     ^~~
a.cc:19:13: error: expected primary-expression before '{' token
   19 |     REP(i,N){
      |             ^
a.cc:19:13: error: expected ';' before '{' token
a.cc:19:13: error: expected primary-expression before '{' token
a.cc:19:13: error: expected ')' before '{' token
a.cc:2:22: note: to match this '('
    2 | #define REP(i,N) for {int i=0;i<(N); ++i}
      |                      ^
a.cc:19:5: note: in expansion of macro 'REP'
   19 |     REP(i,N){
      |     ^~~
a.cc:20:22: error: no match for call to '(std::vector<double>) (int&)'
   20 |         inv1=inv1+1/A(N);
      |                     ~^~~
Language: C++

#include<iostream>
using namespace std;
double in, ans;
int sz;
int main(){
  cin>>sz;
  for(int i = 1; i<=sz;i++){
    cin>>in;
    in=1.0/in;
    ans+=in;
  }
  cout<<fixed<<setprecision(8)<<1.0/ans;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'setprecision' was not declared in this scope
   12 |   cout<<fixed<<setprecision(8)<<1.0/ans;
      |                ^~~~~~~~~~~~
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++>
using namespace std;

int main(){
	int n;
    cin>>n;
  	int arr[n];
  	double result=0; 
  	int a;
  	for(int i=0;i<n;i++){
    	cin>>a;
      	result+=(double)1/a;
    }
    result = 1/result;
  	cout<<result;
	return 0;
}

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

#include<algorithm>
#include<iomanip>
using namespace std;
int main(){
  int N;
  cin>>N;
  double a[100];
  for(int j=0; j<N; j++){
      cin>>a[j];
  }
  long double sum=0.000000;
  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<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];
  }
  double sum=0.000000;
  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<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.000000;
  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<algorithm>
#include<iomanip>
using namespace std;
int main(){
  int N;
  cin>>N;
  double a[100];
  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>'