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

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

double cala(int t,int x){
 return t-x*0.006
}

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

  int max = 0 ;
  int ans = 0;
  for(int i=0;i<n;i++){
    cin >> h;
    if(calc(t,h)>max){
      max = calc(t,h);
      ans = i ;
    }
  }
   cout << ans << "\n" ;

  return 0;
}


Compiler output:
a.cc: In function 'double cala(int, int)':
a.cc:7:18: error: expected ';' before '}' token
    7 |  return t-x*0.006
      |                  ^
      |                  ;
    8 | }
      | ~                 
a.cc: In function 'int main()':
a.cc:20:8: error: 'calc' was not declared in this scope; did you mean 'cala'?
   20 |     if(calc(t,h)>max){
      |        ^~~~
      |        cala
Language: C++

//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
const int INF= 1e9+5;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>>vvi;

int main(){
  int n,t,a;
  cin>>n>>t>>a;
  vi h(n);
  for(int i=0;i<n;i++)cin>>h[i];
  int MIN=INF;
  int ans;
  for(int i=0;i<n;i++){
    int k=t-0.006*h[i];
    if(ads(MIN-a)>ads(k-a)){
      ans=i+1;
      MIN=k;
    }
  }
  cout<<ans<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:20:8: error: 'ads' was not declared in this scope; did you mean 'ans'?
   20 |     if(ads(MIN-a)>ads(k-a)){
      |        ^~~
      |        ans
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,T,A,h,D,X=0;cin>>N>>T>>A>>h;
  D=abs(1000*(T-A)-6*h);
  for(int i=1;i<N;i++){
    cin>>h;
    if(D>abs(1000*(T-A)-6*h)){
      X=i;D=abs(1000*(T-A)-6*h)
    }
  }
  cout<<X<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:32: error: expected ';' before '}' token
    9 |       X=i;D=abs(1000*(T-A)-6*h)
      |                                ^
      |                                ;
   10 |     }
      |     ~
Language: C++

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

int main() {
  int N, T, A;
  cin >> N >> T >> A;
  vector<int> H(N);
  for (int i = 0; i < N; i++) cin >> H.at(i);
  
  int min = 10000;
  for (int i = 0; i < N; i++) {
    int t = T - 0.006*H.at(i);
    int x;
    int number;
    if (t < T) x = T - t;
    else x = t - T;
    if (x < min) {
      min = x;
      number = i;
    }
  }
  cout << number << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:11: error: 'number' was not declared in this scope
   22 |   cout << number << endl;
      |           ^~~~~~
Language: C++

#include<iostream>
using namespace std ;

int main()
{
  int N,A,T ;
  cin>>N>>A>>T ;
  vector<int>H(N) ;
  int min=1e9 ;
  int ans ;
  for(int i=0;i<N;i++){
    int h ;
    cin>>h ;
    H.at(i)=T-h*0.006 ;
    int x=(A>H.at(i):A-H.at(i):H.at(i)-A) ;
    if(x<min){
      min=x ;
      ans=i+1 ;
    }
  }
  cout<<ans<<endl ;
  
  return 0 ;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int>H(N) ;
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std ;
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int>H(N) ;
      |          ^~~
a.cc:14:5: error: 'H' was not declared in this scope
   14 |     H.at(i)=T-h*0.006 ;
      |     ^
a.cc:15:21: error: expected ')' before ':' token
   15 |     int x=(A>H.at(i):A-H.at(i):H.at(i)-A) ;
      |           ~         ^
      |                     )
Language: C++

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

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

#include<bits/stdc++.h>
using namespace std;
int main(){
   int n,t,b,w=1,s=9999999;
   int h,a;
   cin>>n>>t>>b;
   for(int i=1;i<=n;i++)
   {
   	  cin>>h;
   	  a=abs(1000*t-6*h[i]-b*1000);
     if(a<s)s=a,w=i;
   }
   cout<<w;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:27: error: invalid types 'int[int]' for array subscript
   10 |           a=abs(1000*t-6*h[i]-b*1000);
      |                           ^
Language: C++

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

int main() {
    double n;
    cin >> n;
    double t,a;
    cin >> t >> a;
    vector<doubel> h(n);
    vector<double> ans(n);
    int count;
    int com=100;
    for(int i=0;i<n;i++){
        cin >> h.at(i);
        ans.at(i) = t-h.at(i)*0.006-a;
        if(com > abs(ans.at(i))){
            com = abs(ans.at(i));
            count = i;
        }
    }
    cout << count+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 'doubel' was not declared in this scope; did you mean 'double'?
    9 |     vector<doubel> h(n);
      |            ^~~~~~
      |            double
a.cc:9:18: error: template argument 1 is invalid
    9 |     vector<doubel> h(n);
      |                  ^
a.cc:9:18: error: template argument 2 is invalid
a.cc:14:18: error: request for member 'at' in 'h', which is of non-class type 'int'
   14 |         cin >> h.at(i);
      |                  ^~
a.cc:15:25: error: request for member 'at' in 'h', which is of non-class type 'int'
   15 |         ans.at(i) = t-h.at(i)*0.006-a;
      |                         ^~
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: conflicting declaration 'unsigned int d'
    7 |     unsigned int d = 4294967294;
      |                  ^
a.cc:6:15: note: previous declaration as 'int d'
    6 |     int N,T,A,d,ans;
      |               ^
Language: C++

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

int main(){
  int N, T, A;
  int min;
  int number;
  cin >> N >> T >> A;
  vector(int) vec(N);
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
    vec.at(i) = T - vec.at(i)*0.006 - A;
  }
  min = abs(vec.at(0));
  for(int i = 0; i < N; i++){
    if(min > abs(vec.at(i))){
      number = i + 1;
    }
  }cout << i << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: missing template arguments before '(' token
   10 |   vector(int) vec(N);
      |         ^
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector(int) vec(N);
      |          ^~~
a.cc:12:12: error: 'vec' was not declared in this scope
   12 |     cin >> vec.at(i);
      |            ^~~
a.cc:15:13: error: 'vec' was not declared in this scope
   15 |   min = abs(vec.at(0));
      |             ^~~
a.cc:20:12: error: 'i' was not declared in this scope
   20 |   }cout << i << endl;
      |            ^
Language: C++

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

int main(){
  int N, T, A;
  int min;
  int number;
  cin >> N >> T >> A;
  vector(int) vec(N);
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
    vec.at(i) = T - vec.at(i)*0.006 - A;
  }
  min = abs(vec.at(0));
  for(int i = 0; i < N; i++){
    if(min > abs(vec.at(i))){
      number = i + 1;
    }
  }cout << i << endl;
}


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

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

int main(){
  int N, T, A;
  int min;
  int number;
  cin >> N >> T >> A;
  vector(int) vec(N);
  for(int i = 0; i < N; i++){
    cin >> vec.at(i);
    vec.at(i) = T - vec.at(i)*0.006 - A;
  }
  min = abs(vec.at(0));
  for(int i = 0; i < N; i++){
    if(min > abs(vec.at(i))){
      number = i + 1;
    }
  }cout << i << endl;
}

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

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();  //候補地点の数
    int T = sc.nextInt();  //基礎気温 ある地点の気温はT-H[]*0.006
    int A = sc.nextInt();  //理想とする気温
    int[] H = new int[N];  //候補地点ごとの高度
    int number = 0; //理想の候補地点の番号
    int x = 1000; //理想の差の絶対値
    for(int i = 0; i < N; i++)
      H[i] = sc.nextint();
    
    for(int i = 0; i < N; i++){
      int xi = A - (T - H[i] * 0.006);
        if(xi < 0) xi = -xi;
      if(xi < x){ x = xi; number = i;}     
    }
    System.out.println(number);
  }  
}

Compiler output:
Main.java:12: error: cannot find symbol
      H[i] = sc.nextint();
               ^
  symbol:   method nextint()
  location: variable sc of type Scanner
Main.java:15: error: incompatible types: possible lossy conversion from double to int
      int xi = A - (T - H[i] * 0.006);
                 ^
2 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();  //候補地点の数
    int T = sc.nextInt();  //基礎気温 ある地点の気温はT-H[]*0.006
    int A = sc.nextInt();  //理想とする気温
    int[] H = new Int[N];  //候補地点ごとの高度
    int number = 0; //理想の候補地点の番号
    int x = 1000; //理想の差の絶対値
    for(int i = 0; i < N; i++)
      H[i] = sc.nextint();
    
    for(int i = 0; i < N; i++){
      int xi = A - (T - H[i] * 0.006);
        if(xi < 0) xi = -xi;
      if(xi < x){ x = xi; number = i;}     
    }
    System.out.println(number);
  }  
}

Compiler output:
Main.java:8: error: cannot find symbol
    int[] H = new Int[N];  //?????????
                  ^
  symbol:   class Int
  location: class Main
Main.java:12: error: cannot find symbol
      H[i] = sc.nextint();
               ^
  symbol:   method nextint()
  location: variable sc of type Scanner
Main.java:15: error: incompatible types: possible lossy conversion from double to int
      int xi = A - (T - H[i] * 0.006);
                 ^
3 errors
Language: Java

import java.util.Scanner;
public class Main{
  public static void main(String[] args){
	Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();  //候補地点の数
    int T = sc.nextInt();  //基礎気温 ある地点の気温はT-H[]*0.006
    int A = sc.nextInt();  //理想とする気温
    int[] H = new Int[N];  //候補地点ごとの高度
    int number = 0; //理想の候補地点の番号
    int x = 1000; //理想の差の絶対値
    for(int i = 0; i < N; i++)
      H[i] = sc.nextint();
    
    for(int i = 0; i < N; i++){
      int xi = A - (T - H[i] * 0.006)
        if(xi < 0) xi = -xi;
      if(xi < x){ x = xi; number = i;}     
    }
    System.out.println(number);
  }  
}




Compiler output:
Main.java:15: error: ';' expected
      int xi = A - (T - H[i] * 0.006)
                                     ^
1 error
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

const int N = 1010;

int n, t, a;
double res = 0x3f3f3f3f
int idx;

int main()
{
    cin >> n >> t >> a;
    for(int i = 1; i <= n; i++)
    {
        double h;
        cin >> h;
        if(abs(a - (t - 0.006 * h)) < res)
        {
            res = abs(a - (t - 0.006 * h));
            idx = i;
        }
    }

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


Compiler output:
a.cc:11:1: error: expected ',' or ';' before 'int'
   11 | int idx;
      | ^~~
a.cc: In function 'int main()':
a.cc:23:13: error: 'idx' was not declared in this scope
   23 |             idx = i;
      |             ^~~
a.cc:27:13: error: 'idx' was not declared in this scope
   27 |     cout << idx << endl;
      |             ^~~
Language: C++

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

int main() {
  double n, t, a;
  cin>>n>>t>>a;
  double h[n];
  cin>>h[0];
  double temp=t-h[0]*0.006-a;
  if (temp<0){
    temp=-temp;
  }
  int c=1;
  for(int i=1; i<n; i++){
    cin>>h[i];
    double b=t-h[i]*0.006-a;
    if(b<0){
      b=-b;
    }
    if(b<temp){
      temp=b;
      c=i+1;
    }
  }
  cout<<c<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    7 |   double h[n];
      |            ^
a.cc:7:12: error: could not convert 'n' from 'double' to 'long unsigned int'
    7 |   double h[n];
      |            ^
      |            |
      |            double
a.cc:7:12: error: size of array 'h' has non-integral type 'double'
Language: C++

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

int main(){
    int n,t,a,ans,b,hhhh,c,g;
    cin >> n >> t >>a;
    cin >> b;
        ans = t - (b*0.006);
    for(int i = 0;i < n;i++){
        cin >> c;
        hhhh = t -(c*0.006);
        if(abs(ans) >= abs(hhhh)){
            g =1;
        }
        else{
            g = i +2
        }
    }
    cout << g << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:21: error: expected ';' before '}' token
   19 |             g = i +2
      |                     ^
      |                     ;
   20 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,T,A,H;
  cin >> N >> T >> A;
  double h = (T - A) / 0.006;
  int c = 1;
  cin >> H
  int Hc = H; 
  for (int i = 2; i <= N; i++){
    cin >> H;
    if (abs(H - h) < abs(Hc - h)){
      Hc = H;
      c = i;
    }
  }
  cout << c;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected ';' before 'int'
    8 |   cin >> H
      |           ^
      |           ;
    9 |   int Hc = H;
      |   ~~~      
a.cc:12:26: error: 'Hc' was not declared in this scope; did you mean 'c'?
   12 |     if (abs(H - h) < abs(Hc - h)){
      |                          ^~
      |                          c
Language: C++

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


Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main(void){
      | ^~~~
a.cc: In function 'int main()':
a.cc:9:16: error: no matching function for call to 'min(int, double)'
    9 |         ans=min(1000000000,a-(t-ar[i]*.006));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:9:16: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'double')
    9 |         ans=min(1000000000,a-(t-ar[i]*.006));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:9:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
    9 |         ans=min(1000000000,a-(t-ar[i]*.006));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

using namespace std;

int main(){
    int n;
    cin >> n;
    int t;
  	int 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:17:18: error: request for member 'at' in 'i', which is of non-class type 'int'
   17 |         cin >> i.at(i);
      |                  ^~
Language: C++

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

using namespace std;

int main(){
    int n;
    cin >> n;
    int t;
  	int 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:16:18: error: request for member 'at' in 'i', which is of non-class type 'int'
   16 |         cin >> i.at(i);
      |                  ^~
a.cc:17:22: error: 'T' was not declared in this scope
   17 |         temp.at(i) = T - (H.at(i) * 0.006);
      |                      ^
a.cc:17:27: error: 'H' was not declared in this scope
   17 |         temp.at(i) = T - (H.at(i) * 0.006);
      |                           ^
Language: C++

#include <bits/stdc++.h>
#include <cmatn>
using namespace std;
int main(void){
    
    int N;
    int T, A;
    int ans;
    int ave_Ans = INT_MAX;
    int H[1000] = {};
    cin >> N;
    cin >> T >> A;
    for(int i = 0; i < N; i++){
        cin >> H[i];
    }
    for(int i = 0; i < N; i++){
        int sa =fabs( A - (T - H[i] * 0.006) );
        if(ave_Ans > sa){
            ave_Ans = sa;
            ans = i+1;
        }
        
    }
    
    cout << ans << endl;
    
}




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

using namespace std;
int main(void){
    
    int N;
    int T, A;
    int ans;
    int ave_Ans = INT_MAX;
    int H[1000] = {};
    cin >> N;
    cin >> T >> A;
    for(int i = 0; i < N; i++){
        cin >> H[i];
    }
    for(int i = 0; i < N; i++){
        int sa =fabs( A - (T - H[i] * 0.006) );
        if(ave_Ans > sa){
            ave_Ans = sa;
            ans = i+1;
        }
        
    }
    
    cout << ans << endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: 'INT_MAX' was not declared in this scope
    7 |     int ave_Ans = INT_MAX;
      |                   ^~~~~~~
a.cc:1:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
  +++ |+#include <climits>
    1 | using namespace std;
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin >> N;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:15:17: error: 'fabs' was not declared in this scope
   15 |         int sa =fabs( A - (T - H[i] * 0.006) );
      |                 ^~~~
a.cc:23:5: error: 'cout' was not declared in this scope
   23 |     cout << ans << endl;
      |     ^~~~
a.cc:23:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:23:20: error: 'endl' was not declared in this scope
   23 |     cout << ans << endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int n,t,x,h,sa,baka=INT_MAX,ans=0;
    cin>>n>>t>>a;
    for(int i=0; i<n; i++){
        cin>>h;
        sa=a-(t-x)*0.006;
        if(baka>sa){
            baka=sa;
            ans=i+1;
        }
    }
    ]cout<<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:16: error: 'a' was not declared in this scope; did you mean 'sa'?
    6 |     cin>>n>>t>>a;
      |                ^
      |                sa
a.cc:15:5: error: expected primary-expression before ']' token
   15 |     ]cout<<ans<<endl;
      |     ^
Language: C++

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

int main() {

  int n,t,a,m=INF,ans=0;
  cin>>n>>t>>a;
  vector<int> A(n);
  for(int i=0;i<n i++){
    int tmp;
    cin>>A[i];
    A[i]=t-0.006*A[i];
    tmp = max(A[i],a)-min(A[i],a); 
    if(m>tmp){m=tmp;ans=i;}
  }
  cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before 'i'
   10 |   for(int i=0;i<n i++){
      |                  ^~
      |                  ;
Language: C++

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

int main() {

  int n,t,a,min=INF,ans=0;
  cin>>n>>t>>a;
  vector<int> A(n);
  for(int i=0;i<n i++){
    int tmp;
    cin>>A[i];
    A[i]=t-0.006*A[i];
    tmp = max(A[i],a)-min(A[i],a); 
    if(min>tmp){min=tmp;ans=i;}
  }
  cout<<ans<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:18: error: expected ';' before 'i'
   10 |   for(int i=0;i<n i++){
      |                  ^~
      |                  ;
a.cc:14:26: error: 'min' cannot be used as a function
   14 |     tmp = max(A[i],a)-min(A[i],a);
      |                       ~~~^~~~~~~~
Language: C++

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

int main() {
  long long N,T,A;
  cin >> N >> T >> A;
  long long ans = 0;
  long long mini = 100000000000;
  for (long long i = 0; i < N; i++) {
    long long H;
    cin >> H;
    long long diff;
    diff = T*1000 - H*6 - 1000*A;
    if (diff < 0) diff = -diff
    if (mini > diff) {
      mini = diff;
      ans = i+1;
    }
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:31: error: expected ';' before 'if'
   14 |     if (diff < 0) diff = -diff
      |                               ^
      |                               ;
   15 |     if (mini > diff) {
      |     ~~
Language: C++

#include<stdio.h>

int main (){
    int n;
    int t, a;
    scanf("%d%d%d", &n,&t,&a);
    int h[n];
    for(int i = 0; i < n;i++) scanf("%d", &h[i]);
    double T[n];
    for(int i = 0; i < n; i++){
        T[i] = t - h[i] * 0.006;
        if(T[i] > a)  T[i] = T[i] - a;
        else T[i] = a -T[i];
    }
    double min_t = 10000;
    int k;
    for( i = 0; i < n; i++ ){
        if(min_t > T[i]) {
            min_t = T[i];
            k = i;
        }
    }
    printf("%d", k);
    return 0;

}

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

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

int main() {
	int N, T, A;
	cin >> N >> T >> A;
	int H[N];
	for (int i=0;i<N;i++) {
		cin >> H[i];
	}

	int min = 2000000000;
	int min_index = -1;
	for (int i=0;i<N;i++) {
		if (abs((double)T-(double)0.006*H[i]-A)<min) {
			min_index = i;
			min = abs((double)T-0.006*H[i]-A);
		}
	}
	cout << min_index+1 << endl;
}a

Compiler output:
a.cc:21:2: error: 'a' does not name a type
   21 | }a
      |  ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: expected primary-expression before '<' token
    7 | int cc =1 < <30;
      |             ^
a.cc:15:9: warning: unknown escape sequence: '\040'
   15 | printf ("% d \ n " , res );
      |         ^~~~~~~~~~
Language: C++

rep(i,n) for(int i=0; i<n; i++)
using namespace std;
typedef long long ll;

int main(){
  int n;  cin >> n;
  double t, a; cin >> t >> a;
  vector<int> h(n);  rep(i,n) cin >> h[i];
  int ans = 0;
  double res = abs(a-(t-h[0]*0.006));
  rep(i,n){
    if(res > abs(a-(t-h[i]*0.006))){
      ans = i;
      res = abs(a-(t-h[i]*0.006));
    }
  }
  cout << ans+1;
  return 0;
}

Compiler output:
a.cc:1:4: error: expected constructor, destructor, or type conversion before '(' token
    1 | rep(i,n) for(int i=0; i<n; i++)
      |    ^
a.cc:1:23: error: 'i' does not name a type
    1 | rep(i,n) for(int i=0; i<n; i++)
      |                       ^
a.cc:1:28: error: 'i' does not name a type
    1 | rep(i,n) for(int i=0; i<n; i++)
      |                            ^
a.cc: In function 'int main()':
a.cc:6:11: error: 'cin' was not declared in this scope
    6 |   int n;  cin >> n;
      |           ^~~
a.cc:8:3: error: 'vector' was not declared in this scope
    8 |   vector<int> h(n);  rep(i,n) cin >> h[i];
      |   ^~~~~~
a.cc:8:10: error: expected primary-expression before 'int'
    8 |   vector<int> h(n);  rep(i,n) cin >> h[i];
      |          ^~~
a.cc:8:26: error: 'i' was not declared in this scope
    8 |   vector<int> h(n);  rep(i,n) cin >> h[i];
      |                          ^
a.cc:8:22: error: 'rep' was not declared in this scope
    8 |   vector<int> h(n);  rep(i,n) cin >> h[i];
      |                      ^~~
a.cc:10:25: error: 'h' was not declared in this scope
   10 |   double res = abs(a-(t-h[0]*0.006));
      |                         ^
a.cc:10:16: error: 'abs' was not declared in this scope; did you mean 'ans'?
   10 |   double res = abs(a-(t-h[0]*0.006));
      |                ^~~
      |                ans
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << ans+1;
      |   ^~~~
Language: C++

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

int main() {
  int N
  double T,An;
  cin >> N >> T >>An;
  vector<double> A(N);
  vector<double> B(N);
  for(int i = 0; i < N; i++){
  cin >> A.at(i);
  B.at(i) = An + A.at(i) * 0.006 + T;
  B.at(i) = abs(B.at(i));
  }
  int ans = 1;
  int ave = B.at(0);
  for(int i = 0; i < N; i++){
  if(B.at(i) <= ave){
  ave = B.at(i);
  ans = i+1;
  }
  }
  cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'double'
    6 |   double T,An;
      |   ^~~~~~
a.cc:7:10: error: 'N' was not declared in this scope
    7 |   cin >> N >> T >>An;
      |          ^
a.cc:7:15: error: 'T' was not declared in this scope
    7 |   cin >> N >> T >>An;
      |               ^
a.cc:7:19: error: 'An' was not declared in this scope; did you mean 'yn'?
    7 |   cin >> N >> T >>An;
      |                   ^~
      |                   yn
Language: C++

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

int main() {
  int N,T,An;
  cin >> N >> T >>An;
  vector<double> A(N);
  vector<double> B(N);
  for(int i = 0; i < N; i++){
  cin >> A.at(i);
  B.at(i) = An - A.at(i) * 0.006;
  B.at(i) = abs(B.at(i));
  }
  int ans = 1;
  int ave = B.at(i);
  for(int i = 0; i < N; i++){
  if(B.at(i) <= ave){
  ave = B.at(i);
  ans = i;
  }
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:18: error: 'i' was not declared in this scope
   15 |   int ave = B.at(i);
      |                  ^
Language: C++

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

int main() {
  int N,T,A;
  cin >> N >> T >>A;
  vector<double> A(N);
  vector<double> B(N);
  for(int i = 0; i < N; i++){
  cin >> A.at(i);
  B.at(i) = A - A.at(i) * 0.006;
  B.at(i) = abs(B.at(i));
  }
  int ans = 1;
  int ave = B.at(i);
  for(int i = 0; i < N; i++){
  if(B.at(i) <= ave){
  ave = B.at(i);
  ans = i;
  }
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: conflicting declaration 'std::vector<double> A'
    7 |   vector<double> A(N);
      |                  ^
a.cc:5:11: note: previous declaration as 'int A'
    5 |   int N,T,A;
      |           ^
a.cc:10:12: error: request for member 'at' in 'A', which is of non-class type 'int'
   10 |   cin >> A.at(i);
      |            ^~
a.cc:11:19: error: request for member 'at' in 'A', which is of non-class type 'int'
   11 |   B.at(i) = A - A.at(i) * 0.006;
      |                   ^~
a.cc:15:18: error: 'i' was not declared in this scope
   15 |   int ave = B.at(i);
      |                  ^
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int T = sc.nextInt();
        int A = sc.nextInt();
        int[] H = new int [N];
        for (int i = ０; i < N; ++i) {
            H[i] = sc.nextInt();
        }

        double[] dif = new double [N];
        int ans = 0;
        for (int i = 0; i < N; ++i) {
            dif[i] = Math.abs(T - H[i] * 0.006 - A);
            if(i > 0 && dif[i] < dif[i - 1]) {
                ans = i;
            }
        }

        System.out.println(ans);
	}
}


Compiler output:
Main.java:10: error: illegal non-ASCII digit
        for (int i = ?; i < N; ++i) {
                     ^
1 error
Language: C++

#include <iostream>
using namespace std;
int main(){
int n,t,a;cin>>n>>t>>a;
  vector<int> v(n);
  for(int i=0;i<n;i++)cin>>v[i];
  int m=t-0.006*v[0],ans=0;
  for(int i=1;i<n;i++){
  int temp=t-0.006*v[i];
   if(abs(temp-a)<abs(m-a)){
   m=temp;ans=i;
   }
  }
  cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'vector' was not declared in this scope
    5 |   vector<int> v(n);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:5:10: error: expected primary-expression before 'int'
    5 |   vector<int> v(n);
      |          ^~~
a.cc:6:28: error: 'v' was not declared in this scope
    6 |   for(int i=0;i<n;i++)cin>>v[i];
      |                            ^
a.cc:7:17: error: 'v' was not declared in this scope
    7 |   int m=t-0.006*v[0],ans=0;
      |                 ^
a.cc:11:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |    m=temp;ans=i;
      |           ^~~
      |           abs
a.cc:14:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |   cout<<ans;
      |         ^~~
      |         abs
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
int main() {
  int N,T,A;
  cin >>N >>T >>A;
  int n=1;
  vector<int> H(N);
  for int i=0;i<N;i++){
    cin >>H.at(i);
  }
  vector<double> tem(N);
  for(int i=0;i<N;i++){
    tem[i]=T-H[i]*0.006;
  }
  int M=tem[0];
  for(int i=1;i<N;i++){
    if(M > tem[i] && tem[i] > A){
      M = tem[i];
      n = i+1;
    }else if(A < tem[i] && tem[i] < M){
      M = tem[i];
      n=i+1;
    }else{
    }
  }
  cout << n;
}

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

#include <bits/stdc++.h>
using namespace std;
  
int main() {
  int N,T,A,n;
  cin >>N >>T >>A >>H;
  double tem = T-H*0.006;
  n=1;
  for(int i=2;i<N+1;i++){
    cin >>H;
    if(tem > T-H*0.006 && T-H*0.006 > A){
      tem=T-H*0.006;
      n=i;
      continue;
    }else if(A < T-H*0.006 < T-H*0.006 < tem){
      tem=T-H*0.006;
      n=i;
      continue;
    }else{
    }
  }
  cout << n; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: 'H' was not declared in this scope
    6 |   cin >>N >>T >>A >>H;
      |                     ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
  
int main() {
  int N,T,A,H,n:
  cin >>N >>T >>A >>H;
  double tem = T-H*0.006;
  n=-1;
  for(int i=0;i<(N-1);i++){
    cin >>H;
    if(tem > T-H*0.006 && T-H*0.006 > A){
      n=i;
    }else if(A < T-H*0.006 < T-H*0.006 < tem){
      n=i;
    }else{
    }
  }
  
  cout << n+2;
  
   
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: found ':' in nested-name-specifier, expected '::'
    5 |   int N,T,A,H,n:
      |                ^
      |                ::
a.cc:5:15: error: 'n' has not been declared
    5 |   int N,T,A,H,n:
      |               ^
a.cc:6:7: error: qualified-id in declaration before '>>' token
    6 |   cin >>N >>T >>A >>H;
      |       ^~
a.cc:8:3: error: 'n' was not declared in this scope
    8 |   n=-1;
      |   ^
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int T = sc.nextInt();
   int A = sc.nextInt();
   int[] Hi = new int[N];
   for(int i =0;i<N;i++) Hi[i] = sc.nextInt();
   
   int ans =0;
   double min = (double)(T-A);
   double di ;
   for(int i =0;i<N;i++) 
   {
     di = T-(double)Hi*0.006-A;
     if(min > Math.abs(di)) 
     {
       ans = i+1;
       min = Math.abs(di);
     }
   }
   System.out.println(ans);
 }
}

Compiler output:
Main.java:16: error: incompatible types: int[] cannot be converted to double
     di = T-(double)Hi*0.006-A;
                    ^
1 error
Language: Java

import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int T = sc.nextInt();
   int A = sc.nextInt();
   int[] Hi = new int[N];
   for(int i =0;i<N;i++) Hi[i] = sc.nextInt();
   
   int ans =0;
   double min = (double)(T-A);
   double di ;
   for(int i =0;i<N;i++) 
   {
     di = T-Hi*0.006-A;
     if(min > Math.abs(di)) 
     {
       ans = i+1;
       min = Math.abs(di);
     }
   }
   System.out.println(ans);
 }
}

Compiler output:
Main.java:16: error: bad operand types for binary operator '*'
     di = T-Hi*0.006-A;
              ^
  first type:  int[]
  second type: double
1 error
Language: C++

    #include<iostream>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<algorithm>
    #include<string>
    using namespace std;
    #define INF = 100000000;
     
    int main() {
        int N,T,A,memo1 = INF,memo2;
        cin >> N >> T >> A;
        vector<int> H(N);
        vector<int> copy(N);

        for(int i=0;i<N;i++)cin >> H[i];
        for(int i=0;i<N;i++){
            H[i] = T-H[i]*0.006;
            if(H[i]<0)H[i] *=-1;
            if(memo1 > H[i]){
                memo1 = H[i];
                memo2 = i+1;

            }
        }
        
        cout << H[0] <<endl;
        
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: expected primary-expression before '=' token
    7 |     #define INF = 100000000;
      |                 ^
a.cc:10:27: note: in expansion of macro 'INF'
   10 |         int N,T,A,memo1 = INF,memo2;
      |                           ^~~
a.cc:10:30: error: expected primary-expression before ',' token
   10 |         int N,T,A,memo1 = INF,memo2;
      |                              ^
a.cc:10:31: error: 'memo2' was not declared in this scope; did you mean 'memo1'?
   10 |         int N,T,A,memo1 = INF,memo2;
      |                               ^~~~~
      |                               memo1
Language: C++

///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n,t,a; cin>>n>>t>>a;
  int minv=1e9;
  int idx=0;
  for(int i=0;i<n;i++){
    int h;
    cin>>h;
    if(abs(t-h*0.006-a)<minv){
      minv=abs(t-h*0.006-a)
      idx=i;
    }
  }
  cout<<idx<<endl;
  return 0;
}


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

///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n,t,a; cin>>n>>t>>a;
  int minv=1e9;
  int idx=0;
  for(int i=0;i<n;i++){
    int h;
    cin>>h;
    if(abs(t-h*0.006-a)<minv){
      minv=abd(t-h*0.006-a)
      idx=i;
    }
  }
  cout<<idx<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:12: error: 'abd' was not declared in this scope; did you mean 'abs'?
   13 |       minv=abd(t-h*0.006-a)
      |            ^~~
      |            abs
Language: C++

///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  int n,t,a; cin>>n>>t>>a;
  int minv=1e9;
  int idx=0;
  for(int i=0;i<n;i++){
    int h;
    cin>>h;
    if(abd(t-h*0.006-a)<minv){
      minv=abd(t-h*0.006-a)
      idx=i;
    }
  }
  cout<<idx<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:8: error: 'abd' was not declared in this scope; did you mean 'abs'?
   12 |     if(abd(t-h*0.006-a)<minv){
      |        ^~~
      |        abs
Language: C++

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

int main()
{
 int n,t,a;
  cin>>n>>t>>a;
  vector<int> v(n);
  for(int &i:v) cin>>i;
  int 
  for(int i=0;i<n;i++)
  {
    float x = t - (0.006*1.0*v[i]);
    if(abs(x-(float)a)>d)
    {
      d = abs(x-(float)a);
      ans = i;
    }   
  }
  cout<<ans<<"\n";
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected unqualified-id before 'for'
   11 |   for(int i=0;i<n;i++)
      |   ^~~
a.cc:11:15: error: 'i' was not declared in this scope
   11 |   for(int i=0;i<n;i++)
      |               ^
a.cc:20:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   cout<<ans<<"\n";
      |         ^~~
      |         abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int a,b,d=0,e=100000000;
  int c;
  int f=0;
  cin>>a>>b;
  for(int i=0;i<a;i++){
    cin>>c;
    if(e>abs(c-b)){
      e=abs(c-b);
      d=i+1;
    }
cout<<d<<"\n";
    }

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

#include<bits/stdc++.h>
using namespace std;
signed main(){
  int a,b,d=0,e=100000000;
  int c;
  int d=0;
  cin>>a>>b;
  for(int i=0;i<a;i++){
    cin>>c;
    d=a-(c*0.006);
    if(e>d){
      e=d;
      d=i+1;
    }
  }
  cout<<d<<"\n";
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:6:7: error: redeclaration of 'int d'
    6 |   int d=0;
      |       ^
a.cc:4:11: note: 'int d' previously declared here
    4 |   int a,b,d=0,e=100000000;
      |           ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: invalid operands of types '<unresolved overloaded function type>' and 'float' to binary 'operator>'
   14 |     if(min>abs(a-T)){
      |        ~~~^~~~~~~~~
a.cc:15:18: error: overloaded function with no contextual type information
   15 |       min=abs(a-T);
      |                  ^
Language: C++

#include<iostream>
#include<cmath>

int main() {
  int N;
  int T;
  int A;
  std::cin >> N >> T >> A;
  out_t;
  out_n;
  for (int i=0; i<N; i++) {
    int temp_t;
    std::cin >> temp_t;
    temp_t = T-0.006*temp_t;
    if (i==0) {
      out_t = std::abs(A - temp_t);
      out_n = i;
    }
    else {
      if (out_t > std::abs(A-temp_t)) {
        out_t = std::abs(A-temp_t);
        out_n = i;
      }
    }
  }
  std::cout << out_n << std::endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'out_t' was not declared in this scope
    9 |   out_t;
      |   ^~~~~
a.cc:10:3: error: 'out_n' was not declared in this scope
   10 |   out_n;
      |   ^~~~~
Language: C++

#include<iostream>
#include<cmath>

 int main() {
   int N;
   int T;
   int A;
   std::cin >> N >> T >> A;
   out_t;
   out_n;
   for (int i=0; i<N; i++) {
     int temp_t;
     std::cin >> temp_t;
     temp_t = T-0.006*temp_t;
     if (i==0) {
       out_t = std::abs(A - temp_t);
       out_n = i;
     }
     else {
       if (out_t > std::abs(A-temp_t)) {
         out_t = std::abs(A-temp_t);
         out_n = i;
       }
     }
   }
   std::cout << out_n << std::endl;
 }

Compiler output:
a.cc: In function 'int main()':
a.cc:9:4: error: 'out_t' was not declared in this scope
    9 |    out_t;
      |    ^~~~~
a.cc:10:4: error: 'out_n' was not declared in this scope
   10 |    out_n;
      |    ^~~~~
Language: C++

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

int main(){
  int n,t,a;
  cin>>n;
  cin>>t>>a;
  int h[n];
  for(i=0;i<n;i++)cin>>h[i];
  int mi=0;
  for(i=0;i<n;i++){
    if(abs(a+h[i]*0.006-t)<abs(a+h[mi]*0.006-t)){
      mi=i;
    }
  }
  cout<<mi+1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:7: error: 'i' was not declared in this scope
    9 |   for(i=0;i<n;i++)cin>>h[i];
      |       ^
a.cc:11:7: error: 'i' was not declared in this scope; did you mean 'mi'?
   11 |   for(i=0;i<n;i++){
      |       ^
      |       mi
Language: C++

#include <algorithm>
#include <iostream>
#include <string>
using namespace std;
double abs_Double(double x){
	if(x>=0) return x
      else return -x
}
int main(void) {
	int N,T,A,position;
	cin >> N >> T >> A;
  	double H[N+20],min=100.0;
	for(int i=0;i<N;++i){
		cin >> H[i];
      	if(min > abs_Double(A-(T-0.006*H[i])) ){
        	min = 	abs_Double(A-(T-0.006*H[i])) ;
          position = i;
        }
	}
  cout << position;
return 0;
}


Compiler output:
a.cc: In function 'double abs_Double(double)':
a.cc:6:26: error: expected ';' before 'else'
    6 |         if(x>=0) return x
      |                          ^
      |                          ;
    7 |       else return -x
      |       ~~~~                
a.cc:7:21: error: expected ';' before '}' token
    7 |       else return -x
      |                     ^
      |                     ;
    8 | }
      | ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main (){
  int N, T, A;
  cin >> N ;
  cin >> T >> A;
  
  vector<int> vec(N);
  vector<int> B(N);
  vector<int> B(N);
  for(int i = 0; i < N ; i ++){
    cin >> vec[i];
  }
  
  for(int i = 0; i < N; i ++){
    B[i] = T *1000 - vec[i] *6 -A* 1000;
    C[i] = T *1000 - vec[i] *6 -A* 1000;
  }
  
  sort(B.begin(), B.end());
  reverse(B.begin(), B.end());
  
  int maxi;
  for(int i = 0; i < N-1; i ++){
    if(C[i] == B[0]){
      cout <<  i <<endl;
      break;
    }
  }
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:15: error: redeclaration of 'std::vector<int> B'
   10 |   vector<int> B(N);
      |               ^
a.cc:9:15: note: 'std::vector<int> B' previously declared here
    9 |   vector<int> B(N);
      |               ^
a.cc:17:5: error: 'C' was not declared in this scope
   17 |     C[i] = T *1000 - vec[i] *6 -A* 1000;
      |     ^
a.cc:25:8: error: 'C' was not declared in this scope
   25 |     if(C[i] == B[0]){
      |        ^
Language: C++

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

int main(){
  int n;
  cin >> n;
  double t,a;
  cin >> t >> a;
  int place;
  double tmin=999999;
  double h;
  rep(i,n){
    cin >> h;
    if(tmin>abs((t-h*0.006)-a)){
      tmin = abs((t-h*0.006)-a);
      place = i;
    }
  }
  cout << i+1 << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:11: error: 'i' was not declared in this scope
   20 |   cout << i+1 << endl;
      |           ^
Language: C++

clude <bits/stdc++.h>
using namespace std;
#define rep(i,n) for( int i = 0 ; i < n ; i++ )
typedef long long ll ;
int main() {

  int N , T , A ;
  cin >> N >> T >> A ;
  int ans = 10000000 ;
  int count = 1000000 ;
  vector<int> B(N) ;
  rep(i,N) cin >> B.at(i) ;
  rep(i,N){
    if( abs( (double) A-T+B.at(i)*0.006) < abs( A-ans ) ){
      ans = T-B.at(i)*0.006 ;
      count = i ;
    }
  }
  //cout << ans << endl;
  cout << count+1 << endl;
}

Compiler output:
a.cc:1:1: error: 'clude' does not name a type
    1 | clude <bits/stdc++.h>
      | ^~~~~
a.cc: In function 'int main()':
a.cc:8:3: error: 'cin' was not declared in this scope
    8 |   cin >> N >> T >> A ;
      |   ^~~
a.cc:11:3: error: 'vector' was not declared in this scope
   11 |   vector<int> B(N) ;
      |   ^~~~~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   vector<int> B(N) ;
      |          ^~~
a.cc:12:19: error: 'B' was not declared in this scope
   12 |   rep(i,N) cin >> B.at(i) ;
      |                   ^
a.cc:14:27: error: 'B' was not declared in this scope
   14 |     if( abs( (double) A-T+B.at(i)*0.006) < abs( A-ans ) ){
      |                           ^
a.cc:14:9: error: 'abs' was not declared in this scope; did you mean 'ans'?
   14 |     if( abs( (double) A-T+B.at(i)*0.006) < abs( A-ans ) ){
      |         ^~~
      |         ans
a.cc:20:3: error: 'cout' was not declared in this scope; did you mean 'count'?
   20 |   cout << count+1 << endl;
      |   ^~~~
      |   count
a.cc:20:22: error: 'endl' was not declared in this scope
   20 |   cout << count+1 << endl;
      |                      ^~~~
Language: C++

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


int main() {

    int n;
    double t, a;
    cin >> n >> t >> a;
    vector<int> H(n);
    int res;
    int ans = 10000;
    rep(i,n) {
        int h; cin >> h;
        res = t - h * 0.006;
        H[i] = res;
        ans = min(abs(res-a), ans);
    }
    int id;
    rep(i,n) {
        if (H[i] == ans+a || H[i] == a-ans) id = i;
    }
    cout << id + 1 << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:18: error: no matching function for call to 'min(double, int&)'
   19 |         ans = min(abs(res-a), ans);
      |               ~~~^~~~~~~~~~~~~~~~~
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:19:18: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   19 |         ans = min(abs(res-a), ans);
      |               ~~~^~~~~~~~~~~~~~~~~
/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:19:18: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   19 |         ans = min(abs(res-a), ans);
      |               ~~~^~~~~~~~~~~~~~~~~