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

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


int main() {

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: expected initializer before 'double'
   10 |     double t, a;
      |     ^~~~~~
a.cc:11:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   11 |     cin >> n >> t >> a;
      |            ^
      |            yn
a.cc:11:17: error: 't' was not declared in this scope; did you mean 'tm'?
   11 |     cin >> n >> t >> a;
      |                 ^
      |                 tm
a.cc:11:22: error: 'a' was not declared in this scope
   11 |     cin >> n >> t >> a;
      |                      ^
Language: C++

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

int main (){
	
	int n,t,a,h[1001],temp;

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

	cout << i <<endl;

	return 0;
}

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

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main() {
	int N, T, A;
	cin >> N >> T >> A;
	vector<int>H(N);
	int ans = A + 10000;
	int num = 0;
	rep(i, n) {
		cin >> H[i];
		int temp = T - 0.006 * H[i];
		if (abs(ans - A) >= abs(temp - A)) {
			ans = temp;
			num = i+1;
		}
	}
	cout << num << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:16: error: 'n' was not declared in this scope
   15 |         rep(i, n) {
      |                ^
a.cc:2:31: note: in definition of macro 'rep'
    2 | #define rep(i,n)for(int i=0;i<n;++i)
      |                               ^
Language: C++

#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

int main() {
	int N, T, A;
	cin >> N >> T >> A;
	vector<int>H(n);
	int ans = A + 10000;
	int num = 0;
	rep(i, n) {
		cin >> H[i];
		int temp = T - 0.006 * H[i];
		if (abs(ans - A) >= abs(temp - A)) {
			ans = temp;
			num = i+1;
		}
	}
	cout << num << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: 'n' was not declared in this scope
   12 |         vector<int>H(n);
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

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

	int i, j, k, n, id;
	long double t, a, h, x, best;
	pair<long double, int> best = { 1E10, -1 };
	cin >> n >> t >> a;
	for (i = 1; i <= n; i++) {
		cin >> h;
		x = abs(a - (t - h * 0.006));
		if (x < best) {
			best = x;
			id = i;
		}
	}
	cout << id << "\n";


	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:32: error: conflicting declaration 'std::pair<long double, int> best'
   28 |         pair<long double, int> best = { 1E10, -1 };
      |                                ^~~~
a.cc:27:33: note: previous declaration as 'long double best'
   27 |         long double t, a, h, x, best;
      |                                 ^~~~
Language: C++

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

const double adjust = 0.006;

int main() {
	int n, t, a; cin >> n >> t >> a;
	vector<int>h(n); for (auto&& x : h)cin >> x;

	double ans = 0, tmp, pre = 1e9;
	for (int i = 0; i < n; i++) {
		tmp = t - h[i] * adjust;
		if (fabs(a - pre) > fabs(a - tmp)) {
			pre = tmp;
			ans = i + 1;
		}
	}
	cout << ans << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   15 |                 if (fabs(a - pre) > fabs(a - tmp)) {
      |                     ^~~~
      |                     labs
Language: C++

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

int main ()
{
  int N ,T ,A ;
 vector<int> H (100000)
cin >> N >>T >> A ;
int res =0;
int cc = 100000;
for ( int i =1; i <= N ; i ++)
{
cin >> H.at(i);
int d =( T *1000 - H.at(i) *6) - A *1000;
if (d <0) d = - d ;
if ( cc > d ) cc =d , res = i ;
}
cout << res << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:1: error: expected ',' or ';' before 'cin'
    8 | cin >> N >>T >> A ;
      | ^~~
Language: C++

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

int main ()
{
  int N ,T ,A ;
 vector<int> H (1000);
cin >> N >>T >> A ;
int res =0;
int cc = 1 << 30
for ( int i =1; i <= N ; i ++)
{
cin >> H.at(i);
int d =( T *1000 - H.at(i) *6) - A *1000;
if (d <0) d = - d ;
if ( cc > d ) cc =d , res = i ;
}
cout << res << endl;

}

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


#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n
  double  t , a , df ;
  cin >> n >> t >> a  ;
  
  vector<double> h(n) ;
  for(int i=0;i<n;i++) 
    cin >> h[i] ;
  

   int ind = 0;
   df = abs(a-(t - h[0]*0.006)) ;
   
  for(int i=0;i<n;i++){
      if(df>abs(a-(t - h[i]*0.006))){
        df = abs(a-(t - h[i]*0.006)) ;
        ind = i ;
      }
  }

  cout << ind << endl ;
  
  return 0 ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: expected initializer before 'double'
    9 |   double  t , a , df ;
      |   ^~~~~~
a.cc:10:10: error: 'n' was not declared in this scope; did you mean 'yn'?
   10 |   cin >> n >> t >> a  ;
      |          ^
      |          yn
a.cc:10:15: error: 't' was not declared in this scope; did you mean 'tm'?
   10 |   cin >> n >> t >> a  ;
      |               ^
      |               tm
a.cc:10:20: error: 'a' was not declared in this scope
   10 |   cin >> n >> t >> a  ;
      |                    ^
a.cc:18:4: error: 'df' was not declared in this scope
   18 |    df = abs(a-(t - h[0]*0.006)) ;
      |    ^~
Language: C++


#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  double n, t , a , df;
  cin >> n >> t >> a  ;
  
  vector<double> h(n) ;
  for(int i=0;i<n;i++) 
    cin >> h[i] ;
  

   int ind = 0;
  
  for(int i=0;i<n;i++){
    if(i==0){
       df = abs(a-(t - h[i]*0.006)) ;
    }else{
      if(df>abs(a-(t - h[i]*0.006))){
        df = abs(a-(t - h[i]*0.006)) ;
        ind = i ;
      }
    }

  cout << ind << endl ;
  
  return 0 ;
}

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

#include <string>
#include <map>
#include <stdio.h>
#include <cmath>
#include <vector>  

using namespace std;

int N;
int T, A;
int H[1000000];
int FLG;
int absoluteTemp;

int main() {
    cin >> N;
    cin >> T >> A;
    for(int i = 0; i < N; ++i) cin >> H[i];
    FLG = 0;
    int fuga = T - H[FLG] * 0.006;
    absoluteTemp = abs(T -fuga);
    for(int i = 0; i < N; ++i){
        int iii = T - H[i] * 0.006;
        int ddd = abs(T - iii);
        if(ddd < absoluteTemp){
            FLG = i;
            int yyy = T - H[i] * 0.006;
            absoluteTemp = abs(T - yyy);
        }
    }
    int res = FLG + 1;
    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'cin' was not declared in this scope
   16 |     cin >> N;
      |     ^~~
a.cc:6:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    5 | #include <vector>
  +++ |+#include <iostream>
    6 | 
a.cc:32:5: error: 'cout' was not declared in this scope
   32 |     cout << res << endl;
      |     ^~~~
a.cc:32:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:20: error: 'endl' was not declared in this scope
   32 |     cout << res << endl;
      |                    ^~~~
a.cc:6:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    5 | #include <vector>
  +++ |+#include <ostream>
    6 |
Language: C++

#include <iostream>
#include <string>
using namespace std;
int main(){
    int i,n,t,a,position;
    cin >> n >> t >> a;
    int h[n];
    double df[n]，test=1000000;
    for(i=0;i<n;i++){
        cin >> h[i];
        df[i] = t-h[i]*0.006-a;
        if(df[i]<0){
            df[i] = -df[i];
        }
    }
    for(i=0;i<n;i++){
        if(df[i]<test){
            test = df[i];
            position = i+1;
        }
    }
    cout << position;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:17: error: expected initializer before '\U0000ff0ctest'
    8 |     double df[n]，test=1000000;
      |                 ^~~~~~
a.cc:11:9: error: 'df' was not declared in this scope
   11 |         df[i] = t-h[i]*0.006-a;
      |         ^~
a.cc:17:12: error: 'df' was not declared in this scope
   17 |         if(df[i]<test){
      |            ^~
a.cc:17:18: error: 'test' was not declared in this scope
   17 |         if(df[i]<test){
      |                  ^~~~
Language: C++

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

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 h[n];
      |                  ^
a.cc:8:18: error: could not convert 'n' from 'double' to 'long unsigned int'
    8 |         double h[n];
      |                  ^
      |                  |
      |                  double
a.cc:8:18: error: size of array 'h' has non-integral type 'double'
a.cc:13:18: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   13 |         double b[n];
      |                  ^
a.cc:13:18: error: could not convert 'n' from 'double' to 'long unsigned int'
   13 |         double b[n];
      |                  ^
      |                  |
      |                  double
a.cc:13:18: error: size of array 'b' has non-integral type 'double'
Language: C++

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

int main() {
  
  int N;
  int T;
  int A;
  
  cin >> N;
  cin >> T >> A;
  
  vector<int> H(N);
  
  int num;
  int num2;
  int num3 = -1e7;
  int num4 = 0;
  
  for(int i = 0;i < N;++i){
    cin >> H[i];
  }
  
  for(int i = 0;i < N;++i){
    num = T - (H[i] * 0.006);
    num2 = abs(A - num2);
    num3 = min(nun3,num2);
  }
  
  for(int i = 0;i < N;++i){
    num++;
    if(num3 == H[i]){
      cout << num;
      break;
    }
  }
      
}




Compiler output:
a.cc: In function 'int main()':
a.cc:28:16: error: 'nun3' was not declared in this scope; did you mean 'num3'?
   28 |     num3 = min(nun3,num2);
      |                ^~~~
      |                num3
Language: C++

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

int main(){
    //input
    int n,t,a;
    cin >> n >> t >> a;
    int index = 0;
    double h;
    cin >> h;
    double m = t - h * 0.006;
    for(int i = 2;i<=n;i++){
        cin >> h;
        double z,
        z = t - h * 0.006;
        if(m >= abs(a-z)){
            m = abs(a-z);
            index = i;
        }
    }
    cout << index<< endl; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: redeclaration of 'double z'
   15 |         z = t - h * 0.006;
      |         ^
a.cc:14:16: note: 'double z' previously declared here
   14 |         double z,
      |                ^
Language: C++

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

int minElement(const int* array, size_t size)
{
    int x=0;
    assert(array != NULL);
    assert(size >= 1);

    int min = array[0];
    for (size_t i = 0; i < size; ++i) {
        if (min > array[i]) {
            min = array[i];
            x = i;
        }
    }

    return x;
}


int main(void){
    int n;
    int a;
    int t;
    int h[1000];
    float b[1000];

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

    for(int i = 0; i < n; i++){
        b[i] = fabsf(a - (t - h[i] * 0.006));
    }

    printf("%d\n", minElement(b, n)+1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:31: error: cannot convert 'float*' to 'const int*'
   41 |     printf("%d\n", minElement(b, n)+1);
      |                               ^
      |                               |
      |                               float*
a.cc:5:27: note:   initializing argument 1 of 'int minElement(const int*, size_t)'
    5 | int minElement(const int* array, size_t size)
      |                ~~~~~~~~~~~^~~~~
Language: C++

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

int minElement(const int* array, size_t size)
{
    int x=0;
    assert(array != NULL);
    assert(size >= 1);

    int min = array[0];
    for (size_t i = 0; i < size; ++i) {
        if (min > array[i]) {
            min = array[i];
            x = i;
        }
    }

    return x;
}


int main(void){
    int n;
    int a;
    int t;
    int h[1000];
    double b[1000];

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

    for(int i = 0; i < n; i++){
        b[i] = abs(a - (t - h[i] * 0.006));
    }

    printf("%d\n", minElement(b, n)+1);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:31: error: cannot convert 'double*' to 'const int*'
   41 |     printf("%d\n", minElement(b, n)+1);
      |                               ^
      |                               |
      |                               double*
a.cc:5:27: note:   initializing argument 1 of 'int minElement(const int*, size_t)'
    5 | int minElement(const int* array, size_t size)
      |                ~~~~~~~~~~~^~~~~
Language: C++

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

int int_len(int n) {
  int s=0;
  while(n!=0) s++, n/=10;
  return s;
}

int int_sum(int n) {
  int m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(int i=s-1;i>=0;i--) m+=n/((int)pow(10,i))-(n/((int)pow(10,i+1)))*10;
  return m;
}

int vec_sum(vector<int> v){
  int n=0;
  for(int i=0;i<v.size();i++) n+=v[i];
  return n;
}

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


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

#include <iostream>

using namespace std;

int main()
{
	int N;
	int T, A;
	int target, diff, diff_min = INT_MAX;
	int ret = 1;

	cin >> N;
	cin >> T >> A;

	int* H = new int[N];
	for (int i = 0; i < N; i++) cin >> H[i];

	target = 500 * (T - A) / 3;

	for (int i = 0; i < N; i++) {
		diff = abs(target - H[i]);
		if (diff < diff_min) {
			diff_min = diff;
			ret = i + 1;
		}
	}

	delete[] H;

	cout << ret << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:38: error: 'INT_MAX' was not declared in this scope
    9 |         int target, diff, diff_min = INT_MAX;
      |                                      ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 |
Language: C

#include <stdio.h>
int main(void){
  int n;
  int t,a,count;
  double max;
  int maxchiten=0;
  double h[1000];
  scanf("%d",&n);
  scanf("%d",&t);
    scanf("%d",&a);
  for(count=0;count<=n-1;count++){
    scanf("%lf",&h[count]);
  }
  max=h[0];
   for(count=0;count<=n-1;count++){
     if(max>h[count]){max=h[count];maxcount=count;}
  }
  printf("%d",maxcount);
  return 0;
  
}

Compiler output:
main.c: In function 'main':
main.c:16:36: error: 'maxcount' undeclared (first use in this function); did you mean 'count'?
   16 |      if(max>h[count]){max=h[count];maxcount=count;}
      |                                    ^~~~~~~~
      |                                    count
main.c:16:36: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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

double temp(int t,int x){
  return T-x*0.006;
}

int main(){
  int N;cin>>N;
  int T,A;cin>>T>>A;
  vector<int>H(N,0);
  for (int i=0;i<N;++i){
    cin>>H[i];
  }
  
  int ans=0;//何番目の地点、最後に足す１
  double tmp0=100;//仮の温度
  double tmp1=100;//本当の温度
  for (int i=0;i<N;++i){
    tmp1=temp(T,H[i]);
    if (abs(tmp1-A)<abs(tmp0-A)){
      ans=i;
      tmp0=tmp1;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'double temp(int, int)':
a.cc:8:10: error: 'T' was not declared in this scope
    8 |   return T-x*0.006;
      |          ^
Language: Java

import java.util.*;
import java.lang.Math.*;
 
public class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int temperature = sc.nextInt();
        int average = sc.nextInt();
        int result = 1;
        int resultAbs = Math.abs(average - sc.nextInt() * 0.006);
        for (int i = 1; i < n; i++) {
            int abs = Math.abs(average - sc.nextInt() * 0.006);
            if (resultAbs >= abs) {
                result = i;
            }
        }
        System.out.println(result);
    }
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from double to int
        int resultAbs = Math.abs(average - sc.nextInt() * 0.006);
                                ^
Main.java:13: error: incompatible types: possible lossy conversion from double to int
            int abs = Math.abs(average - sc.nextInt() * 0.006);
                              ^
2 errors
Language: C++

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define ifaxb(a, x, b) if (a < x && x < b)  // 比較は昇順
#define toInt(x) (x - '0')
#define vi vector<int>
#define vii vector<vi>
#define vs vector<string>
#define vss vector<vs>
#define all(x) x.begin(), x.end()
#define ff first
#define ss second
#define pq priority_queue
#define ipair pair<int, int>
#define spair pair<string, string>
#define lpair pair<LL, LL>
#define MP make_pair
#define MM multimap
#define PB push_back
#define INF 2147483647
#define _INF -2147483647
#define pi 3.1415926536
#define MAXN 100004
using namespace std;
typedef long long ll;

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

  int min = INF;
  int ans = 0;
  rep(i, N) {
    int H;
    cin >> H;
    int diff = abs(A * 1000 - (T * 1000 - H * 6)e);
    if (diff < min) {
      min = diff;
      ans = i + 1;
    }
  }
  cout << ans << endl;

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:49: error: expected ')' before 'e'
   38 |     int diff = abs(A * 1000 - (T * 1000 - H * 6)e);
      |                   ~                             ^
      |                                                 )
Language: C++

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

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


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

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

// int a, b, c, x;

// int main (){
//     cin >> a >> b >> c;

//     x = (b+c) - a;

//     if(x < 0){
//         cout << 0;
//     } else {
//         cout << x;
//     }

    
// }

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

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


int main (){

    long long x = 2147483647;
    cin >> n;
    cin >> t >> a;
    for(int i = 1; i<n; i++) {
        cin >> h[i];
        if (abs(a-(t-0.006*h[i])) > abs(a-(t-0.006*h[z]))) z = i;
    }


    cout << z+1;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:53: error: invalid types 'int [100005][double]' for array subscript
   34 |         if (abs(a-(t-0.006*h[i])) > abs(a-(t-0.006*h[z]))) z = i;
      |                                                     ^
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);
  for(int i=0; i<N; i++){
    cin >> H.at(i);
  }
  double min=fabs(T-H.at(0)*0.006-A)
  double tmp=0;
  int ans;
  for(int i=0; i<N; i++){
    tmp=T-H.at(i)*0.006;
    double x=fabs(A-tmp);
    if(min>x){
      min=x;
      ans=i;
    }
  }
  cout << ans+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:3: error: expected ',' or ';' before 'double'
   14 |   double tmp=0;
      |   ^~~~~~
a.cc:17:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   17 |     tmp=T-H.at(i)*0.006;
      |     ^~~
      |     tm
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);
  for(int i=0; i<N; i++){
    cin >> H.at(i);
  }
  double min=fabs(T-H.at(0)*0.006-a)
  double tmp=0;
  int ans;
  for(int i=0; i<N; i++){
    tmp=T-H.at(i)*0.006;
    double x=fabs(A-tmp);
    if(min>x){
      min=x;
      ans=i;
    }
  }
  cout << ans+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:35: error: 'a' was not declared in this scope
   13 |   double min=fabs(T-H.at(0)*0.006-a)
      |                                   ^
a.cc:17:5: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   17 |     tmp=T-H.at(i)*0.006;
      |     ^~~
      |     tm
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: 'rem' was not declared in this scope; did you mean 'tem'?
   16 |             min = fabs(rem - a);
      |                        ^~~
      |                        tem
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  double tmp, gap = 1e3; int H, N, T, A, index;cin>>N>>T>>A;
  for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
  cout<<i+1<<endl;
}


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

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  double tmp gap = 1e3; int H, N, T, A, index;cin>>N>>T>>A;
  for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
  cout<<i+1<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:14: error: expected initializer before 'gap'
    5 |   double tmp gap = 1e3; int H, N, T, A, index;cin>>N>>T>>A;
      |              ^~~
a.cc:6:31: error: 'tmp' was not declared in this scope; did you mean 'tm'?
    6 |   for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
      |                               ^~~
      |                               tm
a.cc:6:63: error: 'gap' was not declared in this scope
    6 |   for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
      |                                                               ^~~
a.cc:7:9: error: 'i' was not declared in this scope
    7 |   cout<<i+1<<endl;
      |         ^
Language: C++

#include<iostream>
#include<cmath>
using namespace std;
int main(){
  double tmp, H, N, T, A;cin>>N>>T>>A;int index = 0;double gap = 110.0;
  for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
  cout<<i+1<<endl;
}


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

#include<iostream>
using namespace std;
int main(){
  double tmp, H, N, T, A;cin>>N>>T>>A;int index = 0;double gap = 110.0;
  for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
  cout<<i+1<<endl;
}


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

#include<iostream>
using namespace std;
int main(){
  int tmp, H, N, T, A;cin>>N>>T>>A;int index = 0;int gap = 110;
  for(int i=0;i<N;i++){cin>>H;tmp = abs(A-(T-H*0.006));if(tmp<gap){gap=tmp;index=i;}}
  cout<<i+1<<endl;
}

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

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <queue>
#include <tuple>
#include <cmath>
typedef long long ll;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define mod 1000000007

const int INF = 1e9;

int main(){
	int N;
	double T,A;
	cin >> N >> T >> A;
	int ans = 0;
	double X = 100000.0;
	double H;
	for(int i = 0; i < N; i++){
		cin >> H;
		double temp = fabs(A-(T-(H*0.006));
		if(temp < X){
			X = temp;
			ans++;
		}
	}
	cout << ans << endl;
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:25:51: error: expected ')' before ';' token
   25 |                 double temp = fabs(A-(T-(H*0.006));
      |                                   ~               ^
      |                                                   )
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(), (c).end());
const long long MOD = 1e9 + 7;
typedef long long ll;

int main(){
	int N;
	double T, A;
	double D = 0.006;
	int ans;
	int MINdis = 1e8;
	cin >> N >> T >> A;
	vector<double> H(N);
	rep(i, N){
		cin >> H[i];
		H[i] = T - H[i] * D;
		if(MINdis > H[i].second)ans = i + 1;
	}
	cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:34: error: request for member 'second' in 'H.std::vector<double>::operator[](((std::vector<double>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type' {aka 'double'}
   20 |                 if(MINdis > H[i].second)ans = i + 1;
      |                                  ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(), (c).end());
const long long MOD = 1e9 + 7;
typedef long long ll;

int main(){
	int N, T, A;
	cin >> N >> T >> A;
	double D = 0.006;
	int ans = 1e8;
	vector<double> H(N);
	rep(i, N){
		cin >> H[i];
		H[i] = T - H[i] * D;
		ans = min(ans, abs(H[i] - A));
	}
	cout << ans << endl;
}

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

import java.util.*;

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();
        double min = Double.MAX_VALUE;
        int ans = 0;
        for(int i = 1;i <= n;i++){
            double tpr = Math.abs(a-(t - sc.nextInt()*0.006));
            if(min > tpr){
                min = sa;
                ans = i;
            }
        }
        System.out.println(ans);
    }
}


Compiler output:
Main.java:14: error: cannot find symbol
                min = sa;
                      ^
  symbol:   variable sa
  location: class Main
1 error
Language: C++

#include<iostream>
using namespace std ;

int main(){
  int H[1010] ;
  int N,T,A,h ;
  double abs_temperature[1010] ;
 	
  int i,j ;
  
  cin >> N ;
  cin >> T >> A ;
  
  for(i=0; i<N; i++){
    cin >> H[i] ;
  }
  
  for(i=0; i<N; i++){
    abs_temperature[i] = fabs(A- T + 0.06*H[i]) ;
  }
  
  j=0
  
  for(i=0; i<N; i++){
    if(abs_temperature[j]>abs_temperature[i]) j = i ;
  }
  
  cout << j << endl;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:26: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   19 |     abs_temperature[i] = fabs(A- T + 0.06*H[i]) ;
      |                          ^~~~
      |                          labs
a.cc:22:6: error: expected ';' before 'for'
   22 |   j=0
      |      ^
      |      ;
   23 | 
   24 |   for(i=0; i<N; i++){
      |   ~~~ 
a.cc:24:20: error: expected ';' before ')' token
   24 |   for(i=0; i<N; i++){
      |                    ^
      |                    ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define SZ(x) ((int)(x).size())
#define INF 999999999
typedef long long int Int;
using ll = long long;
using VI = vector<int>;

signed main(){
  Int n,t,a;
  vector<Int> h(n);
  for(Int i=0;i<n;i++) cin >> h[i];
  t*=1000;a*=1000;
  auto calc=[&](Int x){return abs((t-x*6)-a);};
  Int anss = 0;
  for(Int i=0;i<n;i++){
    if(calc(h[i]<calc(h[ans]))) ans = i;
  }
  cout << ans+1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:25: error: 'ans' was not declared in this scope; did you mean 'anss'?
   20 |     if(calc(h[i]<calc(h[ans]))) ans = i;
      |                         ^~~
      |                         anss
a.cc:22:11: error: 'ans' was not declared in this scope; did you mean 'anss'?
   22 |   cout << ans+1 << endl;
      |           ^~~
      |           anss
Language: C

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

int main() {
  int N,T,A;
  scanf("%d", &N);
  scanf("%d %d",&T,&A);
  int H[1100];
  int i;

  for (i = 0; i < N; i++) {
    scanf("%d", &H[i]);
  }

  //地点iの平均気温
  double temp[110];
  for (i = 0; i < N; i++) {
    temp[i] = T - H[i] * 0.006;
  }

  //地点iの平均気温とAの差
  double sa[1100];
  for (i = 0; i < N; i++) {
    sa[i] = A - temp[i];
    if (sa[i] < 0) {
      sa[i] = -sa[i];
    }
  }

  double min = sa[0];
  int k = 0;

  //sa[i]が最小となるようなiを求める。
  for (i = 0; i < N; i++) {
    if (sa[i] <= min) {
      answer = sa[i];
      k = i;
    }
  }

  printf("%d\n", k + 1);

}


Compiler output:
main.c: In function 'main':
main.c:37:7: error: 'answer' undeclared (first use in this function)
   37 |       answer = sa[i];
      |       ^~~~~~
main.c:37:7: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n = sc,nextInt();
      int t = sc.nextInt();
      int a = sc.nextInt();
      int[] h = new int[n];
      double[] temp = new double[n];
      double min = 1000000;
      for(int i = 0;i < n;i++){
      	h[i] = sc.nextInt();
        temp[i] = t-h[i]*0.006;
        min = Math.min(min,Math.abs(temp[i]-a));
      }
      for(int i = 0;i < n;i++){
      	if(min == Math.abs(temp[i]-a)) System.out.println(i+1);
      }
    }
}


Compiler output:
Main.java:5: error: ';' expected
      int n = sc,nextInt();
                        ^
1 error
Language: Java

import java.util.*;
public class Main{
	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
      int n=sc,nextInt(),t=sc.nextInt(),a=sc.nextInt();
      int[] h = new int[n];
      double[] temp = new double[n];
      double min = 1000000;
      for(int i = 0;i < n;i++){
      	h[i] = sc.nextInt();
        temp[i] = t-h[i]*0.006;
        min = Math.min(min,Math.abs(temp[i]-a));
      }
      for(int i = 0;i < n;i++){
      	if(min == Math.abs(temp[i]-a)) System.out.println(i+1);
      }
    }
}

Compiler output:
Main.java:5: error: ';' expected
      int n=sc,nextInt(),t=sc.nextInt(),a=sc.nextInt();
                      ^
Main.java:5: error: ';' expected
      int n=sc,nextInt(),t=sc.nextInt(),a=sc.nextInt();
                                       ^
2 errors
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int n, t, a; cin >> n >> t >> a;
    int ans;
    int Min = INT_MAX;
    rep(i,n) {
        int h; cin >> h;
        h = t-h*0.006; // 平均気温
        int Abs = abs(h-a);
        if (Abs < Min)
        {
            Min = Abs;
            ans = i;
        }
    }
    cout << ++ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:15: error: 'INT_MAX' was not declared in this scope
   17 |     int Min = INT_MAX;
      |               ^~~~~~~
a.cc:10:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    9 | #include <map>
  +++ |+#include <climits>
   10 | using namespace std;
Language: C++

    #include<iostream>
    #include<stdlib>
    using namespace std;
    int main(){
      int n,t,a,h,d,min=100000000,p=0;
      cin>>n>>t>>a;
      for(int i=1;i<=n;i++){
        cin>>h;
        d=abs(a-(t-h*0.006));
        if(d<min){
          min=d;
          p=i;
        }
      }
        cout<<p;


  }


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

    #include<iostream>
    using namespace std;
    int main(){
      int n,t,a,h,d,min=100000000,p=0;
      cin>>n>>t>>a;
      for(int i=1;i<=n;i++){
        cin>>h;
        h[i]=t-h*0.006;
        d=h-a;
        if(d<0) d*=-1;
        if(d<min){
          min=d;
          p=i;
        }
      }
        cout<<p;


  }


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

#include <iostream>
#include <stdlib.h>
#include <math.h>

using namespace std;


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

  int i
  double l;
  double h[n];
  for (i=0; i<n; i++){
    cin >> l;
    h[i] = fabs((t - 0.006 * l) - a);
  }

  int min_h = h[0], point=1;
  for (i=1; i<n; i++){
    if (h[i] < min_h){
      min_h = h[i];
      point = i+1;
    }
  }
  cout << point << "\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: expected initializer before 'double'
   16 |   double l;
      |   ^~~~~~
a.cc:18:8: error: 'i' was not declared in this scope
   18 |   for (i=0; i<n; i++){
      |        ^
a.cc:19:12: error: 'l' was not declared in this scope
   19 |     cin >> l;
      |            ^
a.cc:24:8: error: 'i' was not declared in this scope
   24 |   for (i=1; i<n; i++){
      |        ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[N];
int main(void)
{
  int n;
  double a,t;
  cin>>n>>t>>a;
  int index;
  double mn = INT_MAX;
  for(int i = 0; i < n; ++i)
  {
    cin>>a[i];
    if(mn>a-(t-a[i]*0.006))
    {
      mn = a-(t-a[i]*0.006);
      index = i;
    }
  }
  cout<<index;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: invalid types 'double[int]' for array subscript
   14 |     cin>>a[i];
      |           ^
a.cc:15:17: error: invalid types 'double[int]' for array subscript
   15 |     if(mn>a-(t-a[i]*0.006))
      |                 ^
a.cc:17:18: error: invalid types 'double[int]' for array subscript
   17 |       mn = a-(t-a[i]*0.006);
      |                  ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[N];
int main(void)
{
  int n;
  double a,t;
  cin>>n>>t>>a;
  int index;
  double mn = INT_MAX;
  for(int i = 0; i < n; ++i)
  {
    cin>>a[i];
    if(mn>a-(t-a[i]*0.006))
    {
      mn = a-(t-a[i]*0.006);
      index = i;
    }
  }
  cout<<index;
}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: invalid types 'double[int]' for array subscript
   14 |     cin>>a[i];
      |           ^
a.cc:15:17: error: invalid types 'double[int]' for array subscript
   15 |     if(mn>a-(t-a[i]*0.006))
      |                 ^
a.cc:17:18: error: invalid types 'double[int]' for array subscript
   17 |       mn = a-(t-a[i]*0.006);
      |                  ^
a.cc: At global scope:
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: 'i' was not declared in this scope
   12 |   int sa =  (T - H[i] * 0.006 - A) * (T - H[i] * 0.006 - A);
      |                    ^
Language: C++

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

int N,T,A:
int H[1010];

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

Compiler output:
a.cc:4:10: error: expected initializer before ':' token
    4 | int N,T,A:
      |          ^
a.cc: In function 'int main()':
a.cc:8:20: error: 'A' was not declared in this scope
    8 |   cin >> N >> T >> A;
      |                    ^
a.cc:9:35: error: 'H' was not declared in this scope
    9 |   for(int i = 0; i<N; i++) cin >> H[i];
      |                                   ^
a.cc:12:18: error: 'H' was not declared in this scope
   12 |   int sa =  (T - H[i] * 0.006 - A) * (T - H[i] * 0.006 - A);
      |                  ^
a.cc:12:20: error: 'i' was not declared in this scope
   12 |   int sa =  (T - H[i] * 0.006 - A) * (T - H[i] * 0.006 - A);
      |                    ^
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++){
    cin >> vec[i];
    vec[i] = (1000*t - vec[i]*6)-1000*a;
    if(vec[i] < 0){
        vec[i] = -1*vec[i];
    }
}
int min = vec[0];
for(int i=0;i<n;i++){
    if(min > vec[i]){
        min = vec[i];
    }
}
min = i;
cout << i << endl;




Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'vec' was not declared in this scope
    7 |     cin >> vec[i];
      |            ^~~
a.cc:13:11: error: 'vec' was not declared in this scope
   13 | int min = vec[0];
      |           ^~~
a.cc:19:7: error: 'i' was not declared in this scope
   19 | min = i;
      |       ^
a.cc:20:19: error: expected '}' at end of input
   20 | cout << i << endl;
      |                   ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

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

  int n,t,a;
  cin >> n >> t >> a;
  
  vector<double> v;
  int m;
  double temp;
  for(int i = 0; i < n; i++){
    cin >> m;
    temp = t - inData * 0.006;
    v.push_back(fabs(temp));
  }
  
  auto iter = min_element(v.begin(), v.end());
  size_t index = distance(v.begin(), iter);

  cout << index + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: 'inData' was not declared in this scope
   19 |     temp = t - inData * 0.006;
      |                ^~~~~~
Language: C++

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

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

  int n,t,a;
  cin >> n >> t >> a;
  
  vector<double> v;
  int inData;
  double absData;
  for(int i = 0; i < n; i++){
    cin >> inData;
    absData = fabs(t - inData * 0.006);
    v.push_back(absData);
  }
  
  auto iter = min_element(v.begin(), v.end());
  size_t index = distance(v.begin(), iter);

  cout << index + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   18 |     absData = fabs(t - inData * 0.006);
      |               ^~~~
      |               labs
Language: C++

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

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

  int n,t,a;
  cin >> n >> t >> a;
  
  vector<double> v;
  int inData;
  double absData;
  for(int i = 0; i < n; i++){
    cin >> inData;
    absData = fabs(t - inData * 0.006)
    v.push_back(absData);
  }
  
  auto iter = min_element(v.begin(), v.end());
  size_t index = distance(v.begin(), iter);

  cout << index + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:15: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   18 |     absData = fabs(t - inData * 0.006)
      |               ^~~~
      |               labs
Language: C++

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

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

  int n,t,a;
  cin >> n >> t >> a;
  
  vector<double> v;
  int data;
  for(int i = 0; i < n; i++){
    cin >> inData;
    absData = fabs(t - inData * 0.006)
    v.push_back(absData);
  }
  
  auto iter = min_element(v.begin(), v.end());
  size_t index = distance(v.begin(), iter);

  cout << index + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:16:12: error: 'inData' was not declared in this scope; did you mean 'data'?
   16 |     cin >> inData;
      |            ^~~~~~
      |            data
a.cc:17:5: error: 'absData' was not declared in this scope
   17 |     absData = fabs(t - inData * 0.006)
      |     ^~~~~~~
a.cc:17:15: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   17 |     absData = fabs(t - inData * 0.006)
      |               ^~~~
      |               labs
Language: C++

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

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

  int n,t,a;
  cin >> n >> t >> a;
  
  vector<double> v;
  int data;
  for(int i = 0; i < n; i++){
    cin >> data;
    v.push_back(fabs(t - data * 0.006));
  }
  
  auto iter = min_element(v.begin(), v.end());
  size_t index = distance(v.begin(), iter);

  cout << index + 1 << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:17: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   17 |     v.push_back(fabs(t - data * 0.006));
      |                 ^~~~
      |                 labs
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: 'h' cannot be used as a function
    9 |     cin>>h(i);
      |          ~^~~
a.cc:10:15: error: invalid types 'int[int]' for array subscript
   10 |     a =min(T-h[i]*0.006,T-h[i-1]*0.006);
      |               ^
a.cc:10:28: error: invalid types 'int[int]' for array subscript
   10 |     a =min(T-h[i]*0.006,T-h[i-1]*0.006);
      |                            ^
Language: C++

#include <bits/stdc++.h>
#define int int64_t
#define r(i, N) for(int i=0; i<N; i++);
using namespace std;
using pair = pair<int, int>;
using tup  = tuple<int, int, int>;
using vec  = vector<int>;
using vvec = vector<vec>;
const int INF = 100000000;
// " ", ' '

// プロトタイプ宣言
// int myfunc(int, vvec);

// グローバル変数
// int N, M;
// vvec data(N, vec(M));

// 関数：

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int N; cin >> N;
	int T, A; cin >> T >> A;
	vec H(N+1); r(i, N) cin >> H.at(i);

	double best_tmp=INF; int best_T;
	r(i, N) {
		double tmp = T-H.at(i)*0.006;
		if(best_tmp>abs(double(A)-tmp)) {
			best_tmp = abs(double(A)-tmp);
			best_T = i;
		}
	}

	cout << best_T+1 << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:41: error: 'i' was not declared in this scope
   27 |         vec H(N+1); r(i, N) cin >> H.at(i);
      |                                         ^