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

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

int main()
{
  int n, t, a, minavr = 100;
  map<double, int> avr;
  cin >> n >> t >> a;
  for(int i=0; i<n; i++)
  {
    int h;
    cin >> h;
    double tmp = abs(t - h * 0.006 - a);
    avr[tmp] = i+1;
    minavr = min(minavr, tmp);
  }
  
  cout << avr[minavr] << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:17: error: no matching function for call to 'min(int&, double&)'
   16 |     minavr = min(minavr, tmp);
      |              ~~~^~~~~~~~~~~~~
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:16:17: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'double')
   16 |     minavr = min(minavr, tmp);
      |              ~~~^~~~~~~~~~~~~
/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
Language: Java

//package reedeka;
import java.util.*;
import java.io.*;
import java.math.*;

public class Palace {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n, t, a;
		n = sc.nextInt();
		t = sc.nextInt();
		a = sc.nextInt();
		int i;
		double tmp, temp, s;
		int index = 1;
		int h;
		h = sc.nextInt();
		temp = t - 0.006*h;
		tmp = Math.abs(a - temp);
		for(i=2; i<=n; i++) {
			h = sc.nextInt();
			temp = t - 0.006*h;
			s = Math.abs(a-temp);
			if(s<tmp) {
				tmp = s;
				index = i;
			}
		}
		System.out.println(index);
	}
}


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

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

int	main()
{
  int	n, t, a, h, i, index = -1, diff;
  
  cin >> n >> t >> a;
  cin >> h;
  diff = abs((t - h * 0.006) - a);
  index = 1
  for (i = 1; i < n; i++)
  {
    cin >> h;
    if (abs((t - h * 0.006) - a) < diff)
    {
      diff = abs((t - h * 0.006) - a);
      index = i + 1;
    }
  }
  cout << index << endl;
  return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: expected ';' before 'for'
   11 |   index = 1
      |            ^
      |            ;
   12 |   for (i = 1; i < n; i++)
      |   ~~~       
a.cc:12:25: error: expected ';' before ')' token
   12 |   for (i = 1; i < n; i++)
      |                         ^
      |                         ;
Language: C

#include <algorithm>
#include <cmath>
#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];

    double min_diff = 999999;
    int min_idx = -1;
    for (int i = 0; i < N; ++i) {
        int h = H[i];
        double t = T - h * 0.006;
        if (min_diff > (abs(double(A) - double(t)))) {
            min_diff = abs(double(A) - double(t));
            min_idx = i;
        }
    }
    cout << min_idx + 1 << endl;
    return 0;
}

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

#include<iostream>
using namespace std;

int main(){
  int n, t, a, h;
  cin >> n >> t >> a;
  double sum = 0;
  int ans = 0;
  for(int i = 0;i < n;i++){
    cin >> h[i];
    sum[i] = t - h[i] * 0.006;
    if(a - sum[ans] > 0&& a - sum[i] > 0){
      if(a - sum[ans] > a -sum[i]){
        ans = i;
      }
    }
    else if(a - sum[ans] < 0){
      
      
  }
  

Compiler output:
a.cc: In function 'int main()':
a.cc:10:13: error: invalid types 'int[int]' for array subscript
   10 |     cin >> h[i];
      |             ^
a.cc:11:8: error: invalid types 'double[int]' for array subscript
   11 |     sum[i] = t - h[i] * 0.006;
      |        ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
   11 |     sum[i] = t - h[i] * 0.006;
      |                   ^
a.cc:12:15: error: invalid types 'double[int]' for array subscript
   12 |     if(a - sum[ans] > 0&& a - sum[i] > 0){
      |               ^
a.cc:12:34: error: invalid types 'double[int]' for array subscript
   12 |     if(a - sum[ans] > 0&& a - sum[i] > 0){
      |                                  ^
a.cc:13:17: error: invalid types 'double[int]' for array subscript
   13 |       if(a - sum[ans] > a -sum[i]){
      |                 ^
a.cc:13:31: error: invalid types 'double[int]' for array subscript
   13 |       if(a - sum[ans] > a -sum[i]){
      |                               ^
a.cc:17:20: error: invalid types 'double[int]' for array subscript
   17 |     else if(a - sum[ans] < 0){
      |                    ^
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:9:27: note: to match this '{'
    9 |   for(int i = 0;i < n;i++){
      |                           ^
a.cc:20:4: error: expected '}' at end of input
   20 |   }
      |    ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++


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



int main() {
    int N, index, judge=0, count=0;
    double T, A
    long double min=LLONG_MAX, value;
    
    cin >> N >> T >> A;
    
    rep(i,N) {
      cin >> value;
      if(abs(A-(T-value*0.006))<min) {
        min = abs(A-(T-value*0.006));
        index = i+1;
      }
    }
    
    cout << index << endl;
    
      
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:5: error: expected initializer before 'long'
   13 |     long double min=LLONG_MAX, value;
      |     ^~~~
a.cc:15:22: error: 'A' was not declared in this scope
   15 |     cin >> N >> T >> A;
      |                      ^
a.cc:18:14: error: 'value' was not declared in this scope
   18 |       cin >> value;
      |              ^~~~~
Language: C++

#include  <bits/stdc++.h>
using namespace std;
int main()
{
	long long double i,z,n,t,a,s=0;	
	cin>>n>>t>>a;
	long long double b[n],h[n];
	
	for(i=0;i<n;i++)
	{
		cin>>h[i];
		b[i]=t-(h[i]*0.006);
		
	}
	z=abs(b[0]-a);
	for(i=0;i<n;i++)
	{
		long long int x;
		x=abs(b[i]-a);
		if(x<z && x!=0)
		{
			z=x;
			s=i;
			
		}
	}
	cout<<s+1<<endl;
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: 'long long' specified with 'double'
    5 |         long long double i,z,n,t,a,s=0;
      |              ^~~~
a.cc:5:14: error: 'long long' specified with 'double'
a.cc:5:14: error: 'long long' specified with 'double'
a.cc:5:14: error: 'long long' specified with 'double'
a.cc:5:14: error: 'long long' specified with 'double'
a.cc:5:14: error: 'long long' specified with 'double'
a.cc:7:14: error: 'long long' specified with 'double'
    7 |         long long double b[n],h[n];
      |              ^~~~
a.cc:7:28: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |         long long double b[n],h[n];
      |                            ^
a.cc:7:28: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |         long long double b[n],h[n];
      |                            ^
      |                            |
      |                            double
a.cc:7:28: error: size of array 'b' has non-integral type 'double'
a.cc:7:14: error: 'long long' specified with 'double'
    7 |         long long double b[n],h[n];
      |              ^~~~
a.cc:7:33: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |         long long double b[n],h[n];
      |                                 ^
a.cc:7:33: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |         long long double b[n],h[n];
      |                                 ^
      |                                 |
      |                                 double
a.cc:7:33: error: size of array 'h' has non-integral type 'double'
a.cc:11:23: error: invalid types 'double [1][double]' for array subscript
   11 |                 cin>>h[i];
      |                       ^
a.cc:12:18: error: invalid types 'double [1][double]' for array subscript
   12 |                 b[i]=t-(h[i]*0.006);
      |                  ^
a.cc:12:26: error: invalid types 'double [1][double]' for array subscript
   12 |                 b[i]=t-(h[i]*0.006);
      |                          ^
a.cc:19:24: error: invalid types 'double [1][double]' for array subscript
   19 |                 x=abs(b[i]-a);
      |                        ^
Language: C++

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tl3;



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;



int main() {
	int n, t, a;
	cin >> n >> t >> a;
	vector<int> h(n);
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}

	t *= 1000;
	int id = 0;
	for (int i = 0; i < n; i++) {
		if (abs(t - 6 * h[i] - a) < abs(t - 6 * h[id] - a)) {
			id = i;
		}
	}

	cout << i + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:17: error: 'i' was not declared in this scope; did you mean 'id'?
   46 |         cout << i + 1 << endl;
      |                 ^
      |                 id
Language: C++

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

int main(){
int N,T,A,X;
  scanf("%d%d%d",&N,&T,&A);
    
    int c= 1000000;
  int res,d;
    for(int i=1;i<=N,i++){
    scanf("%d",&X);
      d=T*1000-6*X-1000*A;
      if(d<0)d=-d;
      if(c>d)c=d,res=i;
    }
  printf("%d\n",res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: expected ';' before ')' token
   10 |     for(int i=1;i<=N,i++){
      |                         ^
      |                         ;
Language: C++

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

int main(){
int N,T,A,X;
  scanf("%d%d%d",&N,&T,&A);
    
    int c= 1000000;
  int res,d;
    for(int i=1;i<N,i++){
    scanf("%d",&X);
      d=T*1000-6*X-1000*A;
      if(d<0)d=-d;
      if(c>d)c=d,res=i;
    }
  printf("%d\n",res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: expected ';' before ')' token
   10 |     for(int i=1;i<N,i++){
      |                        ^
      |                        ;
Language: C++

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

int main(){
int N,T,A,X;
  scanf("%d%d%d",&N,&T,&A);
    
    int c= 1000000;
  int res,d;
    for(int i=1;i<N){
    scanf("%d",&X);
      d=T*1000-6*X-1000*A;
      if(d<0)d=-d;
      if(c>d)c=d,res=i;
    }
  printf("%d\n" ,res);
}

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

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

int main(){
int N,T,A,X;
  scanf("%d%d%d",&N,&T,&A);
    
    int c= 1000000;
  int res,d;
    for(int i=1;i<N){
    scanf("%d",&X);
      d=T*1000-6*X-1000*A;
      if(d<0)d=-d;
      if(c>d)c=d,res=i;
    }
  printf("%d\n",res);
}

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

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

int main(){
int N,T,A,X;
  scanf("%d%d%d",&N,&T,&A)
    
    int c= 1000000;
  int res,d;
    for(int i=1;i<N){
    scanf("%d",&X)
      d=T*1000-6*X-1000*A;
      if(d<0)d=-d;
      if(c>d)c=d,res=i;
    }
  printf("%d\n",res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: expected ';' before 'int'
    6 |   scanf("%d%d%d",&N,&T,&A)
      |                           ^
      |                           ;
    7 | 
    8 |     int c= 1000000;
      |     ~~~                    
a.cc:10:20: error: expected ';' before ')' token
   10 |     for(int i=1;i<N){
      |                    ^
      |                    ;
a.cc:11:19: error: expected ';' before 'd'
   11 |     scanf("%d",&X)
      |                   ^
      |                   ;
   12 |       d=T*1000-6*X-1000*A;
      |       ~            
a.cc:14:10: error: 'c' was not declared in this scope
   14 |       if(c>d)c=d,res=i;
      |          ^
Language: C++

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

int main(){
int N,T,A,X;
  scanf("%d%d%d",&N,&T,&A)
    
    int c= 1000000;
  int res=0;
    for(int i=1;i<N){
    scanf("%d",&X)
      d=T*1000-6*X-1000*A;
      if(d<0)d=-d;
      if(c>d)c=d,res=i;
    }
  printf("%d\n",res);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:27: error: expected ';' before 'int'
    6 |   scanf("%d%d%d",&N,&T,&A)
      |                           ^
      |                           ;
    7 | 
    8 |     int c= 1000000;
      |     ~~~                    
a.cc:10:20: error: expected ';' before ')' token
   10 |     for(int i=1;i<N){
      |                    ^
      |                    ;
a.cc:11:19: error: expected ';' before 'd'
   11 |     scanf("%d",&X)
      |                   ^
      |                   ;
   12 |       d=T*1000-6*X-1000*A;
      |       ~            
a.cc:13:10: error: 'd' was not declared in this scope
   13 |       if(d<0)d=-d;
      |          ^
a.cc:14:10: error: 'c' was not declared in this scope
   14 |       if(c>d)c=d,res=i;
      |          ^
a.cc:14:12: error: 'd' was not declared in this scope
   14 |       if(c>d)c=d,res=i;
      |            ^
Language: C++

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

int main(){
  int N,T,A;
  cin >> N >> T >> A;
  
  vector<int> H(N);
  double min = 10000;
  int target = 0
  
  for(int i=0; i<N; i++){
    cin >> H.at(i);
    
    double temp = T - 0.006 * H.at(i);
    double dif = abs(A-temp);
    if(min > dif){
      min = dif;
      target = i + 1;
    }
  }
  
  cout << target << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: expected ',' or ';' before 'for'
   12 |   for(int i=0; i<N; i++){
      |   ^~~
a.cc:12:16: error: 'i' was not declared in this scope
   12 |   for(int i=0; i<N; i++){
      |                ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
const ll M=1000000007;
//------------------------------------------//

int main(){
    int N;cin>>N;
    int T,A;cin>>T>>A;
    int H[N];
    int Ti[N];
    double cnt=M;
    int ans=0;
    rep(i,N){
        cin>>H[i];
        Ti[i]=double(T-0.006*H[i]);
        cnt=min(abs(cnt-A),abs(Ti[i]-A));
        if(cnt==abs(Ti[i]-A)) ans=i;
    }
    cout<<ans<<endl;
}
    
    


Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: no matching function for call to 'min(double, int)'
   18 |         cnt=min(abs(cnt-A),abs(Ti[i]-A));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:16: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   18 |         cnt=min(abs(cnt-A),abs(Ti[i]-A));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/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:
/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:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   18 |         cnt=min(abs(cnt-A),abs(Ti[i]-A));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N, T, A;
  	cin >> N >> T >> A;
  	int s[N];
  	int l =1e 5, ret;
  	for(int i = 0; i < N; i++){
    	cin >> s[i];
      	s[i] =fabs((T * 1000 - s[i] * 6) - A * 1000);
      	if(l > s[i]){
        l = s[i];
        ret = i;
        }
    }
  	cout << ret + 1 << endl;
  	return 0;
}

Compiler output:
a.cc:8:16: error: exponent has no digits
    8 |         int l =1e 5, ret;
      |                ^~
a.cc: In function 'int main()':
a.cc:14:9: error: 'ret' was not declared in this scope
   14 |         ret = i;
      |         ^~~
a.cc:17:17: error: 'ret' was not declared in this scope
   17 |         cout << ret + 1 << endl;
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int N, T, A;
  	cin >> N >> T >> A;
  	int s[N];
  	int l =1 * e5, ret;
  	for(int i = 0; i < N; i++){
    	cin >> s[i];
      	s[i] =fabs((T * 1000 - s[i] * 6) - A * 1000);
      	if(l > s[i]){
        l = s[i];
        ret = i + 1;
        }
    }
  	cout << ret << endl;
  	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: 'e5' was not declared in this scope
    8 |         int l =1 * e5, ret;
      |                    ^~
a.cc:14:9: error: 'ret' was not declared in this scope
   14 |         ret = i + 1;
      |         ^~~
a.cc:17:17: error: 'ret' was not declared in this scope
   17 |         cout << ret << endl;
      |                 ^~~
Language: C++

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


#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define pb push_back
#define F first
#define S second
#define int long long int
#define ll long long
#define ld long double

bool isPrime(ll n){if(n<2)return false;for(ll i=2;i*i<=n;++i){if(n%i==0){return false;}}return true;}

ll lcm(ll x,ll y){
    return (x*y)/(__gcd(x,y));
}

ll nod(ll n){
    while(n%10==0){
        n/=10;
    }
    return n;
}


signed main(){
    fast_IO;
    int t=1;
    //cin>>t;
    while(t--){
        int n,x,a;
        cin>>n>>x>>a;
        vector<int> a(n);
        int p=0;
        ld max=10e5,ans=0;
        for(int i=0;i<n;i++){
            cin>>a[i];
            if(max>(a-x+a[i]*0.006)){
                max=a-x+a[i]*0.006;
                ans=i+1;
            }
        }
        cout<<ans<<endl;
        
    }
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:35:21: error: conflicting declaration 'std::vector<long long int> a'
   35 |         vector<int> a(n);
      |                     ^
a.cc:33:17: note: previous declaration as 'long long int a'
   33 |         int n,x,a;
      |                 ^
a.cc:39:19: error: invalid types 'long long int[long long int]' for array subscript
   39 |             cin>>a[i];
      |                   ^
a.cc:40:26: error: invalid types 'long long int[long long int]' for array subscript
   40 |             if(max>(a-x+a[i]*0.006)){
      |                          ^
a.cc:41:26: error: invalid types 'long long int[long long int]' for array subscript
   41 |                 max=a-x+a[i]*0.006;
      |                          ^
Language: C++

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

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

  vector<int> v(n);
  rep(i,n) cin >> v[i];

  double dt;
  int idx = 0;
  double min = INT_MAX;
  rep(i,n){
    dt = abs(a - (t - (v[i] * 0.006));
    cout << (t - v[i] * 0.006) << endl;
    if (min > dt){
      min = dt;
      idx = i;
    }
  }

  cout << idx + 1 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:38: error: expected ')' before ';' token
   20 |     dt = abs(a - (t - (v[i] * 0.006));
      |             ~                        ^
      |                                      )
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define all(v) (v).begin(),(v).end()

int main(){
  	int N, T, A;
  	cin >> N >> T >> A;
  	double H_id = (T - A) / 0.006;
    vector<double> H_i(N);
  	for (int i = 0; i < N; i++){
      	cin >> H_i[i];
      	H_i[i] = abs(H_i[i]-H_id);
    }
  	vector<double>::iterator iter = max_element(all(H_i));
  	cout << distance(H_i.begin(), iter) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:41: error: 'max_element' was not declared in this scope
   16 |         vector<double>::iterator iter = max_element(all(H_i));
      |                                         ^~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
#define all(v) (v).begin(),(v).end()

int main(){
  	int N, T, A;
  	cin >> N >> T >> A;
  	double H_id = (T - A) / 0.006
    vector<double> H_i(N);
  	for (int i = 0; i < N; i++){
      	cin >> H_i[i];
      	H_i[i] = abs(H_i[i]-H_id);
    }
  	vector<double>::iterator iter = max_element(all(H_i));
  	cout << distance(H_i.begin(), iter) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: expected ',' or ';' before 'vector'
   11 |     vector<double> H_i(N);
      |     ^~~~~~
a.cc:13:16: error: 'H_i' was not declared in this scope; did you mean 'H_id'?
   13 |         cin >> H_i[i];
      |                ^~~
      |                H_id
a.cc:16:57: error: 'H_i' was not declared in this scope; did you mean 'H_id'?
   16 |         vector<double>::iterator iter = max_element(all(H_i));
      |                                                         ^~~
a.cc:5:17: note: in definition of macro 'all'
    5 | #define all(v) (v).begin(),(v).end()
      |                 ^
a.cc:16:41: error: 'max_element' was not declared in this scope
   16 |         vector<double>::iterator iter = max_element(all(H_i));
      |                                         ^~~~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(int i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define wi(t) int t;cin>>t;while(t--)
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}
int mpow(int base, int exp); 
void ipgraph(int n, int m);
void dfs(int u, int par);

const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

void solve()
    {
   ll int z,x,y;
   cin>>x>>y>>z;
   vl ar(x);
   fo(i,x) cin>>ar[i];
   double diff=(double) INF;
   ll int ans=-1;
   for(int i=0;i<x;i++)
   {  
      double  k=x-ar[i]*0.006;
       if(abs(k-z)<diff)
       {
           diff=abs(k-z);
           ans=i;
       }
      
   }
   cout<<ans+1<<endl;
   
  
  
  
    }

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

   // wi(t)
    {
      solve();
    }

    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
    u--, v--;
		g[u].pb(v);
		g[v].pb(u);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}







Compiler output:
a.cc: In function 'void solve()':
a.cc:55:25: error: 'INF' was not declared in this scope
   55 |    double diff=(double) INF;
      |                         ^~~
Language: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int T = sc.nextInt();
		int A = sc.nextInt();
		int[] H = new int[N];
		int a = 10000000;
		int b = 0;
		for(int i=0; i<N; i++) {
			H[i] = sc.nextInt();
		}
		sc.close();
		for(int i=0; i<N; i++) {
			int x = T -H[i]*6/1000;
			if(Math.abs(A-x)<a) {
				a = Math.abs(A-x);
				b = i+1;
			}
		}
		System.out.println(b);
	}

}

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

#include<iostream>
#include<string>
#include<stdio.h>
#include <algorithm>
#include <set>
#include<math.h>
#include<vector>

using namespace std;

int main(){
    double n,t,a;cin >> n >> t >> a;
    double h[1010]={};
    for(int i = 0;i < n;i++)cin >> h[i] ;
    double m = 100000;
    int id = 0;
    for(int i = 0;i < n;i++){
        double tmp = t-(h[i]*0.006);
        //cout << tmp << endl;
        double d = tmp-a;
        id(d < 0)d = -d;
        if(m >d){
            m = a-tmp;
            id = i+1;
        }
    }
    cout << id << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:11: error: 'id' cannot be used as a function
   21 |         id(d < 0)d = -d;
      |         ~~^~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
int main(){
  int n,t,a;
  int x,ans,temp,min=10000;
  scanf("%d",&n);
  scanf("%d",&t,&a);
  x = (t-a)*1000/6;
  int H;
  for(int i =0;i<n;i++){
    scanf("%d",&H);
    temp = abs(H-x);
    if(temp<minv){
      minv = temp;
      ans = i;
    }
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:13: error: 'minv' undeclared (first use in this function); did you mean 'min'?
   13 |     if(temp<minv){
      |             ^~~~
      |             min
main.c:13:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#include<stdilb.h>
int main(){
  int n,t,a;
  int x,ans,temp,min=10000;
  scanf("%d",&n);
  scanf("%d",&t,&a);
  x = (t-a)*1000/6;
  int H;
  for(int i =0;i<n;i++){
    scanf("%d",&H);
    temp = abs(H-x);
    if(temp<minv){
      minv = temp;
      ans = i;
    }
  }
  printf("%d",ans);
  return 0;
}

Compiler output:
main.c:2:9: fatal error: stdilb.h: No such file or directory
    2 | #include<stdilb.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int n, t, a, h;

    cin >> n;
    cin >> t >> a;
    int  ans = 0
    double min;
    for(int i = 0; i < n; i++){
        cin >> h;
        double tmp = t - h*0.006;
        if(i == 0){
            ans = 0;
            min = abs(tmp-a);
        }else{
            if(min > abs(tmp-a)){
                min = abs(tmp-a);
                ans = i;
            }
        }
    }

    cout << (ans+1) << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: expected ',' or ';' before 'double'
   12 |     double min;
      |     ^~~~~~
a.cc:18:28: error: overloaded function with no contextual type information
   18 |             min = abs(tmp-a);
      |                            ^
a.cc:20:20: error: invalid operands of types '<unresolved overloaded function type>' and 'double' to binary 'operator>'
   20 |             if(min > abs(tmp-a)){
      |                ~~~~^~~~~~~~~~~~
a.cc:21:32: error: overloaded function with no contextual type information
   21 |                 min = abs(tmp-a);
      |                                ^
Language: C

#include<stdio.h>
#include<stdilb.h>
int main(){
  int n,t,a;
  int s[10000];
  int minI,minv=10000;
  scanf("%d",&n);
  scanf("%d",&t,&a);
  for(int i =0;i<n;i++){
    scanf("%d",&s[i]);
    if(abs(t-s[i]*0.006-a)<minv){
      minv = abs(t-s[i]*0.006-a);
      minI = i;
    }
  }
  printf("%d",minI);
  return 0;
}

Compiler output:
main.c:2:9: fatal error: stdilb.h: No such file or directory
    2 | #include<stdilb.h>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
#define all(i) i.begin(),i.end()
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  ll N,T,A;
  cin>>N>>T>>A;
  ll H[N];
  long double h=500*(T-A)/3;
  long double ABS=INF;
  ll ans;
  rep(i,N){
    cin>>H[i];
    if(ABS>abs(h-H[i]){
      ABS=abs(h-H[i]);
      ans=i+1;
    }
  }
  cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:23: error: expected ')' before '{' token
   28 |     if(ABS>abs(h-H[i]){
      |       ~               ^
      |                       )
a.cc:32:3: error: expected primary-expression before '}' token
   32 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define pi 3.14159265359
#define all(i) i.begin(),i.end()
using namespace std;
const long long INF=1e9+7;
const string alp="abcdefghijklmnopqrstuvwxyz"; //26
const string ALP="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=998244353LL;
//const ll MOD=1777777777LL;


int main() {
  long double N,T,A;
  cin>>N>>T>>A;
  long double H[N];
  long double tem[N];
  ll ABS=INF;
  ll ans;
  rep(i,N){
    cin>>H[i];
    H[i]/=1000;
    H[i]*=6;
    tem[i]=T-H[i];
    if(ABS>abs(A-tem[i])){
      ABS=abs(A-tem[i]);
      ans=i+1;
    }
  }
  cout<<ans<<endl;
}


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

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  vector<double> d(a),e(a);
  rep(i,a)
    cin>>d[i];
  rep(i,a){
    e[i]=b-0.006*d[i];
  }
  int f=1e9,w;
  rep(i,a){
    if(f>abs(e[i]-c)){
    f=abs(e[i]-c);
      w=i+1;
    }
    
      }
  cout<<w<<endl;
}
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  vector<double> d(a),e(a);
  rep(i,a)
    cin>>d[i];
  rep(i,a){
    e[i]=b-0.006*d[i];
  }
  int f=1e9,w;
  rep(i,a){
    if(f>abs(e[i]-c)){
    f=abs(e[i]-c);
      w=i+1;
    }
    
      }
  cout<<w<<endl;
}


Compiler output:
a.cc:47:31: error: redefinition of 'template<class T> bool chmax(T&, T)'
   47 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:13:31: note: 'template<class T> bool chmax(T&, T)' previously declared here
   13 | template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:48:31: error: redefinition of 'template<class T> bool chmin(T&, T)'
   48 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:14:31: note: 'template<class T> bool chmin(T&, T)' previously declared here
   14 | template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
      |                               ^~~~~
a.cc:50:8: error: redefinition of 'int main()'
   50 | signed main(){
      |        ^~~~
a.cc:16:8: note: 'int main()' previously defined here
   16 | signed main(){
      |        ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  int t,a;
  int tmp=1000;
  cin>>t>>a;
  vector<double>at(n);
  rep(i,n){
    int h;
    cin>>h;
    at[i]=(double)(t-0.006*h);
    tmp=min(tmp,at[i]-a);
  }
  rep(i,n){
    if(at[i]-a==tmp){
      cout<<i+1<<endl;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type)'
   29 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:29:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   29 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
/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:
/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:29:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  int t,a;
  int tmp=1000;
  cin>>t>>a;
  vector<double>at(n);
  rep(i,n){
    int h;
    cin>>h;
    at[i]=t-0.006*h;
    tmp=min(tmp,at[i]-a);
  }
  rep(i,n){
    if(at[i]-a==tmp){
      cout<<i+1<<endl;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type)'
   29 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:29:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   29 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
/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:
/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:29:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
int main()	{
  int n;
  cin>>n;
  int t,a;
  int tmp=1000;
  cin>>t>>a;
  vector<double>at(n);
  rep(i,n){
    int h;
    cin>>h;
    at[i]=t-0.006*h;
    tmp=min(tmp,at[i]-(double)a);
  }
  rep(i,n){
    if(at[i]-a==tmp){
      cout<<i+1<<endl;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:12: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type)'
   29 |     tmp=min(tmp,at[i]-(double)a);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:29:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   29 |     tmp=min(tmp,at[i]-(double)a);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~
/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:
/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:29:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   29 |     tmp=min(tmp,at[i]-(double)a);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char> cvec;
typedef vector<double> dvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
#define fs first
#define sc second
const int inf=1000;
int main()	{
  int n;
  cin>>n;
  int t,a;
  int tmp=inf;
  cin>>t>>a;
  vector<double>at(n);
  rep(i,n){
    int h;
    cin>>h;
    at[i]=t-0.006*h;
    tmp=min(tmp,at[i]-(double)a);
  }
  rep(i,n){
    if(at[i]-a==tmp){
      cout<<i+1<<endl;
      return 0;
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type)'
   30 |     tmp=min(tmp,at[i]-(double)a);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 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:30:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   30 |     tmp=min(tmp,at[i]-(double)a);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~
/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:
/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:30:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |     tmp=min(tmp,at[i]-(double)a);
      |         ~~~^~~~~~~~~~~~~~~~~~~~~