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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:30:12: error: no matching function for call to 'min(int&, __gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type)'
   30 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:30:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'})
   30 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:30:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   30 |     tmp=min(tmp,at[i]-a);
      |         ~~~^~~~~~~~~~~~~
Language: Java

import java.util.*;

public class Main{
  public static void mian(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int T = sc.nextInt();
    double A = sc.nextDouble();
    double min = 1000000;
    
    for(int i=0; i<N; i++){
      double H = sc.nextInt();
      double temp = T- H*0.006;
      double temp1 = Math.min(min, Math.abs(A-temp));
      if(min<temp1) min = temp1;
    }
    System.out.println(temp1);
  }
}

Compiler output:
Main.java:17: error: cannot find symbol
    System.out.println(temp1);
                       ^
  symbol:   variable temp1
  location: class Main
1 error
Language: C++

int main(){
    io

    int n,t,a;
    cin >> n >> t >> a;
    
    double min(100000);
    int index;
    for(int i(0); i<n; i++){
        double x; cin >> x;
        x = t - (x * 0.006);
        if(abs(a - x) < min){
            min = abs(a - x);
            index = i;
        }
    }
    cout << index + 1 << ENDL;
 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:5: error: 'io' was not declared in this scope
    2 |     io
      |     ^~
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> n >> t >> a;
      |     ^~~
a.cc:5:12: error: 'n' was not declared in this scope
    5 |     cin >> n >> t >> a;
      |            ^
a.cc:5:17: error: 't' was not declared in this scope
    5 |     cin >> n >> t >> a;
      |                 ^
a.cc:5:22: error: 'a' was not declared in this scope
    5 |     cin >> n >> t >> a;
      |                      ^
a.cc:12:12: error: 'abs' was not declared in this scope
   12 |         if(abs(a - x) < min){
      |            ^~~
a.cc:17:5: error: 'cout' was not declared in this scope
   17 |     cout << index + 1 << ENDL;
      |     ^~~~
a.cc:17:26: error: 'ENDL' was not declared in this scope
   17 |     cout << index + 1 << ENDL;
      |                          ^~~~
Language: C++

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

int main(){
  int n, t, a;
  cin >> n >> t >> a;
  vector<int> h(n);
  rep(i, 0, n) cin >> h[i];
  ll ans = min_element(h.begin(), h.end()) - h.begin() + 1;
  cout << ans << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'i' was not declared in this scope
    8 |   rep(i, 0, n) cin >> h[i];
      |       ^
a.cc:8:3: error: 'rep' was not declared in this scope
    8 |   rep(i, 0, n) cin >> h[i];
      |   ^~~
a.cc:9:3: error: 'll' was not declared in this scope
    9 |   ll ans = min_element(h.begin(), h.end()) - h.begin() + 1;
      |   ^~
a.cc:10:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   10 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main()

{
	int n,t,a;
	cin >> n;
	cin >> t >> a;
	vector<int> arr(n);

	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}

	int point = INT_MAX;
	int area = 0;
	for (int i = 0; i < n;i++) {
		//cout << abs(a - (t - arr[i] * 0.6)) << endl;
		if (point > abs(a - (t - arr[i] * 0.6))) {
			point = abs(a - (t - arr[i] * 0.6));
			area = i+1;
		}
	}

	cout << area << endl;

	return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:21: error: 'INT_MAX' was not declared in this scope
   25 |         int point = INT_MAX;
      |                     ^~~~~~~
a.cc:9:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <cmath>
  +++ |+#include <climits>
    9 | #include <string>
Language: C++

#include <iostream>
#include <stdio.h>

#include <vector>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main()

{
	int n,t,a;
	cin >> n;
	cin >> t >> a;
	vector<int> arr(n);

	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}

	double point = INT_MAX;
	int area = 0;
	for (int i = 0; i < n;i++) {
		if (point > abs(a - t - arr[i] * 0.6)) {
			point = abs(a - t - arr[i] * 0.6);
			area = i+1;
		}
	}

	cout << area << endl;

	return 0;

}

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

#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
int main()
{
    int n, t, a;
    scanf("%d%d%d", &n, &t, &a);
    int d = inf;
    int ans = 0;
    rep(i, n)
    {
        int h;
        scanf("%d", &h);
        if (abs((t - h * 6) - a * 1000) < d)
        {
            d = abs((t - h * 6) - a * 1000);
            ans = i + 1;
        }
    }
    printf("%d\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:13: error: 'inf' was not declared in this scope; did you mean 'ynf'?
    8 |     int d = inf;
      |             ^~~
      |             ynf
Language: Java

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int T = sc.nextInt();
        int A = sc.nextInt();
        int[] H = new int[N];
        double[] temperatures = new double[N];
        double diffMin = 1000000000;
        int index = 0;

        for (int i = 0; i < N; i++) {
            H[i] = sc.nextInt();
        }

        for (int i = 0; i < N; i++) {
            temperatures[i] = T - H[i] * 0.006;
            double diff = Math.abs(A - temperatures[i]);
            if (diff < diffMin) {
                diffMin = diff;
                index = i;
            }
        }

        System.out.println(index + 1);

    }

}


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

#include <bits/stdc++.h>

using namespace std;

int main(){
	double n,t,A;
	cin>>n>>t>>A;
	double a[n];
	double mx=1e9,ans=0;
	for(int i=0;i<n;i++){
		cin>>a[i];
		double x=t-a[i]*0.006;
		if(abs(A-x)<mx){
			mx=abs(A-x);
			ans=i+1;
		}
	}
	cout<<ans;

}

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

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,t,a;
  int c=1<<30;
  int res;
  cin >> n >> t >> a;
  vector<int> h(n);
  for(int i=0;i<n;i++){
    cin >> h[i];
    int d=(t*1000-6*h[i])-a*1000;
    if(d<0)d=-d;
    if(cc>d)cc=d,res=i;
  }
  cout << res+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'cc' was not declared in this scope; did you mean 'c'?
   13 |     if(cc>d)cc=d,res=i;
      |        ^~
      |        c
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,t,a;
  int c=1<<29;
  int res;
  cin >> n >> t >> a;
  vector<int> h(n);
  for(int i=0;i<n;i++){
    cin >> h[i];
    int d=(t*1000-6*h[i])-a*1000;
    if(d<0)d=-d;
    if(cc>d)cc=d,res=i;
  }
  cout << res+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: 'cc' was not declared in this scope; did you mean 'c'?
   13 |     if(cc>d)cc=d,res=i;
      |        ^~
      |        c
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,t,a;
  int c=1<<50;
  int res;
  cin >> n >> t >> a;
  vector<int> h(n);
  for(int i=0;i<n;i++){
    cin >> h[i];
    int d=(t*1000-6*h[i])-a*1000;
    if(d<0)d=-d;
    if(cc>d)cc=d,res=i;
  }
  cout << res+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: warning: left shift count >= width of type [-Wshift-count-overflow]
    5 |   int c=1<<50;
      |         ~^~~~
a.cc:13:8: error: 'cc' was not declared in this scope; did you mean 'c'?
   13 |     if(cc>d)cc=d,res=i;
      |        ^~
      |        c
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,t,a;
  int c=1<<50;
  cin >> n >> t >> a;
  vector<int> h(n);
  for(int i=0;i<n;i++){
    cin >> h[i];
    int d=(t*1000-6*h[i])-a*1000;
    if(d<0)d=-d;
    if(cc>d)cc=d,res=i;
  }
  cout << res+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: warning: left shift count >= width of type [-Wshift-count-overflow]
    5 |   int c=1<<50;
      |         ~^~~~
a.cc:12:8: error: 'cc' was not declared in this scope; did you mean 'c'?
   12 |     if(cc>d)cc=d,res=i;
      |        ^~
      |        c
a.cc:12:18: error: 'res' was not declared in this scope
   12 |     if(cc>d)cc=d,res=i;
      |                  ^~~
a.cc:14:11: error: 'res' was not declared in this scope
   14 |   cout << res+1 << endl;
      |           ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,T,A;
  cin >>N>>T>>A;
  vector<int> meruru(N);
for (int i=0;i<N;i++){cin >>meruru.at(i);}
  int rorona= meruru.at(0);
  int totori=0;
  for(int i=0;i<N;i++){
    if(abs(rorona-1000*A)>abs(meruru.at(i)-1000*A)){
      rorona=tem.at(i);
      totori=i;
    }
  }
  cout<<num+1<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'tem' was not declared in this scope; did you mean 'tm'?
   13 |       rorona=tem.at(i);
      |              ^~~
      |              tm
a.cc:17:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   17 |   cout<<num+1<<endl;
      |         ^~~
      |         enum
Language: C++

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
  int N, T, A;
  cin >> N >> T >> A;
  int ans = 0;
  double nearest = 200;
  for (int i = 1; i <= N; i++) {
    int H;
    cin >> H;
    if (fabs(A-(T-H*0.006)) < nearest) {
      ans = i;
      nearest = abs(A-(T-H*0.006));
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:9: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   13 |     if (fabs(A-(T-H*0.006)) < nearest) {
      |         ^~~~
      |         labs
Language: C

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

int main() {

    int n, t, a, h;
    scanf("%d %d %d", &n, &t, &a);
    int idx = 1;
    scanf("%d", &h);
    double ondo = (double) t - h * 0.006;
    double nearest = (abs) (a - ondo);
    
    for (int i = 1; i < n; i++) {
        scanf("%d", &h);
        ondo = (double) t - h * 0.006;
    
        if ((abs) (a - ondo) < nearest) {
            nearest = (abs) (a - ondo);
            idx = i+1;
        }

    }

    printf("%d", idx);

    return 0;
} 

Compiler output:
main.c: In function 'main':
main.c:12:23: error: 'abs' undeclared (first use in this function); did you mean 'fabs'?
   12 |     double nearest = (abs) (a - ondo);
      |                       ^~~
      |                       fabs
main.c:12:23: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

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

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

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

int main(){
  int N,T,A;
  cin>>N>>T>>A;
  T*=1000,A*=1000;
  int k=0,l=0;
  for(int i=1;i<=N;i++){
    int H;
    cin>>H;
    if(k>abs(A-(T-H*6))){
      k=abs(A-(T-H*6));
      l=i;
    }
  }
  cout<<l<<enhdl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:12: error: 'enhdl' was not declared in this scope
   17 |   cout<<l<<enhdl;
      |            ^~~~~
Language: C

#include<iostream>

using namespace std;

int main() {
	double N, T, A, H[1100], genzaiti,saiteki=10000, bangou=0;

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

	for (int i = 0; i < N; i++) {
		genzaiti = abs(A - (T - H[i] * 0.006));
		if (saiteki >genzaiti) {
			saiteki = genzaiti;
			bangou = i + 1.0;
		}
	}
	cout << bangou << endl;


	return 0;
}

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

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

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.at(i);
    }
    int min = 0;

    for (int i = 0; i < N; i++)
    {
        int temp = 0;
        temp = T - (h.at(i) * 6) / 1000;
        h.at(i) = abs(temp - A);
    }
    for(int i = 1; i < N; i++){
        if(h.at(min) > h.at(i)){
            min = i;
        }
    }
    cout << i + 1 << endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:27:13: error: 'i' was not declared in this scope
   27 |     cout << i + 1 << endl;
      |             ^
a.cc:27:27: error: expected '}' at end of input
   27 |     cout << i + 1 << endl;
      |                           ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

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

int N, T, A, H[1100];

int main(){

  cin >> N >> T >> A;

  for(int i; i < N; ++i){
    cin >> H[i];
  }

  double dmin = 1e9, ans = -1;

  for(int i; i < N; ++i){
    double t = T - H[i] * 0.006;
    double d = abs(A - t);c
    if(d < dmin){
      dmin = d;
      ans = i;
    }
  }

  cout << ans + 1 << endl;

  return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:27: error: 'c' was not declared in this scope
   18 |     double d = abs(A - t);c
      |                           ^
Language: Java

import java.util.*;
public class ABC113b {

		static void solve() {
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();
			int t = sc.nextInt();
			int a = sc.nextInt();
			int array[] = new int[n];
			int result = 0;
			double min = Double.MAX_VALUE; 
			for(int i = 0;i<n;i++) {
				array[i] = sc.nextInt();
				if(a<t-array[i]*0.006) {	
					double res = ((t-array[i]*0.006)-a);
					if(res<=min) {
						result = i;
						min = res;
					}
			}
				else if(a>t-array[i]*0.006) {
					double res = (int) (a-(t-array[i]*0.006));
					if(res<=min) {
						result = i;
						min = res;
					}
				}
			}
			System.out.println(result+1);
			sc.close();
		}
	public static void main(String[] args) {
		solve();

	}

}


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

#include <bits/stdc++.h>
using namespace std;
int main() {
 int N,T,A;
 cin>>N>>T>>A;
 int min=10000000;
 int answer=0;
 vector<int>data(N);
 for(int i=0; i<N; i++){
    cin>>data.at(i);
    int g=data.at(i);
    double h=(A-(T-0.006*g))
    if(min>h){
        min=h;
        answer=i+1;
    }
 }
 cout<<answer<<endl;

 }

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

#include <bits/stdc++.h>
using namespace std;
int main() {
 int N,T,A;
 cin>>N>>T>>A;
 int min=10000000;
 int answer=0;
 vector<int>data(N);
 for(int i=0; i<N; i++){
    cin>>data.at(i);
    int g=data.at(i);
    int h=double(A-(T-0.006*g))
    if(min>h){
        min=h;
        answer=i+1;
    }
 }
 cout<<answer<<endl;

 }

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: no match for call to '(std::vector<int>) (int&)'
   17 |     if(a >= ave(i))
      |             ~~~^~~
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:17:16: error: no match for call to '(std::vector<int>) (int&)'
   17 |     if(a >= ave(i))
      |             ~~~^~~
a.cc:24:7: error: 'y' was not declared in this scope
   24 |       y = x.at(j+1);
      |       ^
a.cc:27:21: error: expected ';' before 'i'
   27 |   for(int i = 0; i<n i++){
      |                     ^~
      |                     ;
a.cc:28:8: error: 'y' was not declared in this scope
   28 |     if(y == x.at(i))
      |        ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:14:24: error: expected ',' or ';' before '=' token
   14 |     vector<int> ave(i) = t - h.at(i)*0.006;
      |                        ^
a.cc:16:16: error: no match for call to '(std::vector<int>) (int&)'
   16 |     if(a >= ave(i))
      |             ~~~^~~
a.cc:17:22: error: no match for call to '(std::vector<int>) (int&)'
   17 |       x.at(i) = a-ave(i);
      |                   ~~~^~~
a.cc:19:20: error: no match for call to '(std::vector<int>) (int&)'
   19 |       x.at(i) = ave(i) - a;
      |                 ~~~^~~
a.cc:23:7: error: 'y' was not declared in this scope
   23 |       y = x.at(j+1);
      |       ^
a.cc:26:21: error: expected ';' before 'i'
   26 |   for(int i = 0; i<n i++){
      |                     ^~
      |                     ;
a.cc:27:8: error: 'y' was not declared in this scope
   27 |     if(y == x.at(i))
      |        ^
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: expected primary-expression before ';' token
   13 |   for(int i = 0; i<n; i+;){
      |                         ^
a.cc:13:25: error: expected ')' before ';' token
   13 |   for(int i = 0; i<n; i+;){
      |      ~                  ^
      |                         )
a.cc:13:26: error: expected primary-expression before ')' token
   13 |   for(int i = 0; i<n; i+;){
      |                          ^
a.cc:23:7: error: 'y' was not declared in this scope
   23 |       y = x.at(j+1);
      |       ^
a.cc:26:21: error: expected ';' before 'i'
   26 |   for(int i = 0; i<n i++){
      |                     ^~
      |                     ;
a.cc:27:8: error: 'y' was not declared in this scope
   27 |     if(y == x.at(i))
      |        ^
Language: C++

2
12 -60
1000 2000#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define COUT(x) cout<<(x)<<endl
#define dump(x) cout<<#x<<" = "<<(x)<<endl;
#define Yes(x) cout<<(x?"Yes":"No")<<endl;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;
using M = map<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int, vector<int>, greater<int>>;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

int main() {
  int n,t;
  int a;
  cin >> n >> t >> a;
  int h[n]; REP(i,n) cin >> h[i];
  t*=1000; a*=1000;

  P ans = {0, INF};
  REP(i,n) {
    int temp = t - h[i] * 6;
    int d = abs(temp - a);
    if (d < ans.second) ans = {i,d};
  }
  COUT(ans.first+1);
  return 0;
}

Compiler output:
a.cc:3:10: error: stray '#' in program
    3 | 1000 2000#include <bits/stdc++.h>
      |          ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 2
      | ^
a.cc:10:11: error: 'pair' does not name a type
   10 | using P = pair<int,int>;
      |           ^~~~
a.cc:11:15: error: 'vector' does not name a type
   11 | using Graph = vector<vector<int>>;
      |               ^~~~~~
a.cc:12:11: error: 'map' does not name a type
   12 | using M = map<int,int>;
      |           ^~~
a.cc:13:12: error: 'priority_queue' does not name a type
   13 | using PQ = priority_queue<int>;
      |            ^~~~~~~~~~~~~~
a.cc:14:13: error: 'priority_queue' does not name a type
   14 | using PQG = priority_queue<int, vector<int>, greater<int>>;
      |             ^~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:22:3: error: 'cin' was not declared in this scope
   22 |   cin >> n >> t >> a;
      |   ^~~
a.cc:26:3: error: 'P' was not declared in this scope
   26 |   P ans = {0, INF};
      |   ^
a.cc:29:13: error: 'abs' was not declared in this scope
   29 |     int d = abs(temp - a);
      |             ^~~
a.cc:30:13: error: 'ans' was not declared in this scope
   30 |     if (d < ans.second) ans = {i,d};
      |             ^~~
a.cc:6:17: error: 'cout' was not declared in this scope
    6 | #define COUT(x) cout<<(x)<<endl
      |                 ^~~~
a.cc:32:3: note: in expansion of macro 'COUT'
   32 |   COUT(ans.first+1);
      |   ^~~~
a.cc:32:8: error: 'ans' was not declared in this scope
   32 |   COUT(ans.first+1);
      |        ^~~
a.cc:6:24: note: in definition of macro 'COUT'
    6 | #define COUT(x) cout<<(x)<<endl
      |                        ^
a.cc:6:28: error: 'endl' was not declared in this scope
    6 | #define COUT(x) cout<<(x)<<endl
      |                            ^~~~
a.cc:32:3: note: in expansion of macro 'COUT'
   32 |   COUT(ans.first+1);
      |   ^~~~
Language: C++

#include <iostream>
#include <cmath>
#include <vector>
#define REP(i, n) for (int i = 0; i < (n); ++i)
using namespace std;

int main(void) {
   cin.tie(0);
   ios::sync_with_stdio(false);

   int n, t, a;
   cin >> n >> t >> a;

   vector<double> h(n);
   REP(i, n) {
       double tmp;
       cin >> tmp;
       h[i] = abs(a - ((double)t - tmp * 0.006));
   }

   decltype(h)::iterator itr = min_element(h.begin(), h.end());
   size_t indexMin = distance(h.begin(), itr);
   cout << indexMin + 1 << '\n';
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: 'min_element' was not declared in this scope
   21 |    decltype(h)::iterator itr = min_element(h.begin(), h.end());
      |                                ^~~~~~~~~~~
Language: C++

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

int main(void) {
    int N, T, A;
    cin >> N;
    cin >> T;
    cin >> A;
    int D[1100];
    int min_diff = 999999;
    int result = -1;

    for (int i = 0; i < N; i++) {
        cin >> D[i];
        int diff = -1;
        /* 理想からどれだけ違うか. */
        int p = T - (0.006 * D[i]);
        if (p < 0) p = p * (-1);
        if (A < 0) int tmp_A = A * (-1);
        if (tmp_A < p) diff = (p - tmp_A);
        else           diff = (tmp_A - p);

        /* 理想更新 */
        if (min_diff > diff) {
            min_diff = diff;
            result = i + 1;
        }
    }

    cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:13: error: 'tmp_A' was not declared in this scope
   20 |         if (tmp_A < p) diff = (p - tmp_A);
      |             ^~~~~
Language: C++

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

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


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

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

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


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

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

int main() {
  int N, T, A, X, res;
  int min = std::pow(10,5);
  cin >> N >> T >> A;
  for (int i = 0, i < N, ++i) {
    cin >> X;
    int d = T * 1000 - X * 6 - A * 1000;
    if (d<0) d = -d;
    if (min > X) {
      min = X;
      res = i;
    }
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:20: error: expected ';' before '<' token
    8 |   for (int i = 0, i < N, ++i) {
      |                    ^~
      |                    ;
a.cc:8:21: error: expected primary-expression before '<' token
    8 |   for (int i = 0, i < N, ++i) {
      |                     ^
a.cc:8:29: error: expected ';' before ')' token
    8 |   for (int i = 0, i < N, ++i) {
      |                             ^
      |                             ;
Language: C++

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

int main() {
  int N, T, A, X, res;
  int min = std::(10,5);
  cin >> N >> T >> A;
  for (int i = 0, i < N, ++i) {
    cin >> X;
    int d = T * 1000 - X * 6 - A * 1000;
    if (d<0) d = -d;
    if (min > X) {
      min = X;
      res = i;
    }
  }
  cout << res << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected unqualified-id before '(' token
    6 |   int min = std::(10,5);
      |                  ^
a.cc:8:20: error: expected ';' before '<' token
    8 |   for (int i = 0, i < N, ++i) {
      |                    ^~
      |                    ;
a.cc:8:21: error: expected primary-expression before '<' token
    8 |   for (int i = 0, i < N, ++i) {
      |                     ^
a.cc:8:29: error: expected ';' before ')' token
    8 |   for (int i = 0, i < N, ++i) {
      |                             ^
      |                             ;
Language: C++

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

int main() {
  int N, T, A;
  cin >> N;
  cin >> T >> A;
  vector<int> H(N);
  int c = 0;
  for (int i = 0; i < N; ++i) {
    cin >> H[i];
  }
  vector<int> D(N);
  for (int i = 0; i < N; ++i) {
    if (T - H[i] * 0.006 >= A) D[i] = T - H[i] * 0.006 - A;
    else D[i] = A - T + H[i] * 0.006;
  }
  int min = D[0];
  for (int i = 0, i < N, ++i) {
    if (min > D[i]) {
      min = D[i];
      c = i;
    }
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:20: error: expected ';' before '<' token
   19 |   for (int i = 0, i < N, ++i) {
      |                    ^~
      |                    ;
a.cc:19:21: error: expected primary-expression before '<' token
   19 |   for (int i = 0, i < N, ++i) {
      |                     ^
a.cc:19:29: error: expected ';' before ')' token
   19 |   for (int i = 0, i < N, ++i) {
      |                             ^
      |                             ;
Language: C++

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

int main() {
  int N, T, A;
  cin >> N;
  cin >> T >> A;
  vector<int> H(N);
  int c = 0;
  for (int i = 0; i < N; ++i) {
    cin >> H[i];
  }
  vector<int> D(N);
  for (int i = 0; i < N; ++i) {
    if (T - H[i] * 0.006 >= A) D[i] = T - H[i] * 0.006 - A;
    else D[i] = A - T + H[i] * 0.006;
  }
  int min = D[0];
  int c=0;
  for (int i = 0, i < N, ++i) {
    if (min > D[i]) {
      min = D[i];
      c = i;
    }
  }
  cout << c << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: redeclaration of 'int c'
   19 |   int c=0;
      |       ^
a.cc:9:7: note: 'int c' previously declared here
    9 |   int c = 0;
      |       ^
a.cc:20:20: error: expected ';' before '<' token
   20 |   for (int i = 0, i < N, ++i) {
      |                    ^~
      |                    ;
a.cc:20:21: error: expected primary-expression before '<' token
   20 |   for (int i = 0, i < N, ++i) {
      |                     ^
a.cc:20:29: error: expected ';' before ')' token
   20 |   for (int i = 0, i < N, ++i) {
      |                             ^
      |                             ;
Language: C

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n,t,a,i=0;
	double b,c[2]={1000.0,0.0};

	scanf("%d%d%d",&n,&t,&a);
	while(n--){
		i++;
		scanf("%d",&h);
		b=abs(a-t-h*0.006);
		if(b<c[0]){
			c[0]=b;
			c[1]=i;
		}
	}
	printf("%.0lf",c[1]);
	return 0;
}

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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:65: error: expected ')' before '{' token
   16 |                 if(abs(a-t+v[i]*0.006) < abs(a-t+v[index]*0.006){
      |                   ~                                             ^
      |                                                                 )
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^
Language: C++

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


int main()
{
    int n, t, a;
    double h[1000];
    cin >> n >> t >> a;
    int height_;
    cin >> height_;
    int index;
    double min = abs((t - height_ * 0.006) - a);
    for (int i = 1; i < n; i++)
    {
        int height;
        cin >> height;
        int tmp = abs((t - height * 0.006) - a);
        if (tmp < min)
        {
            min = tmp;
            index = i;
        }
    }
    cout << i + 1 << endl;

}

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

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


int main()
{
    int n, t, a;
    double h[1000];
    cin >> n >> t >> a;
    int height_;
    cin >> height_;
    int index;
    double min = abs((t - height_ * 0.006) - a);
    for (int i = 0; i < n; i++)
    {
        int height;
        cin >> height;
        int tmp = abs((t - height * 0.006) - a);
        if (tmp < min)
        {
            min = tmp;
            index = i;
        }
    }
    cout << i + 1 << endl;

}

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

#include<cstdio>
int N,T,A,X;
int main(){
  scanf("%d%d%d",&N,&T,&A);
  iint 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);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'iint' was not declared in this scope; did you mean 'int'?
    5 |   iint res=0;
      |   ^~~~
      |   int
a.cc:11:19: error: 'res' was not declared in this scope
   11 |     if(cc>d) cc=d,res=i;
      |                   ^~~
a.cc:13:17: error: 'res' was not declared in this scope
   13 |   printf("%d\n",res);
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
vector<int> input(int N) {
  vector<int> vec(N);
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  return vec;
}

int main() {
  int n,t,a;
  cin >> n >> t >> a;
  vector<int> h=input(n);
  vector<int> temp(n,0);
  rep(i,n){
    diff[i]=abs((t*1000-h[i]*6)-a*1000);
  }
  int x=10000,res=0;
  rep(i,n){
    if(x>diff[i]){
      x=diff[i];
      res=i;
    }
  }
  cout << res++ << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'diff' was not declared in this scope
   18 |     diff[i]=abs((t*1000-h[i]*6)-a*1000);
      |     ^~~~
a.cc:22:10: error: 'diff' was not declared in this scope
   22 |     if(x>diff[i]){
      |          ^~~~
Language: C++

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

int main() {
  int N, T, A; cin >> N >> T >> A;
  int dif, res, min = 1000000000;
  for (int i=1; i<=N; i++) {
    int H; cin >> H;
    dif = 1000*T - 6*H - 1000*A;
    if (dif < 0) dif = -dif;
    if (min > dif) {
      min = dif;
      res = i;
    }
  }
  cout << i << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: 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; cin >> N >> T >> A;
  vector<double> dif(N);
  for (int i=0; i<N; i++) {
    int H, temp, x; cin >> H;
    temp = T - H*0.006;
    x = max{temp-A, A-temp};
    dif[i] = x;
  }
  double res = 1000;
  for (int i=0; i<N; i++) {
    if (res > dif[i]) res = dif[i];
  }
  for (int i=0; i<N; i++) {
    if (res=dif[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: cannot resolve overloaded function 'max' based on conversion to type 'int'
   10 |     x = max{temp-A, A-temp};
      |         ^~~
Language: C++

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

int main() {
  int N, T, A; cin >> N >> T >> A;
  vector<double> dif(N);
  for (int i=0; i<N; i++) {
    double H, temp, x; cin >> H;
    temp = T - H*0.006;
    x = max{temp-A, A-temp};
    dif[i] = x;
  }
  double res = 1000;
  for (int i=0; i<N; i++) {
    if (res > dif[i]) res = dif[i];
  }
  for (int i=0; i<N; i++) {
    if (res=dif[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: cannot resolve overloaded function 'max' based on conversion to type 'double'
   10 |     x = max{temp-A, A-temp};
      |         ^~~
Language: C++

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

int main() {
  int N, T, A; cin >> N >> T >> A;
  vector<double> dif(N);
  for (int i=0; i<N; i++) {
    double H, temp; cin >> H;
    temp = T - H*0.006;
    dif[i] = max{temp-A, A-temp};
  }
  double res = 1000;
  for (int i=0; i<N; i++) {
    if (res > dif[i]) res = def[i];
  }
  for (int i=0; i<N; i++) {
    if (res=dif[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: cannot resolve overloaded function 'max' based on conversion to type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   10 |     dif[i] = max{temp-A, A-temp};
      |              ^~~
a.cc:14:29: error: 'def' was not declared in this scope; did you mean 'dif'?
   14 |     if (res > dif[i]) res = def[i];
      |                             ^~~
      |                             dif
Language: C++

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

int main() {
  int N, T, A, m; cin >> N >> T >> A;
  vector<int> def(N);
  for (int i=0; i<N; i++) {
    int H, t, d; cin >> H;
    t = T-H*0.006;
    d = t-A;
    if (d<0) d *= -1;
    def[i] = d;
  }
  int res=INF;
  for (int i=0; i<N; i++) {
    if (res>def[i]) res=def[i];
  }
  for (int i=0; i<N; i++) {
    if (res=def[i]) cout << i << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'INF' was not declared in this scope
   14 |   int res=INF;
      |           ^~~
Language: C++

#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int n,t,k,ans=0;
  cin>>n>>t>>k;
  long double a[n];
  for(int i=0;i<n;i++){
    int s;
    cin>>s;
    a[i]=t-s*0.006;
  }
  for(int i=0;i<n;i++){
    if(min>abs(a[i]-k)){
      min=abs(a[i]-k);
      ans=i+1;
  }
  }
  cout<<ans<<endl;
    return 0;
  }


Compiler output:
a.cc: In function 'int main()':
a.cc:15:11: error: invalid operands of types '<unresolved overloaded function type>' and 'long double' to binary 'operator>'
   15 |     if(min>abs(a[i]-k)){
      |        ~~~^~~~~~~~~~~~
a.cc:16:21: error: overloaded function with no contextual type information
   16 |       min=abs(a[i]-k);
      |                     ^
Language: C++

#include <iostram>
#include<cmath>
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];
	
	double dif=100000;
	int ans=0;
	for(int i=0; i<N; i++){
		double tmp=T-H[i]*0.006;
		if(abs(A-tmp)<dif){
          dif=abs(A-tmp);
          ans=i+1;
        }
      
     // cout << dif << " " << tmp << endl;
	}
	cout << ans << endl;
}

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

#include<algorithm>
#include<iostream>
using namespace std;
int main(){
int n,t,k,ans=0;
  cin>>n>>t>>k;
  long double a[n];
  for(int i=0;i<n;i++){
    int s;
    cin>>s;
    a[i]=t-s*0.006;
  }
  for(int i=0;i<n;i++){
    if(min>abs(a[i]-k)){
      min=abs(a[i]-k);
      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 'long double' to binary 'operator>'
   14 |     if(min>abs(a[i]-k)){
      |        ~~~^~~~~~~~~~~~
a.cc:15:21: error: overloaded function with no contextual type information
   15 |       min=abs(a[i]-k);
      |                     ^
Language: C++

#include<algorithm>
#include<iostream>
using namespace std;
int main(){
int n,t,k,ans=0;
  cin>>n>>t>>k;
  long double a[n]min=100000000;
  for(int i=0;i<n;i++){
    int s;
    cin>>s;
    a[i]=t-s*0.006;
  }
  for(int i=0;i<n;i++){
    if(min>abs(a[i]-k)){
      min=abs(a[i]-k);
      ans=i;
  }
  }
  cout<<ans<<endl;
    return 0;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:7:19: error: expected initializer before 'min'
    7 |   long double a[n]min=100000000;
      |                   ^~~
a.cc:11:5: error: 'a' was not declared in this scope
   11 |     a[i]=t-s*0.006;
      |     ^
a.cc:14:16: error: 'a' was not declared in this scope
   14 |     if(min>abs(a[i]-k)){
      |                ^
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); ++i)
using namespace std;
int main() {
  int n;
  cin >> n;
  int t,a;
  cin >> t >> a;
  vector<int>h(n);
  rep(i,n) cin >> h[i];
  int findID=-1;
  double res=1000.0;
  rep(i,n) {
    double x=t-6.0*h[i]/1000.0;
    double d=max(x-a,a-x);
    if(res>d[i]) {
      res=d[i];
      findID=i;
    }
  }
  cout << findID << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: invalid types 'double[int]' for array subscript
   16 |     if(res>d[i]) {
      |             ^
a.cc:17:12: error: invalid types 'double[int]' for array subscript
   17 |       res=d[i];
      |            ^
Language: C++

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

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

    

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'H' was not declared in this scope
   11 |     int mn=T-H[0]*0.006;
      |              ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,T,A;
  cin>>N>>T>>A;
  vector<int> B(N);
  vector<double> a(N);
  double b=1000;

  for(int i=0;i<N;i++){
  cin>>B[i];
     a[i]=T-B[i]*0.006;
     b=min(b,abs(A-a[i]));
  
  }
  
cout<<b<<endl;
  }
}


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

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,T,A;
  cin>>N>>T>>A;
  vector<int> B(N);
  vector<double> a(N);
  double b=1000;

  for(int i=0;i<N;i++){
  cin>>B[i];
    int a[i]=T-B[i]*0.006;
     b=min(b,abs(A-a[i]));
  
  }
  
cout<<b<<endl;
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: array must be initialized with a brace-enclosed initializer
   12 |     int a[i]=T-B[i]*0.006;
      |              ~^~~~~~~~~~~
a.cc:13:11: error: no matching function for call to 'min(double&, int)'
   13 |      b=min(b,abs(A-a[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:13:11: note:   deduced conflicting types for parameter 'const _Tp' ('double' and 'int')
   13 |      b=min(b,abs(A-a[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:13:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'double'
   13 |      b=min(b,abs(A-a[i]));
      |        ~~~^~~~~~~~~~~~~~~
a.cc: At global scope:
a.cc:19:1: error: expected declaration before '}' token
   19 | }
      | ^