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


#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <stack>
#include <utility>
#include <tuple>
using namespace std;

const double pi = acos(-1);
#define nyan cout << "(=^•ω•^=)" << endl;
#define int long long
#define rep(i, n) for(int i = 0; i < n; i++)
#define loop while(true)

int t;
float hoge=1000;

float temp(int i){
    return t-0.006*i;
}

signed main(){
    int n;cin>>n;
    int a;
    cin>>t>>a;
    rep(i,n){
        int h;cin>>h;
        if(abs(temp(h))-a<hoge){
            hoge=abs(temp(h)-a);
            ans=i+1;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   34 |             ans=i+1;
      |             ^~~
      |             abs
a.cc:37:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   37 |     cout<<ans<<endl;
      |           ^~~
      |           abs
Language: C

#include <stdio.h>
#include <math.h>
int main ()
{
	int x,n,i,a,h[1000],ans;
	float min,temp[1000];
	
	scanf("%d%d%d",&n,&t,&a);
	for(i=0;i<n;i++){
		scanf("%d",&h[i]);
		temp[i] = fabsf(t - h[i]*0.006);
	}
	min = temp[0];
	for(i=0;i<n;i++){
		if(min>temp[i]){
			min = temp[i];
			ans = i;
		}
	}
	printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:8:28: error: 't' undeclared (first use in this function)
    8 |         scanf("%d%d%d",&n,&t,&a);
      |                            ^
main.c:8:28: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int n,ans;
	double t,a;
	scanf("%d %lf %lf",&n ,&t ,&a);
	double array[];
	for(int i = 0; i<= n; i++){
		scanf("%lf",&array[i]);
		array[i] = fabs(a-(t - array[i]*0.006)); 
	}
	ans = 0;
	double min = array[0];
	for(int i; i<= n; i++){
		if(min > array[i]){
			min = array[i];
			ans = i;
		}
	}
	printf("%d",ans + 1);
	return 0;
	
}

Compiler output:
main.c: In function 'main':
main.c:9:16: error: array size missing in 'array'
    9 |         double array[];
      |                ^~~~~
Language: C

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int n,ans;
	double t,a;
	scanf("%d %lf %lf",&n ,&t ,&a);
	double array[];
	for(int i = 0; i< n; i++){
		scanf("%lf",&array[i]);
		array[i] = fabs(a-(t - array[i]*0.006)); 
	}
	ans = 0;
	double min = array[0];
	for(int i; i<n; i++){
		if(min > array[i]){
			min = array[i];
			ans = i;
		}
	}
	printf("%d",ans + 1);
	return 0;
	
}

Compiler output:
main.c: In function 'main':
main.c:9:16: error: array size missing in 'array'
    9 |         double array[];
      |                ^~~~~
Language: C

#include<stdio.h>
int main() {
	int a, b, c, d, e, f, g, h, o, k;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	int g = 1000;
	int aa[a];
	for (int i = 0; i < a; i++){
		scanf("%d", &aa[i]);
		e = b - aa[i] * 6 / 1000;
		f = c - e;
		if (f < 0) f *= -1;
		if (f < g) f = g;
	}
	int h = 100;
	int m = 0;
	while (h = g){
		o = b - aa[m] * 6 / 1000;
		h = c - o;
		if (h < 0) h *= -1;
		m += 1;
	}
	printf("%d", m);
}

Compiler output:
main.c: In function 'main':
main.c:7:13: error: redeclaration of 'g' with no linkage
    7 |         int g = 1000;
      |             ^
main.c:3:31: note: previous declaration of 'g' with type 'int'
    3 |         int a, b, c, d, e, f, g, h, o, k;
      |                               ^
main.c:16:13: error: redeclaration of 'h' with no linkage
   16 |         int h = 100;
      |             ^
main.c:3:34: note: previous declaration of 'h' with type 'int'
    3 |         int a, b, c, d, e, f, g, h, o, k;
      |                                  ^
Language: C

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int n,ans;
	double t,x,a;
	scanf("%d %lf %lf",&n ,&t ,&a);
	double array[];
	for(int i = 0; i< n; i++){
		scanf("%lf",&x);
		array[i] = fabs(a-(t - x*0.006)); 
	}
	ans = 0;
	double xmin = array[0];
	for(int i; i<n; i++){
		if(xmin > array[i]){
			xmin = array[i];
			ans = i;
		}
	}
	printf("%d",ans + 1);
	return 0;
	
}


Compiler output:
main.c: In function 'main':
main.c:9:16: error: array size missing in 'array'
    9 |         double array[];
      |                ^~~~~
Language: C

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
	int n,ans;
	double t,x,a;
	scanf("%d %lf %lf",&n ,&t ,&a);
	double array[];
	for(int i = 0; i< n; i++){
		scanf("%lf",&x);
		array[i] = fabs(a-(t - x*0.006)); 
	}
	ans = 0;
	double xmin = array[0];
	for(int i; i<n; i++){
		if(xmin > array[i]){
			xmin = array[i];
			ans = i;
		}
	}
	printf("%d",ans);
	
	
}

Compiler output:
main.c: In function 'main':
main.c:9:16: error: array size missing in 'array'
    9 |         double array[];
      |                ^~~~~
Language: C++

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

int main() {
  double N, T, A;
  cin >> N >> T >> A;
  int H[N];
  double ave[N];
  for (int i = 0; i < N; i++) {
    cin >> H[i];
    ave[i] = T - double(H[i]) * 0.006;
  }
  int temp = 100000;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (abs(ave[i] - A) < temp) {
      temp = abs(ave[i] - A);
      ans = i;
    }
  }
  cout << ans + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    8 |   int H[N];
      |         ^
a.cc:8:9: error: could not convert 'N' from 'double' to 'long unsigned int'
    8 |   int H[N];
      |         ^
      |         |
      |         double
a.cc:8:9: error: size of array 'H' has non-integral type 'double'
a.cc:9:14: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    9 |   double ave[N];
      |              ^
a.cc:9:14: error: could not convert 'N' from 'double' to 'long unsigned int'
    9 |   double ave[N];
      |              ^
      |              |
      |              double
a.cc:9:14: error: size of array 'ave' has non-integral type 'double'
Language: C

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

int c[n];
double d[n];


for(i=0; i<n; i++ ){

scanf("%d",&c[i]);

d[i]=e-c[i]*0.06;

double min;

min=d[0];

if(d[i]>min) min=d[i];

}


printf("%d",i);


return 0;

}

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

#include <math.h>
#include <stdio.h>
int main()
{
	int n,ans;
	double t,x,a;
	scanf("%d %lf %lf",&n ,&t ,&a);
	double xarray[];
	for(int i = 0; i< n; i++){
		scanf("%lf",&x);
		xarray[i] = fabs(a-(t - x*0.006)); 
	}
	ans = 0;
	double xmin = xarray[0];
	for(int i; i<n; i++){
		if(xmin > xarray[i]){
			xmin = xarray[i];
			ans = i;
		}
	}
	printf("%d",ans);
	
	
}


Compiler output:
main.c: In function 'main':
main.c:8:16: error: array size missing in 'xarray'
    8 |         double xarray[];
      |                ^~~~~~
Language: C++

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

int n;
double t,a;
double h[100005];

int main(){
    cin >> n;
    cin >> t >> a;

    FOR(i,0,n)
        cin >> h[i];

    double tmp=abs(a-(t-h[0]*0.006));
    int cc=0;

    FOR(i,1,n){
        if(abs(a-(t-h[i]*0.006))<tmp){
            tmp=abs(a-(t-h[i]*0.006));
            cc=i;
        }
    }

    cout << cc+1;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:12:9: error: 'i' was not declared in this scope
   12 |     FOR(i,0,n)
      |         ^
a.cc:12:5: error: 'FOR' was not declared in this scope
   12 |     FOR(i,0,n)
      |     ^~~
Language: Java

import java.util.*;
public class B_Place{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> ar = new ArrayList<Integer>();
    int N = sc.nextInt();
    int T = sc.nextInt();
    int A = sc.nextInt();
    int H[] = new int[N];
    for(int i=0;i<N;i++){
      H[i] = sc.nextInt();
    }
    if(N == 1){
      System.out.println(1);
    }else{
      double min = Math.abs((T - H[0]*0.006) - A);
      for(int i=1;i<N;i++){
        if(Math.abs((T - H[i]*0.006) - A)<min){
          min = Math.abs((T - H[i]*0.006) - A);
          ar.add(i);
        }
      }
    }
    if(ar.size() == 0){
      System.out.println(1);
    }else{
      System.out.println(ar.get(ar.size()-1)+1);
    }

  }
}


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

#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n;
	int t,a;
	int h[1001];
	cin>>n;
	cin>>t>>a;
	for(int i=1;i<=n;i++){
		cin>>h[i];
	}
	int MIN;
	int x=INT_MAX;
	int z;
	a*=1000
	for(int i=1;i<=n;i++){
		MIN=t*1000-h[i]*1000*6;
		if(x>abs(MIN-a)){
			x=abs(MIN-a);
			z=i;
		}
	}
	cout<<z<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: expected ';' before 'for'
   15 |         a*=1000
      |                ^
      |                ;
   16 |         for(int i=1;i<=n;i++){
      |         ~~~     
a.cc:16:21: error: 'i' was not declared in this scope
   16 |         for(int i=1;i<=n;i++){
      |                     ^
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N;
  cin >> N;
  int T, A;
  cin >> T >> A;
  vector<int> H(N);
  for(int i = 0; i < N; i++) cin >> H[i];
  int mi = 1 << 29, j;
  for(int i = 0; i < N; i++) {
  	if (mi > abs(1000 * A - (1000 * T - x * 6)) ) {
      mi = abs(1000 * A - (1000 * T - x * 6));
      j = i;
    }
  }
  cout << j + 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:45: error: 'x' was not declared in this scope
   15 |         if (mi > abs(1000 * A - (1000 * T - x * 6)) ) {
      |                                             ^
Language: C

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

int main(void){
  double t,a,cmp;
  int x,i,c;
  int *s;

  if(scanf("%d",&x)==0)printf("e");
  if(scanf("%lf",&t)==0)printf("e");
  if(scanf("%lf",&a)==0)printf("e");
  s=(int *)malloc(sizeof(int)*x);

  for(i=0;i<x;i++){
    if(scanf("%d",&s[i])==0)printf("e");
  }
  c=0;
  cmp=a-(t-s[0]*0.006);
  for(i=1;i<x;i++){
    if(cmp=>(a-(t-s[i]*0.006))){
        cmp=a-(t-s[i]*0.006);
        c=i;
    }
  }
  printf("%d",c+1);
  free(s);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:20:12: error: expected expression before '>' token
   20 |     if(cmp=>(a-(t-s[i]*0.006))){
      |            ^
Language: C

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

int main(void){
  double t,a,cmp;
  int x,i,c;
  int *s;

  if(scanf("%d",&x)==0)printf("e");
  if(scanf("%lf",&t)==0)printf("e");
  if(scanf("%lf",&a)==0)printf("e");
  s=(int *)malloc(sizeof(int)*x);

  for(i=0;i<x;i++){
    if(scanf("%d",&s[i])==1)
  }
  c=0;
  cmp=a-(t-s[0]*0.006);
  for(i=1;i<x;i++){
    if(cmp>(a-(t-s[i]*0.006))){
        cmp=a-(t-s[i]*0.006);
        c=i;
    }
  }
  printf("%d",c+1);
  free(s);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:16:3: error: expected expression before '}' token
   16 |   }
      |   ^
Language: C++

#include <algorithm>
#include <iostream>
#include <vector>
 
int main() {
 
  int n;
  std::cin >> n
  int t, a;
  std::cin >> t >> a;
  std::vector<int> h(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> h[i];
  }
 
  std::vector<double> ave(n);
  for (int i = 0; i < n; ++i) {
    ave[i] = abs((t - h[i] * 0.006) - a);
  }
  int place = 0;
  for (int i = 1; i < n; ++i) {
    if (ave[i] < ave[place]) place = i;
  }
  std::cout << place + 1 << "\n";
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:16: error: expected ';' before 'int'
    8 |   std::cin >> n
      |                ^
      |                ;
    9 |   int t, a;
      |   ~~~           
a.cc:10:15: error: 't' was not declared in this scope
   10 |   std::cin >> t >> a;
      |               ^
a.cc:10:20: error: 'a' was not declared in this scope
   10 |   std::cin >> t >> a;
      |                    ^
Language: C++

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

int main() {
  int n;
  std::cin >> n;

  int t, a;
  std::cin >> t >> a;

  std::vector<int> h(n);
  for (int i = 0; i < n; ++i) {
    std::cin >> h[i];
  }

  std::vector<double> temp(n);
  for (int i = 0; i < n; ++i) {
    temp[i] = avs((t - h[i] * 0.006) - a);
  }

  int place = 0;
  for (int i = 1; i < n; ++i) {
    if ( temp[i] < temp[place] ) place = i;
  }
  std::cout << place + 1 << std::endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:15: error: 'avs' was not declared in this scope; did you mean 'abs'?
   19 |     temp[i] = avs((t - h[i] * 0.006) - a);
      |               ^~~
      |               abs
Language: C++

#include<cstdio>
#include<cmath>
#include <algorithm>
int N[100005];
double at[100005];
double a[100005];
int main(){
	int N;
	int T, A;
	int H;
	scanf("%d\n%d %d", &N, &T, &A);
	for(int i = 0; i < N; i++){
		scanf("%d ", &H[i]);		
	}
	for(int j = 0; i < N; j++){
		at[j] = abs(T - H[j] * 0.006 - T);
		a[j] = at[j]
	}
	sort(a, a+N);
	for(int i = 0; i < N; i++){
		if(at[i] == a[0])
		{
			printf("%d", i + 1);
		}
	}

}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:32: error: invalid types 'int[int]' for array subscript
   13 |                 scanf("%d ", &H[i]);
      |                                ^
a.cc:15:24: error: 'i' was not declared in this scope
   15 |         for(int j = 0; i < N; j++){
      |                        ^
a.cc:16:34: error: invalid types 'int[int]' for array subscript
   16 |                 at[j] = abs(T - H[j] * 0.006 - T);
      |                                  ^
a.cc:17:29: error: expected ';' before '}' token
   17 |                 a[j] = at[j]
      |                             ^
      |                             ;
   18 |         }
      |         ~                    
a.cc:19:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   19 |         sort(a, a+N);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:3:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
Language: C++

#include<cstdio>
#include<cmath>

int N[100005];
double at[100005];
double a[100005]
int main(){
	int N;
	int T, A;
	int H;
	scanf("%d\n%d %d", &N, &T, &A);
	for(int i = 0; i < N; i++){
		scanf("%d ", &H[i]);		
	}
	for(int j = 0; i < N; j++){
		at[j] = abs(T - H[j] * 0.006 - T);
		a[j] = at[j]
	}
	sort(a, a+N);
	for(int i = 0; i < N; i++){
		if(at[i] == a[0])
		{
			printf("%d", i + 1);
		}
	}

}

Compiler output:
a.cc:7:1: error: expected initializer before 'int'
    7 | int main(){
      | ^~~
Language: C++

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

int main(){
  int n,t,a;
  cin >> n >> t >> a;
  double h;
  double mini = 10e4;
  int num;
  for(int i = 1; i <= n; i++){
    cin >> h;
    h = t - h*0.006;
    if(mini > abs(double(a-h)){
      mini = abs(a-h);
      num = i;
    }
  }
  cout << num << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:31: error: expected ')' before '{' token
   16 |     if(mini > abs(double(a-h)){
      |       ~                       ^
      |                               )
a.cc:20:3: error: expected primary-expression before '}' token
   20 |   }
      |   ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define INF 1e+8
int main(){
  int n, a;
  double t, h, dst = INF;
  int ans = -1;
  cin >> n >> t >> a;
  for(int i=1;i<=n;i++){
    cin >> h;
    if(dst < abs(a-(t-h*0.006))){
      ans = i;
      dst = abs(a-(t-h*0.006))
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:31: error: expected ';' before '}' token
   13 |       dst = abs(a-(t-h*0.006))
      |                               ^
      |                               ;
   14 |     }
      |     ~
Language: C++

#include<bits/stdc++.h>
#define INF 1e+8
int main(){
  int n, a;
  double t, h, dst = INF;
  int ans = -1;
  cin >> n >> t >> a;
  for(int i=1;i<=n;i++){
    cin >> h;
    if(dst < abs(a-(t-h*0.006))){
      ans = i;
      dst = abs(a-(t-h*0.006))
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |   cin >> n >> t >> a;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:12:31: error: expected ';' before '}' token
   12 |       dst = abs(a-(t-h*0.006))
      |                               ^
      |                               ;
   13 |     }
      |     ~                          
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   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:15:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include<math.h>
#include<stdlib.h>
using namespace std;
signed main(void){
double N,A,T;
double a,i,j=0;
double x;
double H,y=999999999;

cin >>N;
cin >>T;
cin >>A;
for (i=1;i<=N;i++){
 cin >> H;
 x = T - H*0.006 - A;
x = abs(double x);
if(y>x){ j=i;y=x; }
}

cout <<j<<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:9: error: expected primary-expression before 'double'
   17 | x = abs(double x);
      |         ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#define MAXN 100000+10
using namespace std;
int a[MAXN];
int main (void)
{
	int n;
	int m,k;
	cin>>n>>m>>k;
	int minn = 1e9;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		minn=min(abs(m-a[i]*0.006),minn);
	}
	for(int i=1;i<=n;i++)
	{
		if(abs(m-a[i]*0.006)==minn)
		{
			cout<<i<<endl;
			return 0;
		}
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:25: error: no matching function for call to 'min(double, int&)'
   18 |                 minn=min(abs(m-a[i]*0.006),minn);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:18:25: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   18 |                 minn=min(abs(m-a[i]*0.006),minn);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:18:25: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   18 |                 minn=min(abs(m-a[i]*0.006),minn);
      |                      ~~~^~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

int main()
{
	int n,t,a;
	cin >> n >> t >> a;
	int arr[n],ind=0,minm = 1000000;
	a *= 1000;	
	for(int i = 0 ; i < n ; i++)
	{
		cin >> arr[i];
		int curr = 1000*t-6*h[i];
		if(abs(curr-a) < minm){
			minm = abs(curr-a);
			ind = i;		}
//		cout << arr[i] << endl;
	}
	cout << ind+1 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:37: error: 'h' was not declared in this scope
   13 |                 int curr = 1000*t-6*h[i];
      |                                     ^
Language: C++

#include <iostream>
#include <cmath>
using namespace std;
 
int main(void){
  int n,t,a;
  int top = 1000000;
  int flag = 0;
  double h[1002];
  cin >> n;
  cin >> t >> a;
  for(int i = 0; i < n; i++){
    cin >> h[i];
    double th = t - h[i] * 0.006;
    double sa = abs(a - th)
    if(top > (sa)){
      top = th;
      flag = i + 1;
    }
  }
  cout << flag << endl;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: expected ',' or ';' before 'if'
   16 |     if(top > (sa)){
      |     ^~
Language: C++

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

using namespace std;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
 
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

int main(void){

    double N,T,A,ans=0,tmp1,tmp2;
    
    cin >> N >> T >> A;
    
    vector<double> vec(N);
    REP(i,N) cin >> vec[i];

    double min = 9999999999;

     REP(i,N){

        tmp1 = T - 0.006*vec[i];    
        
        tmp2 = A-tmp[i];
        if(tmp < 0)  tmp2 *= -1;
 
        if(min > tmp2){
            min = tmp2;
            ans= i+1;
        }  
    }

    cout << ans << endl;
   
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:18: error: 'tmp' was not declared in this scope; did you mean 'tmp2'?
   29 |         tmp2 = A-tmp[i];
      |                  ^~~
      |                  tmp2
Language: C

int N,T,A,min=10000000,t=0;
scanf("%d",&N);
scanf("%d %d",&T,&A);
int H[N];
double P[N],C[N];
	for(int i=0;i<N;i++){
		scanf("%d",&H[i]);
		P[i]=T-(H[i]*0.006);
		C[i]=fabs(A-T+(H[i]*0.006));
		
	}
	
	

	for(int i=0;i<N;i++){
	if(C[min]>C[i]); 
	min=i;
	}
	printf("%d",min+1);
} 

Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before string constant
    2 | scanf("%d",&N);
      |       ^~~~
main.c:2:12: error: expected declaration specifiers or '...' before '&' token
    2 | scanf("%d",&N);
      |            ^
main.c:3:7: error: expected declaration specifiers or '...' before string constant
    3 | scanf("%d %d",&T,&A);
      |       ^~~~~~~
main.c:3:15: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d %d",&T,&A);
      |               ^
main.c:3:18: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d %d",&T,&A);
      |                  ^
main.c:4:5: error: variably modified 'H' at file scope
    4 | int H[N];
      |     ^
main.c:5:8: error: variably modified 'P' at file scope
    5 | double P[N],C[N];
      |        ^
main.c:5:13: error: variably modified 'C' at file scope
    5 | double P[N],C[N];
      |             ^
main.c:6:9: error: expected identifier or '(' before 'for'
    6 |         for(int i=0;i<N;i++){
      |         ^~~
main.c:6:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    6 |         for(int i=0;i<N;i++){
      |                      ^
main.c:6:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    6 |         for(int i=0;i<N;i++){
      |                          ^~
main.c:15:9: error: expected identifier or '(' before 'for'
   15 |         for(int i=0;i<N;i++){
      |         ^~~
main.c:15:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   15 |         for(int i=0;i<N;i++){
      |                      ^
main.c:15:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   15 |         for(int i=0;i<N;i++){
      |                          ^~
main.c:19:16: error: expected declaration specifiers or '...' before string constant
   19 |         printf("%d",min+1);
      |                ^~~~
main.c:19:21: error: expected declaration specifiers or '...' before 'min'
   19 |         printf("%d",min+1);
      |                     ^~~
main.c:20:1: error: expected identifier or '(' before '}' token
   20 | }
      | ^
Language: C

#include <stdio.h>
#include <math.h>
int main()
{
  int n;
  float T,x,A;
  scanf("%d\n",&n);
  scanf("%f\n",&T);
  scanf("%f\n",&A);
int array[];
for (int i = 0; i <=n; i++) {
 scanf("%f\n",&x);
  array[i] = fabsf(T - x*0.006);
}
float min = array[0];
int f;
for (int i = 0; i <=n; i++) {
  if(array[i] < min) min = array[i];
  f = i
}
printf("%d",f+1);

}


Compiler output:
main.c: In function 'main':
main.c:10:5: error: array size missing in 'array'
   10 | int array[];
      |     ^~~~~
main.c:19:8: error: expected ';' before '}' token
   19 |   f = i
      |        ^
      |        ;
   20 | }
      | ~
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <cstdlib>
#include <iterator>
#include <algorithm>
#include <functional>
#include <random>
#include <bits/stdc++.h>

#include <stdio.h>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <math.h>
#include <ctime>
#include <cstring>

using namespace std;

#define FOR(i,N) for(int i=0;i<N;i++) 
#define COUT(str) cout << str << endl
#define MAX_N 100000
 
//入力
float n,t,a ;
float h[MAX_N+4] = {};
float dis[MAX_N+4] = {};
float ans[MAX_N+4] = {};
int main() {

	cin >> n >> t >> a;

	FOR(i, n) {
		cin >> h[i];
	}

	FOR(i, n) {

		dis[i] = abs(a-(t - 0.006*h[i]));
		ans[i] = dis[i];
	}

	sort(ans, ans + n);

	FOR(i, n) {
		if (ans[0] == dis[i]) {
			cout << i+1 << endl;
			return 0;
		}
	}
	

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:54:23: error: invalid operands of types 'float [100004]' and 'float' to binary 'operator+'
   54 |         sort(ans, ans + n);
      |                   ~~~ ^ ~
      |                   |     |
      |                   |     float
      |                   float [100004]
Language: C

int N,T,A,min=10000000,t=0;
scanf("%d",&N);
scanf("%d %d",&T,&A);
int H[N];
double P[N],C[N];
	for(int i=0;i<N;i++){
		scanf("%d",&H[i]);
		P[i]=T-(H[i]*0.006);
		C[i]=fabs(A-T+(H[i]*0.006));
		
	}
	
	for(int i=0;i<N;i++){
		printf("%0.1f  ",C[i]);
	}

	for(int i=0;i<N;i++){
	if(C[min]>C[i]); 
	min=i;
	}
	printf("%d",min+1);
} 


Compiler output:
main.c:2:7: error: expected declaration specifiers or '...' before string constant
    2 | scanf("%d",&N);
      |       ^~~~
main.c:2:12: error: expected declaration specifiers or '...' before '&' token
    2 | scanf("%d",&N);
      |            ^
main.c:3:7: error: expected declaration specifiers or '...' before string constant
    3 | scanf("%d %d",&T,&A);
      |       ^~~~~~~
main.c:3:15: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d %d",&T,&A);
      |               ^
main.c:3:18: error: expected declaration specifiers or '...' before '&' token
    3 | scanf("%d %d",&T,&A);
      |                  ^
main.c:4:5: error: variably modified 'H' at file scope
    4 | int H[N];
      |     ^
main.c:5:8: error: variably modified 'P' at file scope
    5 | double P[N],C[N];
      |        ^
main.c:5:13: error: variably modified 'C' at file scope
    5 | double P[N],C[N];
      |             ^
main.c:6:9: error: expected identifier or '(' before 'for'
    6 |         for(int i=0;i<N;i++){
      |         ^~~
main.c:6:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    6 |         for(int i=0;i<N;i++){
      |                      ^
main.c:6:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    6 |         for(int i=0;i<N;i++){
      |                          ^~
main.c:13:9: error: expected identifier or '(' before 'for'
   13 |         for(int i=0;i<N;i++){
      |         ^~~
main.c:13:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   13 |         for(int i=0;i<N;i++){
      |                      ^
main.c:13:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   13 |         for(int i=0;i<N;i++){
      |                          ^~
main.c:17:9: error: expected identifier or '(' before 'for'
   17 |         for(int i=0;i<N;i++){
      |         ^~~
main.c:17:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   17 |         for(int i=0;i<N;i++){
      |                      ^
main.c:17:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   17 |         for(int i=0;i<N;i++){
      |                          ^~
main.c:21:16: error: expected declaration specifiers or '...' before string constant
   21 |         printf("%d",min+1);
      |                ^~~~
main.c:21:21: error: expected declaration specifiers or '...' before 'min'
   21 |         printf("%d",min+1);
      |                     ^~~
main.c:22:1: error: expected identifier or '(' before '}' token
   22 | }
      | ^
Language: C++

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

int main() {
  int n;
  int t, a;
  int palace;
  cin >> n;
  cin >> t >> a;
  vector<int> d(n);
  int htmp;
  for(int i=0;i<n;i++){
    cin >> htmp;
    htmp = t - htmp*0.006;
    d.at(i) = abs(a-htmp);
  }
  int palace = distance(d.begin(), min_element(d.begin(), d.end()));
  cout << palace+1 << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: redeclaration of 'int palace'
   17 |   int palace = distance(d.begin(), min_element(d.begin(), d.end()));
      |       ^~~~~~
a.cc:7:7: note: 'int palace' previously declared here
    7 |   int palace;
      |       ^~~~~~
Language: C++

#include <iostream>
using namespace std;

int main(void){
  int n,t,a;
  int top = 10000;
  int flag = 0;
  double h[100010]
  cin >> n;
  cin >> t >> a;
  for(int i = 0; i < n; i++){
    cin >> h[i];
    int th = t - h[i] * 0.006;
    if(top > th){
      top = th;
      flag = i + 1;
    }
  }
  cout << flag << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'cin'
    9 |   cin >> n;
      |   ^~~
a.cc:12:12: error: 'h' was not declared in this scope
   12 |     cin >> h[i];
      |            ^
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
int n,t,a,ho=1000000,mm=0,i;
scanf ("%d%d%d",&n,&t,&a);
double h[n];
double k[n];

for (i=0;i<n;i++){
scanf ("%lf",&h[i]);
  k[i]=(double)abs((double)t-(double)((double)h[i]*0.006)-(double)a);
  if ((double)ho>(double)k[i]){
    (double)ho=(double)k[i];
    mm=i;
  }
}

printf ("%d",mm+1);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:13:15: error: lvalue required as left operand of assignment
   13 |     (double)ho=(double)k[i];
      |               ^
Language: C

#include <stdio.h>
int main(){
  
    int N,i;
    double H[1000],Ta[1000],Tb[1000];
    double T,A,max=1000;
  
    scanf("%d", N);
    scanf("%d", T);
    scanf("%d", A);
  
    for(i = 0; i < N, ++i){
      scanf("%lf", H[i]);
    }
  
    for(i = 0; i < N; ++i){
      Ta[i] = T - H[i] * 0.006;
    }
  
    for(i = 0; i < N; ++i){
      if(A - Ta[i] < 0){
        Tb[i] = Ta[i] - A;
      }
      else {
        Tb[i] = A - Ta[i];
      }
    }
  
    for(i = 0; i < N; ++i){
      if(Tb[i] < max){
        max = Tb[i];
      }
    }
  
    printf("%lf\n", max);
  
    return 0;
}
  
  
        

Compiler output:
main.c: In function 'main':
main.c:12:26: error: expected ';' before ')' token
   12 |     for(i = 0; i < N, ++i){
      |                          ^
      |                          ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,t,a;
  int h[100];
  cin>>n>>t>>a;
  for(int i=0;i<n;i++){
   cin>>h[i];
  }
  int min=100000;
  int ans;
  for(int i=0;i<n;i++){
   if(t-h[i]*0.006<min){
     min=t-h[i]*0.006;
     ans=i+1;
  }
    cout<<ans<<endl;
}

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

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

using namespace std;

#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
 
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

int main(void){

    double N,T,A,ans;
    
    cin >> N >> T >> A;
    
    vector<double> vec(N);
    REP(i,N) cin >> vec[i];
    
    REP(i,N){
       vec[i] = T - 0.006*vec[i];    
    }

   double min = 9999999999;

   ans=0;

   for(int i=0;i<N;i++){
       if(A-vec[i]>0){
           int tmp = A-vec[i];
           if(min < 0)  tmp *= -1;

           if(min > tmp){
               min = tmp;
               ans= i+1;
           }
   }

   cout << ans << endl;
   
}


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

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

int main(){
	long n,t,a,i,j;
	double k,b;
	cin >>n;
	cin >>t >>a;
	long h[n];
	for(i=0;i<n;i++)cin>> h[i];
	b=114514.0;
    j=0
	for(i=0;i<n;i++){
		k=abs((double)(a-t)+0.006*(double)(h[i]));
		if(k<b){
			b=k;
			j=i;
		}
	}
	cout<<j+1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: expected ';' before 'for'
   13 |     j=0
      |        ^
      |        ;
   14 |         for(i=0;i<n;i++){
      |         ~~~
a.cc:14:24: error: expected ';' before ')' token
   14 |         for(i=0;i<n;i++){
      |                        ^
      |                        ;
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,t,a;
  int h[100];
  cin>>n>>t>>a;
  for(int i=0;i<N;i++){
   cin>>h[i];
  }
  int min=100000;
  int ans;
  for(int i=0;i<N;i++){
   if(t-h[i]*0.006<min){
     min=t-h[i]*0.006;
     ans=i+1;
  }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   for(int i=0;i<N;i++){
      |                 ^
a.cc:13:17: error: 'N' was not declared in this scope
   13 |   for(int i=0;i<N;i++){
      |                 ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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

int main(){
	long n,t,a,i,j;
	double k,b;
	cin >>n;
	cin >>t >>a;
	long h[n];
	for(i=0;i<n;i++)cin>> h[i];
	b=114514.0;
    j=0
	for(i=0;i<n;i++){
		k=abs((double)(a-t)+0.006.0*(double)(h[i]));
		if(k<b){
			b=k;
			j=i;
		}
	}
	cout<<j+1;
	return 0;
}

Compiler output:
a.cc:15:37: error: too many decimal points in number
   15 |                 k=abs((double)(a-t)+0.006.0*(double)(h[i]));
      |                                     ^~~~~~~
a.cc: In function 'int main()':
a.cc:13:8: error: expected ';' before 'for'
   13 |     j=0
      |        ^
      |        ;
   14 |         for(i=0;i<n;i++){
      |         ~~~
a.cc:14:24: error: expected ';' before ')' token
   14 |         for(i=0;i<n;i++){
      |                        ^
      |                        ;
Language: C++

#include <iostream>
#include <cmath>
#define diff(x, y) ((x) > (y) ? ((x) - (y)) : ((y) - (x)))

using namespace std;
int main(void){
    int t, n, a, min = 500, ans, tmp;
    int *h;

    scanf("%d", &n);

    h = new int[n];


    scanf("%d %d", &t, &a);

    for(int i = 0; i < n; i++)
      scanf("%d", &h[i]);

    for(int i = 0; i < n; i++){

      tmp =　diff(a, (t - h[i] * 0.006));

      if(tmp < min){
        min = tmp;
        ans = i + 1;
      }
    }

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


}


Compiler output:
a.cc:22:12: error: extended character 　 is not valid in an identifier
   22 |       tmp =　diff(a, (t - h[i] * 0.006));
      |            ^
a.cc: In function 'int main()':
a.cc:22:12: error: '\U00003000diff' was not declared in this scope; did you mean 'diff'?
   22 |       tmp =　diff(a, (t - h[i] * 0.006));
      |            ^~~~~~
      |            diff
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n,t,a;
  int h[100];
  cin>>n>>t>>a;
  for(int i=0;i<N;i++){
   cin>>h[i];
  }
  int min=100000;
  ans;
  for(int i=0;i<N;i++){
   if(t-h[i]*0.006<min){
     min=t-h[i]*0.006;
     ans=i+1;
  }
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: 'N' was not declared in this scope
    8 |   for(int i=0;i<N;i++){
      |                 ^
a.cc:12:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |   ans;
      |   ^~~
      |   abs
a.cc:13:17: error: 'N' was not declared in this scope
   13 |   for(int i=0;i<N;i++){
      |                 ^
a.cc:19:2: error: expected '}' at end of input
   19 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
#include<math.h>
#include<stdlib.h>
using namespace std;
double main(void){
double N,A,T;
double a,i,j;
double x;
double H,y=999999999;

cin >>N;
cin >>T;
cin >>A;
for (i=1;i<=N;i++){
 cin >> H;
 x = T - H*0.006 - A;
x = abs(x);
if(y>x){ j=i;y=x; }
}

cout <<j<<endl;
return 0;
}

Compiler output:
a.cc:5:1: error: '::main' must return 'int'
    5 | double main(void){
      | ^~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    int N;
    cin >> N;
    int T, A;
    cin >> T >> A;
    std::vector<int> H;
    std::vector<int> temp;
    for (int i = 0; i < N; i++) {
        cin >> i.at(i);
        temp.at(i) = T - (H.at(i) * 0.006);
    }
    sort (temp.begin(), temp.end());
    cout << temp.at(0) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:10: error: 'vector' is not a member of 'std'
    8 |     std::vector<int> H;
      |          ^~~~~~
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:8:17: error: expected primary-expression before 'int'
    8 |     std::vector<int> H;
      |                 ^~~
a.cc:9:10: error: 'vector' is not a member of 'std'
    9 |     std::vector<int> temp;
      |          ^~~~~~
a.cc:9:10: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:9:17: error: expected primary-expression before 'int'
    9 |     std::vector<int> temp;
      |                 ^~~
a.cc:11:18: error: request for member 'at' in 'i', which is of non-class type 'int'
   11 |         cin >> i.at(i);
      |                  ^~
a.cc:12:9: error: 'temp' was not declared in this scope; did you mean 'tm'?
   12 |         temp.at(i) = T - (H.at(i) * 0.006);
      |         ^~~~
      |         tm
a.cc:12:27: error: 'H' was not declared in this scope
   12 |         temp.at(i) = T - (H.at(i) * 0.006);
      |                           ^
a.cc:14:11: error: 'temp' was not declared in this scope; did you mean 'tm'?
   14 |     sort (temp.begin(), temp.end());
      |           ^~~~
      |           tm
a.cc:14:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   14 |     sort (temp.begin(), temp.end());
      |     ^~~~
      |     short
Language: C++

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

int main(){
    int n,t,a,min = 2147483647,result;
    cin>>n;
    int h[n],b[n];
    cin>>t>>a;
    for(int i = 0;i < n; i++){
        cin>>h[i];
    }
    for(int i = 0;i < n;i++){
     b[i] =abs(a- (t- h[i] * 0.006));
     cout<<b[i]<<endl;
    }
    int ans = b[0];
    result = 0+1;
    for(int i = 0;i < n; i++){
        if(b[i] < ans){
            ans = b[i];
            result = i+;
        }
    }
    cout<<result;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected primary-expression before ';' token
   24 |             result = i+;
      |                        ^
Language: C++

#include<bits/stdc++.h>
#include<vector>
#include<map>
#define int long long
using namespace std;
main()
{
	//freopen("input.txt","rt",stdin);
	int n,t,a;
	cin>>n>>t>>a;
	int arr[n];
	for(int i=0;i<n;i++)
	{
		int p;
		cin>>p;
		p = t-(p*0.006);
		//cout<<p<<endl;
		arr[i] = p;
	}
	int mi;
	int in ;
	mi = abs(arr[i]-a);
	for(int i=1;i<n;i++)
	{
		int s = abs(arr[i]-a);
		if(mi > s)
		{
			mi = s;
			in =i+1;
		}
	}
	cout<<in<<endl;
}

Compiler output:
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main()
      | ^~~~
a.cc: In function 'int main()':
a.cc:22:22: error: 'i' was not declared in this scope; did you mean 'in'?
   22 |         mi = abs(arr[i]-a);
      |                      ^
      |                      in
Language: C

#include<stdio.h>
int main() {
	int N, T, A,i;
	scanf("%d %d %d", &N, &T, &A);
	int H[N],kionn[N] ;
	double x[N] , y[N];
	for (i = 0;i < N;++i) {
		scanf("%d", &H[i]);
		x[i] = T - H[i] * 0.006;
		if (x[i]>=A) {
			y[i]= x[i] - A;
		}
		else {
			y [i]= A - x[i];
		}
	}
	for (i = 0;i < N - 1;++i) {
		if (y[i + 1] < y[i]) {
			kionn = i + 1;
		}
	}
	printf("%d\n", kionn);
	return 0;
}


Compiler output:
main.c: In function 'main':
main.c:19:31: error: assignment to expression with array type
   19 |                         kionn = i + 1;
      |                               ^
Language: C++

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

int main(){
	long n,t,a,i,j;
	double k,b;
	cin >>n;
	cin >>t >>a;
	long h[n];
	b=114514.0;
	for(i=0;i<n;i++){
		k=abs((double(a-t)+0.006*(double)(h[i]));
		if(k<b){
			b=k;
			j=i;
		}
	}
	cout<<j;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:57: error: expected ')' before ';' token
   13 |                 k=abs((double(a-t)+0.006*(double)(h[i]));
      |                      ~                                  ^
      |                                                         )
Language: C++

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

int main(){
	long n,t,a,i,j;
	double k,b;
	cin >>n;
	cin >>t >>a;
	long h[n];
	b=114514.0;
	for(i=0;i<n;i++){
		k=abs((double(a-t)+0.006*(double)(h[i]));
		if(k<b){
			b=k;
			j=i;
		}
	}
	cout<<i;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:57: error: expected ')' before ';' token
   13 |                 k=abs((double(a-t)+0.006*(double)(h[i]));
      |                      ~                                  ^
      |                                                         )
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){
   int N,T,A;
   cin >> N;
   cin >> T >> A;
   int H[N];
   for(int i=0; i<N; i++){
      cin >> H[i];
   }
   double T_i[N];
   for(int i=0; i<N; i++){
      T_i[i] = T - H[i] * 0.006;
   }
   double min_delta_T = INT_MAX;
   int min_idx = 0;
   for(int i=0; i<N; i++){
      for(int j=0; j<N; j++)
      {
         if(fabs(T_i[i]-T) < fabs(T_i[j]-T)){
            min_delta_T = fabs(T_i[i]-T);
            min_idx = i;
         }
      }
   }
   std::cout << min_idx+1 <<std::endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'INT_MAX' was not declared in this scope
   19 |    double min_delta_T = INT_MAX;
      |                         ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <cmath>
  +++ |+#include <climits>
    4 |
Language: Java

import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        int place;
        double tSurf, tA;
        Scanner sc = new Scanner(System.in);
        place = sc.nextInt();
        tSurf = sc.nextDouble();
        tA = sc.nextDouble();
        double[] ts = new double[place];
        
        int result = 1;
        double min;
        for(int i = 0; i < place; i++){
            ts[i] = tSurf - sc.nextInt() * 0.006;
            if(i == 0) {
                min = Math.abs(tA - ts[0]);
                continue;
            }
            if(Math.abs(tA - ts[i]) < min){
                min = Math.abs(tA - ts[i]);
                result = i + 1;
            }
        }
        System.out.println(result);
    }
}

Compiler output:
Main.java:21: error: variable min might not have been initialized
            if(Math.abs(tA - ts[i]) < min){
                                      ^
1 error
Language: C++

#include <iostream>
#include <stdlib.h>
using namespace std;
int main() {
	int n, t, a, ans = -1;
	double min = -1;
	cin >> n >> t >> a;
	t -= a;
	int h[1000];
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		if (fabs(h[i] * 0.006 - (double)t) < min || ans == -1) {
			min = fabs(h[i] * 0.006 - (double)t);
			ans = i;
		}
	}
	cout << ans + 1;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   12 |                 if (fabs(h[i] * 0.006 - (double)t) < min || ans == -1) {
      |                     ^~~~
      |                     labs
Language: C++

#include <iostream>
#include <math.h>
using namespace std;
//Compiler version g++ 6.3.0

int main()
{
	int N;
	int ans = 0;
	 t, a;
	cin >> N >> t >> a;
	float y = 999999;
	for (int i = 0; i < N; i++) {
		float z = 0;
		cin >> z;
		z = a - t + z * 0.006;
		if (fabs(z) <= fabs(y)) {
			ans = i + 1;
		}
		y = z;
	}
	cout << ans << endl;
}

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

#include <iosteram>
#include <vector>
#include <cmath>
using namespace std;

int main(){
  int N;
  int T;
  int A;
  cin >>N;
  cin >>T>>A;
  int min=10e9+7;
  int height;
  int temp;
  int index=-1;
  for(int i=0;i<N;i++){
    cin <<height <<endl;
    tmp=abs(T-height*0.006-A);
    if(tmp <min){
      intdex=i;
      min=tmp;
    }
  }
  cout <<index<<endl;
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: iosteram: No such file or directory
    1 | #include <iosteram>
      |          ^~~~~~~~~~
compilation terminated.