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

#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include <stdio.h>
#include <set>
#include <vector>
using namespace std;


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

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'INF' was not declared in this scope
   14 |     min = INF;
      |           ^~~
a.cc:19:33: error: 'x' was not declared in this scope
   19 |         if(min>abs((double)h[i]-x*0.006-a)){
      |                                 ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
using namespace std;
int main(){
  int n, t, a, i, ans;
  double kari=100000.0;
  cin >> n >> t >> a;
  int h[n];
  for(i=0; i<n; i++){
    cin >> h[i];
    if(fabs((t-a)*1.0-h[i]*0.006)<kari){
      kari=fabs(t-a-h[i]*0.006);
	       ans=i+1;}
    }
    cout << ans;
    
  
    
  return 0;
}

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

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
using namespace std;
int main(){
  int n, t, a, i;
  double kari=100000.0;
  cin >> n >> t >> a;
  int h[n];
  for(i=0; i<n; i++){
    cin >> h[i];
    if(fabs((t-a)*1.0-h[i]*0.006)<kari){
      kari=fabs(t-a-h[i]*0.006);
	       ans=i+1;}
    }
    cout << ans;
    
  
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   13 |     if(fabs((t-a)*1.0-h[i]*0.006)<kari){
      |        ^~~~
      |        labs
a.cc:15:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                ans=i+1;}
      |                ^~~
      |                abs
a.cc:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
//#include <algorithm>
//#include <cstring>
//#include <cstdlib>
using namespace std;
int main(){
  int n, t, a, i;
  double kari=100000.0;
  cin >> n >> t >> a;
  int h[n];
  for(i=0; i<n; i++){
    cin >> h[i];
    if(abs((t-a)*1.0-h[i]*0.006)<kari){
      kari=abs(t-a-h[i]*0.006;
	       ans=i+1;}
    }
    cout << ans;
    
  
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ')' before ';' token
   14 |       kari=abs(t-a-h[i]*0.006;
      |               ~              ^
      |                              )
a.cc:15:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                ans=i+1;}
      |                ^~~
      |                abs
a.cc:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <algorithm>
//#include <cstring>
//#include <cstdlib>
using namespace std;
int main(){
  int n, t, a, i;
  double kari=100000.0;
  cin >> n >> t >> a;
  int h[n];
  for(i=0; i<n; i++){
    cin >> h[i];
    if(abs((t-a)*1.0-h[i]*0.006)<kari){
      kari=abs(t-a-h[i]*0.006;
	       ans=i+1;}
    }
    cout << ans;
    
  
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ')' before ';' token
   14 |       kari=abs(t-a-h[i]*0.006;
      |               ~              ^
      |                              )
a.cc:15:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                ans=i+1;}
      |                ^~~
      |                abs
a.cc:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
using namespace std;
int main(){
  int n, t, a, i;
  double kari=100000.0;
  cin >> n >> t >> a;
  int h[n];
  for(i=0; i<n; i++){
    cin >> h[i];
    if(abs((t-a)*1.0-h[i]*0.006)<kari){
      kari=abs(t-a-h[i]*0.006;
	       ans=i+1;}
    }
    cout << ans;
    
  
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ')' before ';' token
   14 |       kari=abs(t-a-h[i]*0.006;
      |               ~              ^
      |                              )
a.cc:15:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                ans=i+1;}
      |                ^~~
      |                abs
a.cc:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
using namespace std;
int main(){
  int n, t, a, i;
  double kari=100000.0;
  cin >> n >> t >> a;
  int h[n];
  for(i=0; i<n; i++){
    cin >> h[i];
    if(abs(t-a-h[i]*0.006)<kari){
      kari=abs(t-a-h[i]*0.006;
	       ans=i+1;}
    }
    cout << ans;
    
  
    
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ')' before ';' token
   14 |       kari=abs(t-a-h[i]*0.006;
      |               ~              ^
      |                              )
a.cc:15:16: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |                ans=i+1;}
      |                ^~~
      |                abs
a.cc:17:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |     cout << ans;
      |             ^~~
      |             abs
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

int main(){
    // input
    int N; cin >> N;
    int T, A; cin >> T >> A;
    vector<double> H(N);
    for (int i = 0; i < N; i++) cin >> H.at(i);

    // compute
    vector<double> dif(N);
    for (int i; i < N; i++){
        double tmp = T - H.at(i) * 0.006;
        dif.at(i) = abs(tmp - A);
    }

    vector<int>::iterator iter = min_element(dif.begin(), dif.end());
    size_t ans = distance(dif.begin(), iter);
    
    // output
    cout << ans+1 << endl;
    
}



Compiler output:
a.cc: In function 'int main()':
a.cc:23:45: error: conversion from '__normal_iterator<double*,vector<double>>' to non-scalar type '__normal_iterator<int*,vector<int>>' requested
   23 |     vector<int>::iterator iter = min_element(dif.begin(), dif.end());
      |                                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
a.cc:24:26: error: no matching function for call to 'distance(std::vector<double>::iterator, std::vector<int>::iterator&)'
   24 |     size_t ans = distance(dif.begin(), iter);
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:47,
                 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:2:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:148:5: note: candidate: 'template<class _InputIterator> constexpr typename std::iterator_traits< <template-parameter-1-1> >::difference_type std::distance(_InputIterator, _InputIterator)'
  148 |     distance(_InputIterator __first, _InputIterator __last)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:148:5: note:   template argument deduction/substitution failed:
a.cc:24:26: note:   deduced conflicting types for parameter '_InputIterator' ('__gnu_cxx::__normal_iterator<double*, std::vector<double> >' and '__gnu_cxx::__normal_iterator<int*, std::vector<int> >')
   24 |     size_t ans = distance(dif.begin(), iter);
      |                  ~~~~~~~~^~~~~~~~~~~~~~~~~~~
Language: C++

#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
using namespace std;

int main(){
    // input
    int N; cin >> N;
    int T, A; cin >> T >> A;
    vector<int> H(N);
    for (int i = 0; i < N; i++) cin >> H.at(i);

    // compute
    vector<int> dif(N);
    for (int i; i < N; i++){
        float tmp = T - H.at(i) * 0.006;
        dif.at(i) = abs(tmp - A);
    }

    vector<int>::iterator iter = min_element(dif.begin(), dif.end());
    size_t ans = distance(dif.begin(), iter)+1;
    
    // output
    cout << ans << endl;
    

Compiler output:
a.cc: In function 'int main()':
a.cc:27:25: error: expected '}' at end of input
   27 |     cout << ans << endl;
      |                         ^
a.cc:9:11: note: to match this '{'
    9 | int main(){
      |           ^
Language: C++

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

int main() {
  int N,T,A;
  cin >> N >> T >> A;
  
  vector<int> vec(N);
  for (int i=0;i<N;i++) {
    cin >> vec.at(i);
  }
  
  double a = 10000;
  int b = -1;
  double s;
  for (int i=0;i<N;i++) {
    if (A - (T - vec.at(i)) * 0.06 < 0) {
      s = -(A - (T - vec.at(i)) * 0.06)
    }
    else {
      s = A - (T - vec.at(i)) * 0.06
    }
    if (a>s) {
      a = s;
      b = i;
    }
  }
    
  cout << b +1 <<endl;  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:40: error: expected ';' before '}' token
   18 |       s = -(A - (T - vec.at(i)) * 0.06)
      |                                        ^
      |                                        ;
   19 |     }
      |     ~                                   
a.cc:21:37: error: expected ';' before '}' token
   21 |       s = A - (T - vec.at(i)) * 0.06
      |                                     ^
      |                                     ;
   22 |     }
      |     ~
Language: C++

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;


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


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  int T,A;
  cin>>T>>A;
  
  vector<int>H(N);
  
  int min=110;
  
  for(int i=0;i<H.size();i++){
    cin>>H.at(i);
    
    X=T-H.at(i)*0.006;
    
    if(X-A>0&&X-A<min){
      min=X-A;
  }
    else if(X-A<0&&-X+A<min){
      min=-X+A;
    }
  }
  
  for(int i=0;i<H.size();i++){
     X=T-H.at(i)*0.006;
    if(X-A==min){
      cout<<i<<endl;
      break;
    }
  }
}

  

 


Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'X' was not declared in this scope
   16 |     X=T-H.at(i)*0.006;
      |     ^
a.cc:27:6: error: 'X' was not declared in this scope
   27 |      X=T-H.at(i)*0.006;
      |      ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:6: error: expected ';' before 'n'
    6 |   cin n >> t >> a;
      |      ^~
      |      ;
a.cc:8:12: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
    8 |   double h[n];
      |            ^
a.cc:8:12: error: could not convert 'n' from 'double' to 'long unsigned int'
    8 |   double h[n];
      |            ^
      |            |
      |            double
a.cc:8:12: error: size of array 'h' has non-integral type 'double'
a.cc:9:34: error: invalid types 'double [1][double]' for array subscript
    9 |   for(i = 0; i < n; i++) cin >> h[i];
      |                                  ^
a.cc:12:6: error: invalid types 'double [1][double]' for array subscript
   12 |     h[i] = t - 0.006 * h[i];
      |      ^
a.cc:12:25: error: invalid types 'double [1][double]' for array subscript
   12 |     h[i] = t - 0.006 * h[i];
      |                         ^
a.cc:13:6: error: invalid types 'double [1][double]' for array subscript
   13 |     h[i] = abs(h[i] - a);
      |      ^
a.cc:13:17: error: invalid types 'double [1][double]' for array subscript
   13 |     h[i] = abs(h[i] - a);
      |                 ^
a.cc:17:9: error: invalid types 'double [1][double]' for array subscript
   17 |     if(h[i] < min){
      |         ^
a.cc:18:14: error: invalid types 'double [1][double]' for array subscript
   18 |       min = h[i];
      |              ^
Language: C++

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

int main(){
  int n,t,a,ans=0; cin>>n >>t >>a;
  vector<double> h(n);
  double dif = 1000;
  for(int i=0;i<n;i++){
    cin>>h.at(i);
    double x = t - h.at(i)*0.006;
    dif = min(dif,x);
    if(dif == x){
      ans = i;
    }
  }
  cout<<i<<endl;
}
    

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

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

int main(){
  int n,t,a,ans=0; cin>>n >>t >>a;
  vector<double> h(n);
  int dif = 1000;
  for(int i=0;i<n;i++){
    cin>>h.at(i);
    double x = t - h.at(i)*0.006;
    dif = min(dif,x);
    if(dif == h.at(i)){
      ans = i;
    }
  }
  cout<<i<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'min(int&, double&)'
   11 |     dif = min(dif,x);
      |           ~~~^~~~~~~
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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'double')
   11 |     dif = min(dif,x);
      |           ~~~^~~~~~~
/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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |     dif = min(dif,x);
      |           ~~~^~~~~~~
a.cc:16:9: error: 'i' was not declared in this scope
   16 |   cout<<i<<endl;
      |         ^
Language: C++

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

int main(){
  int n,t,a,ans=0; cin>>n >>t >>a;
  vector<double> h(n);
  int dif = 1000;
  for(int i=0;i<n;i++){
    cin>>h.at(i);
    h.at(i) = t - h.at(i)*0.006;
    dif = min(dif,h.at(i) );
    if(dif == h.at(i)){
      ans = i;
    }
  }
  cout<<i<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&)'
   11 |     dif = min(dif,h.at(i) );
      |           ~~~^~~~~~~~~~~~~~
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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   11 |     dif = min(dif,h.at(i) );
      |           ~~~^~~~~~~~~~~~~~
/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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |     dif = min(dif,h.at(i) );
      |           ~~~^~~~~~~~~~~~~~
a.cc:16:9: error: 'i' was not declared in this scope
   16 |   cout<<i<<endl;
      |         ^
Language: C++

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

int main(){
  int n,t,a,ans=0; cin>>n >>t >>a;
  vector<double> h(n);
  int dif = 1000;
  for(int i=0;i<n;i++){
    cin>>h.at(i);
    h.at(i) = t - h.at(i)*0.006;
    dif = min(dif,h.at(i));
    if(dif == h.at(i)){
      ans = i;
    }
  }
  cout<<i<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type&)'
   11 |     dif = min(dif,h.at(i));
      |           ~~~^~~~~~~~~~~~~
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:11:14: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   11 |     dif = min(dif,h.at(i));
      |           ~~~^~~~~~~~~~~~~
/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:11:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   11 |     dif = min(dif,h.at(i));
      |           ~~~^~~~~~~~~~~~~
a.cc:16:9: error: 'i' was not declared in this scope
   16 |   cout<<i<<endl;
      |         ^
Language: C++

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

int main(){
  int n,t,a,ans=0; cin>>n >>t >>a;
  vector<int> h(n);
  int dif = 1000;
  for(int i=0;i<n;i++){
    cin>>h.at(i);
    h.at(i) = t - h.at(i)*0.006;
    dif = min(dif,h.at(i));
    if(dif == h.at(i)){
      ans = i;
  }
  cout<<i<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected '}' at end of input
   15 |   cout<<i<<endl;
      |                 ^
a.cc:8:23: note: to match this '{'
    8 |   for(int i=0;i<n;i++){
      |                       ^
a.cc:15:17: error: expected '}' at end of input
   15 |   cout<<i<<endl;
      |                 ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n, t, a; cin >> n >> t >> a;
  t *= 1000;
  a *= 1000;
  vector<int> vals(n):
  int dist = 1<<30;
  for(int i = 0; i < n; i++){
    cin >> vals[i]; vals[i] *= 6000;
    dist = min(dist, abs(a - (t - vals[i])));
  }
  for(int i = 0; i < n; i++){
    if(dist == abs(a - (t - vals[i]))){
      cout << i + 1 << endl;
      return 0;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: error: expected ',' or ';' before ':' token
    7 |   vector<int> vals(n):
      |                      ^
a.cc:11:5: error: 'dist' was not declared in this scope
   11 |     dist = min(dist, abs(a - (t - vals[i])));
      |     ^~~~
a.cc:14:8: error: 'dist' was not declared in this scope
   14 |     if(dist == abs(a - (t - vals[i]))){
      |        ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,t,a,h[1000],min=900000,sum=0;
  for(int i=0;i<n;i++){
    cin>>h[i];
    sum = abs((t-h[i]*0.006)-a)
    if(h[i]<min){
      min =sum;
    }
  }
  cout<<min<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:32: error: expected ';' before 'if'
    7 |     sum = abs((t-h[i]*0.006)-a)
      |                                ^
      |                                ;
    8 |     if(h[i]<min){
      |     ~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,t,a,h[1000],min=900000,sum=0;
  for(int i=0;i<n;i++){
    cin>>h[i];
    sum = abs((t-h[i]**0.006)-a)
    if(h[i]<min){
      min =sum;
    }
  }
  cout<<min<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:23: error: invalid type argument of unary '*' (have 'double')
    7 |     sum = abs((t-h[i]**0.006)-a)
      |                       ^~~~~~
Language: C++

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

#define ll long long

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

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

#include<stdio.h>
int main(void)
{
	int N, T, A,point=0;
	double tem,min=1000.0;
	long int H[1001];
	scanf("%d%d%d", &N, &T, &A);
	for (int i = 1; i <= N; i++) {
		scanf("%ld", &H[i]);
		tem = T - H[i] * 0.006;
		if (tem >= A) {
			if (min > tem - A) {
				min = tem - A;
				point = i;
			}
		}
		else if (tem < A) {
			if (min > A - tem) {
				min = A - tem;
				point = i;
			}
	}
	printf("%d", point);
	return 0;
}

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

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

int ncr(int n,int r){ int res=1; if(r>n-r)r=n-r; for(int i=0;i<r;i++) {  res*=n-i;  res/=i+1; } return res; }

int gcd(int a,int b){
    if(b==0) return a;
    else return gcd(b,a%b);
}
vector<int>v;
bool isPresent(int n){
    for(int i=0;i<v.size();i++){
        if(v[i]==n) return true;
    }
    return false;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin>>t;
    int sum=0;
    while(t--){
        double n,t,a;
        cin>>n>>t>>a;
        double h[n];
        for(int i=0;i<n;i++){
            double x;
            cin>>x;
            h[i]=abs((t-x*(0.006))-a);
        }
        int index;
        double min=1e9;
        for(int i=0;i<n;i++){
            if(min>h[i]) {min=h[i];index=i;}
        }
        cout<<index+1;
        
        
    }
}
    

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

#include <iostream>


void main()
{
	int N;
	int T, A;
	std::cin >> N;
	std::cin >> T >> A;
	int H = 1000000;
	int t_temp;
	int h,result;
	for (int i = 0; i < N; i++) {
		std::cin >> h;
		t_temp = T - h * 0.006;
		if (t_temp < H) {
			H = t_temp;
			result = i;
		}
	}
	std::cout << result;
}


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

#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#define REP(i, b, n) for (Int i = b; i < Int(n); i++)
#define rep(i, n) REP(i, 0, n)
using namespace std;
using Int = long long;
Int inf = 1000000000000000001LL;
using vi = vector<Int>;
using vvi = vector<vi>;

Int GCD(Int a, Int b){
    if(b==0) return a;
    if(a < b) return GCD(b, a);
    unsigned r;
    while ((r=a%b)) {
        a = b;
        b = r;
    }
    return b;
}

int main() {
    int N,T,A;

    cin >>N>>T>>A;
    Int ans =inf;
    vi H = vi(N);
    rep(i,N){
        cin >> H[i];
    }
    Int minT = inf;

    rep(i,N){
        Int tmp = T-H[i]*0.006;
        Int now_diff = abs(A-tmp);
        if(minT>now_diff){
            ans = i+1;
        }
        minT = min(minT,abs(A-tmp)) ;
    }


    cout << ans;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:27:5: error: 'cin' was not declared in this scope
   27 |     cin >>N>>T>>A;
      |     ^~~
a.cc:5:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    4 | #include <vector>
  +++ |+#include <iostream>
    5 | #define REP(i, b, n) for (Int i = b; i < Int(n); i++)
a.cc:45:5: error: 'cout' was not declared in this scope
   45 |     cout << ans;
      |     ^~~~
a.cc:45:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

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

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


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

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int min_cost=10000;
int main(){
    int N,T,A,idx;
    cin>>N;
    cin>>T>>A;
    vector<int>H(N);
    int ans=1<<50;
    for(int i=0;i<n;i++){
        cin>>H[i];
    }
    for(int i=0;i<N;i++){
        int air=T-H[i]*0.006;
        diff=abs(A-air)
        if(diff<ans){
            ans=diff;
            idx=i;
        }
    }
    cout<<idx<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:14: warning: left shift count >= width of type [-Wshift-count-overflow]
   14 |     int ans=1<<50;
      |             ~^~~~
a.cc:15:19: error: 'n' was not declared in this scope
   15 |     for(int i=0;i<n;i++){
      |                   ^
a.cc:20:9: error: 'diff' was not declared in this scope
   20 |         diff=abs(A-air)
      |         ^~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int n,t,a,h,idx;
int main(){
    cin>>n;
    cin>>t>>a;
    double tmp=10^9;
    for(int i=0;i<n;i++){
        cin>>h;
        int temperature=t-h*0.006;
        int diff=abs(a-temperature)
        if(diff<tmp){
            idx=i+1;
            tmp=diff;
        }
    }
    cout<<idx<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: warning: result of '10^9' is 3; did you mean '1e9'? [-Wxor-used-as-pow]
   12 |     double tmp=10^9;
      |                  ^
      |                ---
      |                1e
a.cc:12:16: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   12 |     double tmp=10^9;
      |                ^~
      |                0xa
a.cc:17:9: error: expected ',' or ';' before 'if'
   17 |         if(diff<tmp){
      |         ^~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int n,t,a,h,idx;
int main(){
    cin>>n;
    cin>>t>>a;
    double diff=10^5;
    for(int i=0;i<n;i++){
        cin>>h;
        if(abs(a-(t-h*0.006))<diff){
            idx=i+1
            diff=abs(a-(t-h*0.006));
        }
    }
    cout<<idx<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: warning: result of '10^5' is 15; did you mean '1e5'? [-Wxor-used-as-pow]
   12 |     double diff=10^5;
      |                   ^
      |                 ---
      |                 1e
a.cc:12:17: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   12 |     double diff=10^5;
      |                 ^~
      |                 0xa
a.cc:16:20: error: expected ';' before 'diff'
   16 |             idx=i+1
      |                    ^
      |                    ;
   17 |             diff=abs(a-(t-h*0.006));
      |             ~~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<numeric>
#include<string>
#include<vector>
using namespace std;
int n,t,a,h,iex;
int main(){
    cin>>n;
    cin>>t>>a;
    double diff=10^5;
    for(int i=0;i<n;i++){
        cin>>h;
        if(abs(a-(t-h*0.006))<diff){
            idx=i+1
            diff=abs(a-(t-h*0.006));
        }
    }
    cout<<idx<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:19: warning: result of '10^5' is 15; did you mean '1e5'? [-Wxor-used-as-pow]
   12 |     double diff=10^5;
      |                   ^
      |                 ---
      |                 1e
a.cc:12:17: note: you can silence this warning by using a hexadecimal constant (0xa rather than 10)
   12 |     double diff=10^5;
      |                 ^~
      |                 0xa
a.cc:16:13: error: 'idx' was not declared in this scope; did you mean 'iex'?
   16 |             idx=i+1
      |             ^~~
      |             iex
a.cc:20:11: error: 'idx' was not declared in this scope; did you mean 'iex'?
   20 |     cout<<idx<<endl;
      |           ^~~
      |           iex
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int main(){
  int n, t, a, h;
  cin >> n >> t >> a;
  vector<int>d(n);
  for(int i = 0;i < n;i++){
    cin >> h;
    d[i] = abs(t - h);
  }
  cout << distance(d.begin,max_element(d.begin(),d.end())) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: cannot resolve overloaded function 'begin' based on conversion to type '__gnu_cxx::__normal_iterator<int*, std::vector<int> >'
   14 |   cout << distance(d.begin,max_element(d.begin(),d.end())) << endl;
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int main(){
  int n, t, a, h;
  cin >> n >> t >> a;
  vector<double>d(n);
  for(int i = 0;i < n;i++){
    cin >> h;
    d[i] = fabs(t - h * 0.006);
  }
  cout << distance(d.begin,max_element(d.begin(),d.end())) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:19: error: cannot resolve overloaded function 'begin' based on conversion to type '__gnu_cxx::__normal_iterator<double*, std::vector<double> >'
   14 |   cout << distance(d.begin,max_element(d.begin(),d.end())) << endl;
      |           ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int main(){
  int n, t, a, h;
  cin >> n >> t >> a;
  vector<double>d(n);
  for(int i = 0;i < n;i++){
    cin >> h;
    d[i] = fabs(t - h * 0.006);
  }
  cout << distance(d.begin,max_element(d.begin(),d,end())) << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:55: error: no matching function for call to 'end()'
   14 |   cout << distance(d.begin,max_element(d.begin(),d,end())) << endl;
      |                                                    ~~~^~
In file included from /usr/include/c++/14/bits/range_access.h:36,
                 from /usr/include/c++/14/string:53,
                 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/initializer_list:99:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:74:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:85:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:106:5: note: candidate: 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:115:31: note: candidate: 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:   candidate expects 1 argument, 0 provided
/usr/include/c++/14/bits/range_access.h:116:37: note: candidate: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note:   candidate expects 1 argument, 0 provided
Language: C++

#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;
int main(){
  int n, t, a, h;
  cin >> n >> t >> a;
  vector<double>d(n);
  for(int i = 0;i < n;i++){
    cin >> h;
    d[i] = fabs(t - h * 0.006);
  }
  cout << min_elements(d.begin(),d.end());
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'min_elements' was not declared in this scope
   14 |   cout << min_elements(d.begin(),d.end());
      |           ^~~~~~~~~~~~
Language: Java

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Abc113b {

	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 = 0;				//標高
		int t = 0;				//温度計算用
		int c = Integer.MAX_VALUE;/* なにこれ */
		
		Map<Integer, Integer> m = new HashMap<>();
		
		for(int i = 1; i <= N; i++) {
			H = sc.nextInt();
			t = (int)(T - H * 0.006) - A;
			m.put(Math.abs(t), i);
			if(Math.abs(t) < c) {
				c = Math.abs(t);
			}
		}
		System.out.println(m.get(c));
	}

}

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

#include <iostream>
#include <cmath>

using namespace std;

int main(){

int n;
  double t,a;
  cin >> n;
  cin >> t >> a;
  
  double tem=1000000;
  
  int h[n],index;
  for(int i=0;i<n;i++){
   cin >> h[i];
    if(abs(t-0.006*h[i]-a)<tmp){
      tmp=t-0.006*h[i]-a;
      index=i;
    }
  }

 cout << index+1 << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   18 |     if(abs(t-0.006*h[i]-a)<tmp){
      |                            ^~~
      |                            tm
Language: C++

#include <iostream>

using namespace std;

int main(){

int n;
  double t,a;
  cin >> n;
  cin >> t >> a;
  
  double tem=1000000;
  
  int h[n],index;
  for(int i=0;i<n;i++){
   cin >> h[i];
    if(abs(t-0.006*h[i]-a)<tmp){
      tmp=t-0.006*h[i]-a;
      index=i;
    }
  }

 cout << index+1 << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   17 |     if(abs(t-0.006*h[i]-a)<tmp){
      |                            ^~~
      |                            tm
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:13: error: invalid types 'int[int]' for array subscript
   12 |     cin >> a[i];
      |             ^
a.cc:13:27: error: invalid types 'int[int]' for array subscript
   13 |     tmp[i] = t - 0.006 * a[i];
      |                           ^
Language: C++

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




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

  for(int i=0;i<N;i++){
    H.at(i) = abs(A-abs(T-H.at(i)*0.006))*1000;
  }

  vector<int>::iterator minIt = *std::min_element(H.begin(),H.end());
  size_t minIndex = distance(H.begin(),minIt);

  cout << minIndex+1 << endl;
  

}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:33: error: conversion from 'int' to non-scalar type 'std::vector<int>::iterator' requested
   22 |   vector<int>::iterator minIt = *std::min_element(H.begin(),H.end());
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

int main(){
  int N;
  cin >> N;
  int T, A;
  cin >> T >> A;
  vector<int> H(N);
  for(int i = 0; i < N; i++) cin >> H[i];
  double mind = 1000.0;
  int idx = 0;
  for(int i = 0; i < N; i++){
    double d = 0.0;
    d = (double)T - 0.006 * H[i];
    if(mind >= d){
      idx = i;
      mind = d;
    }
  }
cout << idx++;  
}
  
  
  
}


Compiler output:
a.cc:28:1: error: expected declaration before '}' token
   28 | }
      | ^
Language: C++

#include <iostream>

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 mind = 1000.0;
  int idx = 0;
  for(int i = 0; i < N; i++){
    double d = 0.0;
    d = (double)T - 0.006 * H[i];
    if(mind >= d){
      idx = i;
      mind = d;
    }
  }
cout << idx++;  
}
  
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:3: error: 'vector' was not declared in this scope
   10 |   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 | 
a.cc:10:10: error: expected primary-expression before 'int'
   10 |   vector<int> H(N);
      |          ^~~
a.cc:11:37: error: 'H' was not declared in this scope
   11 |   for(int i = 0; i < N; i++) cin >> H[i];
      |                                     ^
a.cc:16:29: error: 'H' was not declared in this scope
   16 |     d = (double)T - 0.006 * H[i];
      |                             ^
a.cc: At global scope:
a.cc:27:1: error: expected declaration before '}' token
   27 | }
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
// int H[N]; rep(i,N) scanf("%d", &H[i]);
using namespace std;

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;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;
// spring s; cin >> s;
// cout << res << endl;
// --------write my code!!!!!----------//

// I'm trying to ~~~
int main(){
    double N,T,A; cin>>N>>T>>A;
    double H[N];
    rep(i,N) cin >> H[i];
    double t = 10000000;
    int res = 0;
    rep(i,N){
        double temp = abs(A - (T - H[i]*0.006));
        if(temp < t){
            t=temp;
            res = i+1;
        }
    }
    cout << res << endl;
}



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

#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); ++i)
// int H[N]; rep(i,N) scanf("%d", &H[i]);
using namespace std;

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;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;
// spring s; cin >> s;
// cout << res << endl;
// --------write my code!!!!!----------//

// I'm trying to ~~~
int main(){
    double N,T,A; cin>>N>>T>>A;
    double H[N];
    rep(i,N) scanf("%d", &H[i]);
    double t = 10000000;
    int res = 0;
    rep(i,N){
        double temp = T - H[i]*0.006;
        if(abs(A-temp)<t){
            t=abs(A-temp);
            res = i+1;
        }
    }
    cout << res << endl;
}



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

#include <iostream>
using namespace std;
int main(){
    int n,t,a;cin >> n >> t >> a;
    int diff = 1e9;
    int ans;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:39: error: expected ';' before ')' token
   11 |             diff = (a - (t - h*0.006)));
      |                                       ^
      |                                       ;
Language: C++

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

int main() {
  int n,t,a;
  vector<int> h(n);
  vector<double> x(n),y(n);
  
  for(int i =0;i<n;i++){
    cin >> h.at(i);
    x.at(i) = t - a - h.at(i)*0.006;
    if(x.at(i) < 0){
      x.at(i) = -x.at(i);
    }
    y.at(i) = x.at(i);
  }
  
  sort(x.begin(), x.end());
  
  for(int i = 0; i<n;i++){
    if(y.at(i) == x.at(0){
      cout << i+1 << endl;
      break;
    }
  }
}       

Compiler output:
a.cc: In function 'int main()':
a.cc:21:26: error: expected ')' before '{' token
   21 |     if(y.at(i) == x.at(0){
      |       ~                  ^
      |                          )
a.cc:25:3: error: expected primary-expression before '}' token
   25 |   }
      |   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  double T,A
  cin>>N>>T>>A;
  vector<double>vecA(N);
  vector<double>vecB(N);
  for(int i=0;i<N;i++){
    double H;
    cin>>H;
    vecB[i]=A-T+(H*0.006);
    if((A-T+(H*0.006))>=0 )vecA[i]=A-T+(H*0.006);
    else vecA[i]=T-(H*0.006)-A;
  }
  sort(vecA.begin(),vecA.end());
  for(int i=0;i<N;i++){
    if(vecB[i]==vecA[0]){
      cout<<i+1<<endl;
      break;      
    }
    else if(vecB[i]==0-vecA[0]){
      cout<<i+1<<endl;
      break;
    }
    else continue;
  }
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: expected initializer before 'cin'
    7 |   cin>>N>>T>>A;
      |   ^~~
a.cc:13:13: error: 'A' was not declared in this scope
   13 |     vecB[i]=A-T+(H*0.006);
      |             ^