criyle/codenet-compile-errors huggingface dataset:
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); 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:39: error: 'i' was not declared in this scope
   27 |         vec H(N); r(i, N) cin >> H.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);
    for (int i=0;i<N;i++) {
        cin >> H.at(i);
    }
    double M;
    int cnt=0;
    int minnum = 100000;
    for (int i=0;i<N;i++) {
        double num=0;
        M = T - H.at(i) * 0.006;
        cout << M << endl;
        if (M>A) {
            num = M-A;
            cout << num << endl;
         } else {
             num = A-M;
             cout << num << endl;
        }
        if (num<minnum) {
            minnum = num;
            cnt = i+1;
        }
    }
    cout << cnt << endl;

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

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,cnt=0;
    int minnum = 100000;
    for (int i=0;i<N;i++) {
        int num=0;
        M = T - H.at(i) * 0.006;
        if (M>=A) {
            if (A<0) A*=-1; 
            num = M-A;
         } else {
            if (M<0) M*=-1; 
            num = A-M;
        }
        if (num<minnum) {
            minnum = num;
            cnt = i+1;
        }
    }
    cout << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N >> T >> A;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<int> H(N);
      |     ^~~~~~
a.cc:4:12: error: expected primary-expression before 'int'
    4 |     vector<int> H(N);
      |            ^~~
a.cc:6:16: error: 'H' was not declared in this scope
    6 |         cin >> H.at(i);
      |                ^
a.cc:12:17: error: 'H' was not declared in this scope
   12 |         M = T - H.at(i) * 0.006;
      |                 ^
a.cc:25:5: error: 'cout' was not declared in this scope
   25 |     cout << cnt << endl;
      |     ^~~~
a.cc:25:20: error: 'endl' was not declared in this scope
   25 |     cout << cnt << endl;
      |                    ^~~~
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,cnt=0;
    int minnum = 540;
    for (int i=0;i<N;i++) {
        int num=0;
        M = T - H.at(i) * 0.006;
        if (M>=A) {
            num = M-A;
         } else {
            num = A-M;
        }
        if (num<minnum) {
            minnum = num;
            cnt = i+1;
        }
    }
    cout << cnt << endl;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:16:16: error: expected ';' before 'ans'
   16 |       min = dif
      |                ^
      |                ;
   17 |         ans = i;
      |         ~~~
Language: C++

#include<iostream>

using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<int> a(N);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | 
a.cc:9:10: error: expected primary-expression before 'int'
    9 |   vector<int> a(N);
      |          ^~~
a.cc:10:37: error: 'a' was not declared in this scope
   10 |   for(int i = 0; i < N; i++) cin >> a[i];
      |                                     ^
a.cc:12:22: error: 'a' was not declared in this scope
   12 |   int min = A - (T - a[0] * 0.006);
      |                      ^
a.cc:16:16: error: expected ';' before 'ans'
   16 |       min = dif
      |                ^
      |                ;
   17 |         ans = i;
      |         ~~~     
a.cc:20:11: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |   cout << ans << endl;
      |           ^~~
      |           abs
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,t,a,h;cin>>n>>t>>a;
  vector<pair<double,int>>x(n);
  for(int i=0;i<n;i++){
    cin>>h;
    x.at(i).first=abs(t-h*0.006-a);
    x.at(i).second=i+1;
  }
  sort(x.begin(),x.end());
  cout<x.at(0).second<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:22: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   12 |   cout<x.at(0).second<<endl;
      |        ~~~~~~~~~~~~~~^~~~~~
Language: C++

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

int main(){
  int N, T, A;
  cin >> N >> T >> A;
  int H, i;
  float min;
  
  cin >> H;
  min = abs(A-T-H*0.006);
  i = 0;
  for(int j=1; j<N; j++){
    cin >> H;
    if(abs(A-T-H*0.006)<min){
      i=j;
      min = abs(A-T-H*0.006)
    }
  }
  
  
  cout << i+1 << endl;


  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:29: error: expected ';' before '}' token
   17 |       min = abs(A-T-H*0.006)
      |                             ^
      |                             ;
   18 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
#define debug(x) cerr << "\n" \
                      << #x << " = " << x << ".\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define print(xx) cout<<(xx)<<endl
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = ((1LL << 30) + (1LL << 29));
const ll MOD = 1000000007;


//=================================================
int N;
int T,A;
vector<int> H;


//=================================================
void input()
{
    cin>>N;
    cin>>T>>A;
    H = vector<int> (N);
    rep(i,N){cin>>H[i];}
}
//=================================================
void solve()
{
    vector<pair<int,long double>> temp(N);
    rep(i,N){
        temp[i].second = abs(A - T - H[i]*0.006);
        temp[i].first = i+1;
    }
    sort(temp.begin(),temp.end(),[](const pair<int,long double>& x, const pair& y){return x.second < y.second;});
    cout<<temp[0].first<<endl;
}
//=================================================
signed main()
{
  input();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:35:69: error: missing template argument list after 'std::pair'; template placeholder not permitted in parameter
   35 |     sort(temp.begin(),temp.end(),[](const pair<int,long double>& x, const pair& y){return x.second < y.second;});
      |                                                                     ^~~~~
      |                                                                          <>
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 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_pair.h:89:12: note: 'template<class _T1, class _T2> struct std::pair' declared here
   89 |     struct pair;
      |            ^~~~
a.cc: In lambda function:
a.cc:35:102: error: 'y' was not declared in this scope; did you mean 'yn'?
   35 |     sort(temp.begin(),temp.end(),[](const pair<int,long double>& x, const pair& y){return x.second < y.second;});
      |                                                                                                      ^
      |                                                                                                      yn
Language: C++

#include <bits/stdc++.h>

using namespace std;

template<class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return 1; } return 0; }

/* 1..10
 * rep:   0 1 2 3 4 5 6 7 8 9
 * reps:  1 2 3 4 5 6 7 8 9 10
 * rrep:  9 8 7 6 5 4 3 2 1 0
 * rreps: 10 9 8 7 6 5 4 3 2 1
 */
int h[1000];
int main(){
    int n, t,a;
    cin >> n>> t >>a;
    rep(i,n)cin >>h[i];
    int mxi = 0;
    double mn = 1 << 30;
    rep(i, n){
        if((abs(t-h[i] * 0.006)) < mn){
            mn = abs(t-(h[i] * 0.006));
            mxi = i;
        }
    }
    cout << mxi + 1 << endl;

}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'i' was not declared in this scope
   18 |     rep(i,n)cin >>h[i];
      |         ^
a.cc:18:5: error: 'rep' was not declared in this scope
   18 |     rep(i,n)cin >>h[i];
      |     ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int n,t,a,s,r=1e9,z;
  scanf("%d%d%d",&n,&t,&a);
  for(int i=0;i<n;i++){
    scanf("%d",&s);
    if(abs(1000*t-s*6-1000*a)<r){
      r=abs(1000*t-s*6-1000*a);
      z=i;
    }
  }
  printf("%d",i+1);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:15: error: 'i' undeclared (first use in this function)
   13 |   printf("%d",i+1);
      |               ^
main.c:13:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(){
  int n,t,a,s,r=1e9,z;
  scanf("%d%d%d",&n,&t,&a);
  for(int i=0;i<n;i++){
    scanf("%d",&s);
    if(abs(t-s*0.006)<r){
      r=abs(t-s*0.006);
      z=i;
    }
  }
  printf("%d",i+1);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:13:15: error: 'i' undeclared (first use in this function)
   13 |   printf("%d",i+1);
      |               ^
main.c:13:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<limits.h>
#define rep(i,n) for(ll i = 0; i < (ll)n; i++)
#define swap(a,b) a^=b;b^=a;a^=b;
#define chmax(a,b) {if(a < b) a = b;}
#define chmin(a,b) {if(a > b) a = b;}
using namespace std;
typedef long long ll;
ll gcd(ll, ll);
vector<bool> to_binary(int);
int sum(vector<int>);
int min(vector<int>);
int max(vector<int>);
ll nCr(ll n, ll r);

const ll INF = 1LL << 60;

typedef tuple<ll, ll> mtupl;

bool mycomp(mtupl x, mtupl y) {
	return get<1>(x) < get<1>(y);
}

vector<vector<ll>> memo;

ll get(int x, int y) {
	if (memo[x][y] != -1)
		return memo[x][y];

	if (x == 0) return 1;
	if (y < x) return 0;

	memo[x][y] = get(x, y - 1) + get(x - 1, y - 1);
	return memo[x][y];
}

ll mpow(ll a, ll b) {
	ll ans = 1;
	for (ll i = 0; i < b; i++) {
		ans *= a;
		ans %= 1000000007;
	}
	return ans;
}

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

int vsum(vector<int> v) {
	int res = 0;
	for (auto it = v.begin(); it != v.end(); it++)
		res += *it;
	return res;
}
int vmin(vector<int> v) {
	int min = INT32_MAX;
	for (auto it = v.begin(); it != v.end(); it++)
		min = std::min(min, *it);
	return min;
}
int vmax(vector<int> v) {
	int max = INT32_MIN;
	for (auto it = v.begin(); it != v.end(); it++)
		max = std::max(max, *it);
	return max;
}

ll gcd(ll A, ll B) {
	if (A == 0 || B == 0) return max(A, B);
	int r = A % B;
	while (r != 0) {
		A = B;
		B = r;
		r = A % B;
	}

	return B;
}

vector<bool> to_binary(int x) {
	vector<bool> res;
	while (x != 0) {
		res.push_back(x % 2);
		x /= 2;
	}
	return res;
}

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

	int N, T, A;
	cin >> N >> T >> A;

	int H;
	double tmp,diff;

	double min = 100000000;
	int min_index = 0;

	rep(i, N) {
		cin >> H;
		tmp = (double)T - (double)H * 0.006;
		diff = std::abs((double)A - tmp);

		if (min >= diff) {
			min = diff;
			min_index = i;
		}
	}


	cout << min_index + 1 << endl;

ProgramEndPointLabel:;

	//Program End
	system("pause");

	return 0;
}




Compiler output:
a.cc: In function 'int vmin(std::vector<int>)':
a.cc:73:19: error: 'INT32_MAX' was not declared in this scope
   73 |         int min = INT32_MAX;
      |                   ^~~~~~~~~
a.cc:12:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   11 | #include<limits.h>
  +++ |+#include <cstdint>
   12 | #define rep(i,n) for(ll i = 0; i < (ll)n; i++)
a.cc: In function 'int vmax(std::vector<int>)':
a.cc:79:19: error: 'INT32_MIN' was not declared in this scope; did you mean 'INT_MIN'?
   79 |         int max = INT32_MIN;
      |                   ^~~~~~~~~
      |                   INT_MIN
Language: C++

#include<iostream>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<stdio.h>
#include<string>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<limits.h>
#define rep(i,n) for(ll i = 0; i < (ll)n; i++)
#define swap(a,b) a^=b;b^=a;a^=b;
#define chmax(a,b) {if(a < b) a = b;}
#define chmin(a,b) {if(a > b) a = b;}
using namespace std;
typedef long long ll;
ll gcd(ll, ll);
vector<bool> to_binary(int);
int sum(vector<int>);
int min(vector<int>);
int max(vector<int>);
ll nCr(ll n, ll r);

const ll INF = 1LL << 60;

typedef tuple<ll, ll> mtupl;

bool mycomp(mtupl x, mtupl y) {
	return get<1>(x) < get<1>(y);
}

vector<vector<ll>> memo;

ll get(int x, int y) {
	if (memo[x][y] != -1)
		return memo[x][y];

	if (x == 0) return 1;
	if (y < x) return 0;

	memo[x][y] = get(x, y - 1) + get(x - 1, y - 1);
	return memo[x][y];
}

ll mpow(ll a, ll b) {
	ll ans = 1;
	for (ll i = 0; i < b; i++) {
		ans *= a;
		ans %= 1000000007;
	}
	return ans;
}

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

int vsum(vector<int> v) {
	int res = 0;
	for (auto it = v.begin(); it != v.end(); it++)
		res += *it;
	return res;
}
int vmin(vector<int> v) {
	int min = INT32_MAX;
	for (auto it = v.begin(); it != v.end(); it++)
		min = std::min(min, *it);
	return min;
}
int vmax(vector<int> v) {
	int max = INT32_MIN;
	for (auto it = v.begin(); it != v.end(); it++)
		max = std::max(max, *it);
	return max;
}

ll gcd(ll A, ll B) {
	if (A == 0 || B == 0) return max(A, B);
	int r = A % B;
	while (r != 0) {
		A = B;
		B = r;
		r = A % B;
	}

	return B;
}

vector<bool> to_binary(int x) {
	vector<bool> res;
	while (x != 0) {
		res.push_back(x % 2);
		x /= 2;
	}
	return res;
}

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

	int N, T, A;
	cin >> N >> T >> A;

	int H;
	double tmp,diff;

	double min = 100000000;
	int min_index = 0;

	rep(i, N) {
		cin >> H;
		tmp = (double)T - (double)H * 0.006;
		diff = abs((double)A - tmp);

		if (min >= diff) {
			min = diff;
			min_index = i;
		}
	}


	cout << min_index + 1 << endl;

ProgramEndPointLabel:;

	//Program End
	system("pause");

	return 0;
}




Compiler output:
a.cc: In function 'int vmin(std::vector<int>)':
a.cc:73:19: error: 'INT32_MAX' was not declared in this scope
   73 |         int min = INT32_MAX;
      |                   ^~~~~~~~~
a.cc:12:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
   11 | #include<limits.h>
  +++ |+#include <cstdint>
   12 | #define rep(i,n) for(ll i = 0; i < (ll)n; i++)
a.cc: In function 'int vmax(std::vector<int>)':
a.cc:79:19: error: 'INT32_MIN' was not declared in this scope; did you mean 'INT_MIN'?
   79 |         int max = INT32_MIN;
      |                   ^~~~~~~~~
      |                   INT_MIN
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: expected primary-expression before '<' token
    7 |   int cc =1 < <30;
      |               ^
a.cc:15:11: warning: unknown escape sequence: '\040'
   15 |   printf ("% d \ n " , res );
      |           ^~~~~~~~~~
a.cc:15:30: error: expected '}' at end of input
   15 |   printf ("% d \ n " , res );
      |                              ^
a.cc:4:1: note: to match this '{'
    4 | {
      | ^
Language: C

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

int main(void)
{
  int n,t,a,i,p;
  double b[1000];
  double m,n=9999999;
  
  scanf("%d",&n);
  scanf("%d %d",&t,&a);
  
  for(i=0;i<n;i++)
  {
    scanf("%d",&b[i]);
  }
  
  for(i=0;i<n;i++)
  {
    b[i]=t-(b[i]*(6/1000));
    m=fabsf(a-b[i]);
    if(m<n)
    {
      n=m;
      p=i;
    }
  }
  
  printf("%d",p);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:12: error: conflicting types for 'n'; have 'double'
    8 |   double m,n=9999999;
      |            ^
main.c:6:7: note: previous declaration of 'n' with type 'int'
    6 |   int n,t,a,i,p;
      |       ^
Language: C

int main(void)
{
  int n,t,a,i,p;
  double b[1000];
  double m,n=9999999;
  
  scanf("%d",&n);
  scanf("%d %d",&t,&a);
  
  for(i=0;i<n;i++)
  {
    scanf("%d",&b[i]);
  }
  
  for(i=0;i<n;i++)
  {
    b[i]=t-(b[i]*(6/1000));
    m=fabsf(a-b[i]);
    if(m<n)
    {
      n=m;
      p=i;
    }
  }
  
  printf("%d",p);
  
  return 0;
}
    
                  

Compiler output:
main.c: In function 'main':
main.c:5:12: error: conflicting types for 'n'; have 'double'
    5 |   double m,n=9999999;
      |            ^
main.c:3:7: note: previous declaration of 'n' with type 'int'
    3 |   int n,t,a,i,p;
      |       ^
main.c:7:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    7 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | int main(void)
main.c:7:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    7 |   scanf("%d",&n);
      |   ^~~~~
main.c:7:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:18:7: error: implicit declaration of function 'fabsf' [-Wimplicit-function-declaration]
   18 |     m=fabsf(a-b[i]);
      |       ^~~~~
main.c:1:1: note: include '<math.h>' or provide a declaration of 'fabsf'
  +++ |+#include <math.h>
    1 | int main(void)
main.c:18:7: warning: incompatible implicit declaration of built-in function 'fabsf' [-Wbuiltin-declaration-mismatch]
   18 |     m=fabsf(a-b[i]);
      |       ^~~~~
main.c:18:7: note: include '<math.h>' or provide a declaration of 'fabsf'
main.c:26:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   26 |   printf("%d",p);
      |   ^~~~~~
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:26:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:26:3: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using ll = unsigned long long;
using namespace std;

int main(void) {

    int n;
    int t, a;

    cin >> n;
    cin >> t >> a;

    int *h = new int[n];

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

    // sol
    int minv = INT32_MAX;
    int cand = INT32_MAX;
    int min_position = -1;

    for (int i = 0 ; i < n ; ++ i) {

        cand = abs(a - t - h[i] * 0.006);

        if (cand < minv) {
            minv = cand;
            min_position = i;
        }
    }

    cout << min_position + 1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: 'INT32_MAX' was not declared in this scope
   23 |     int minv = INT32_MAX;
      |                ^~~~~~~~~
a.cc:5:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    4 | #include<algorithm>
  +++ |+#include <cstdint>
    5 | using ll = unsigned long long;
Language: C++

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using ll = unsigned long long;
using namespace std;

int main(void) {

    int n;
    int t, a;
    int *h = new int[n];

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

    // sol
    int minv = INT32_MAX;
    int cand = INT32_MAX;
    int min_position = -1;

    for (int i = 0 ; i < n ; ++ i) {

        cand = abs(a - t - h[i] * 0.006);

        if (cand < minv) {
            minv = cand;
            min_position = i;
        }
    }

    cout << min_position + 1 << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:16: error: 'INT32_MAX' was not declared in this scope
   19 |     int minv = INT32_MAX;
      |                ^~~~~~~~~
a.cc:5:1: note: 'INT32_MAX' is defined in header '<cstdint>'; this is probably fixable by adding '#include <cstdint>'
    4 | #include<algorithm>
  +++ |+#include <cstdint>
    5 | using ll = unsigned long long;
Language: C

#include <stdio.h>
#include <mathe.h>
int main(){
  int i,n,t,a,h,r=1e9;
  scanf("%d%d%d",&n,&t,&a);
  for(i=0;i<n;i++){
    scanf("%d",&h);
    int k=abs(t-h*0.006-a);
    if(r>k)r=k;
  }
  printf("%d",k);
  return 0;
}

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

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

int main() {
  int n,t,a;
  cin >> n >> t >> a;
  double min = 1e9;
  int res = 0;
  
  vector<double> vec(n);
  for(int i; i<n; i++){
    cin >> vec.at(i);
    
    vec.at(i) = a - t + 0.006*vec.at(i);
    
    if (vec.at(i) < 0){
      vec.at(i) = vec.at(i)*(-1);
    }
    
    if(min > vec.at(i)){
      min = vec.at(i);
      res = 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;
      |             ^
Language: C++


using namespace std;



int main() {
	int n;
	int t;
	int a;
	vector<int> h;
	
	scanf("%d%d%d", &n, &t, &a);
	int u;
	for (int i = 0; i < n; i++) {
		scanf("%d", &u);
		h.push_back(u);
	}
	double min= abs(a - t + h[0] * 0.006);
	double v;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		v = abs(a-t + h[i] * 0.006);
		if (min > v) {
			ans = i;
			min = v;
		}
	}
	cout << ans+1  << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'vector' was not declared in this scope
   10 |         vector<int> h;
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | 
a.cc:10:16: error: expected primary-expression before 'int'
   10 |         vector<int> h;
      |                ^~~
a.cc:12:9: error: 'scanf' was not declared in this scope
   12 |         scanf("%d%d%d", &n, &t, &a);
      |         ^~~~~
a.cc:16:17: error: 'h' was not declared in this scope
   16 |                 h.push_back(u);
      |                 ^
a.cc:18:33: error: 'h' was not declared in this scope
   18 |         double min= abs(a - t + h[0] * 0.006);
      |                                 ^
a.cc:18:21: error: 'abs' was not declared in this scope
   18 |         double min= abs(a - t + h[0] * 0.006);
      |                     ^~~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << ans+1  << endl;
      |         ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:28:27: error: 'endl' was not declared in this scope
   28 |         cout << ans+1  << endl;
      |                           ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

#include <bits/stdc++.h>


using namespace std;



int main() {
	int n;
	int t;
	int a;
	vector<int> h;
	
	scanf_s("%d%d%d", &n, &t, &a);
	int u;
	for (int i = 0; i < n; i++) {
		scanf_s("%d", &u);
		h.push_back(u);
	}
	double min= abs(a - t + h[0] * 0.006);
	double v;
	int ans = 0;
	for (int i = 0; i < n; i++) {
		v = abs(a-t + h[i] * 0.006);
		if (min > v) {
			ans = i;
			min = v;
		}
	}
	cout << ans+1  << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
   14 |         scanf_s("%d%d%d", &n, &t, &a);
      |         ^~~~~~~
      |         scanf
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:31: error: 'DOUBLE_MAX' was not declared in this scope; did you mean 'BOOL_MAX'?
    6 |   int n, t, a, h, ans, diff = DOUBLE_MAX;
      |                               ^~~~~~~~~~
      |                               BOOL_MAX
Language: C++

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

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

Compiler output:
a.cc:2:17: error: 'syd' is not a namespace-name
    2 | using namespace syd;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin >> N >> T >> A;
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:19:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   19 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:19:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   19 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;

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

v

Compiler output:
a.cc:27:1: error: 'v' does not name a type
   27 | v
      | ^
Language: C++

int main(){
	int n, t, a, hnum, lnum;
	cin >> n >> t >> a;
	vector<int> h(n);
	vector<double> tem(n);

	for (int i = 0; i < n; i++){
		cin >> h.at(i);
	}

	for (int i = 0; i < n; i++){
		tem.at(i) = t - h.at(i)*0.006;
	}

	double high, low;
	for (int i = 0; i < n; i++){
		if (i == 0){
			low = 0 - 100000 * 0.006;
			high = 50;
		}
		if (tem.at(i) == a){
			high = a;
			low = a;
			lnum = i;
			break;
		}

		else if (tem.at(i) < a){
			if (low < tem.at(i)){
				low = tem.at(i);
				lnum = i;
			}
		}

		else{
			if (high > tem.at(i)){
				high = tem.at(i);
				hnum = i;
			}
		}
	}
	
	if (a - low <= high - a){
		cout << lnum+1 << endl;
	}

	else{
		cout << hnum+1 << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'cin' was not declared in this scope
    3 |         cin >> n >> t >> a;
      |         ^~~
a.cc:4:9: error: 'vector' was not declared in this scope
    4 |         vector<int> h(n);
      |         ^~~~~~
a.cc:4:16: error: expected primary-expression before 'int'
    4 |         vector<int> h(n);
      |                ^~~
a.cc:5:16: error: expected primary-expression before 'double'
    5 |         vector<double> tem(n);
      |                ^~~~~~
a.cc:8:24: error: 'h' was not declared in this scope
    8 |                 cin >> h.at(i);
      |                        ^
a.cc:12:17: error: 'tem' was not declared in this scope
   12 |                 tem.at(i) = t - h.at(i)*0.006;
      |                 ^~~
a.cc:12:33: error: 'h' was not declared in this scope
   12 |                 tem.at(i) = t - h.at(i)*0.006;
      |                                 ^
a.cc:21:21: error: 'tem' was not declared in this scope
   21 |                 if (tem.at(i) == a){
      |                     ^~~
a.cc:44:17: error: 'cout' was not declared in this scope
   44 |                 cout << lnum+1 << endl;
      |                 ^~~~
a.cc:44:35: error: 'endl' was not declared in this scope
   44 |                 cout << lnum+1 << endl;
      |                                   ^~~~
a.cc:48:17: error: 'cout' was not declared in this scope
   48 |                 cout << hnum+1 << endl;
      |                 ^~~~
a.cc:48:35: error: 'endl' was not declared in this scope
   48 |                 cout << hnum+1 << endl;
      |                                   ^~~~
Language: C

#include <iostream>
#include <iomanip>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	int n, t, a, h[1010], cnt, ans, mi;
	cin >> n >> t >> a;
	t *= 1000;
	a *= 1000;
	rep(i, n){
		cin >> h[i];
		h[i] *= 1000;
		cnt = t-h[i]*6;
		if(i == 0){
			mi = i+1;
			ans = abs(cnt - a);
		}else{
			if(ans > abs(cnt - a)){
				mi = i+1;
				ans = abs(cnt - a);
			}
		}
	}
	cout << mi << endl;
}

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

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

int main(){
  int n,t,k,f=0; cin>>n>>t>>k;
  int b=100000;
  for(int i=0;i<n;i++){
    int c; cin>>c;
    if(b>fabs(k-(t-0.006*c))){
      b=t-0.006*c;
      f=i+1;
    }
  }
  
  cout<<f<<endl;
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:10: error: 'fabs' was not declared in this scope; did you mean 'labs'?
   10 |     if(b>fabs(k-(t-0.006*c))){
      |          ^~~~
      |          labs
Language: C++

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

int main(){
  int n,t,k; cin>>n>>t>>k;
  int b=100000;
  for(int i=0;i<n;i++){
    int c; cin>>c;
    b= min(b,abs(k-(t-0.006*c)));
  }
  
  cout<<b<<endl;
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: no matching function for call to 'min(int&, double)'
   10 |     b= min(b,abs(k-(t-0.006*c)));
      |        ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:10:11: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'double')
   10 |     b= min(b,abs(k-(t-0.006*c)));
      |        ~~~^~~~~~~~~~~~~~~~~~~~~~
/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,
                 from a.cc:2:
/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:10:11: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   10 |     b= min(b,abs(k-(t-0.006*c)));
      |        ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<iostream>
using namespace std;

int main(){
  int n,t,k; cin>>n>>t>>k;
  int b=100000;
  for(int i=0;i<n;i++){
    int c; cin>>c;
    b= min(b,abs(k-(t-0.006*c)));
  }
  
  cout<<b<<endl;
  return 0;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: no matching function for call to 'min(int&, double)'
    9 |     b= min(b,abs(k-(t-0.006*c)));
      |        ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:9:11: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'double')
    9 |     b= min(b,abs(k-(t-0.006*c)));
      |        ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C

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


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

#include <iostream>
#include <iomanip>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	int n, t, a, h[1010], mi = 100000, cnt;
	double ans;
	cin >> n >> t >> a;
	rep(i, n){
		cin >> h[i];
		ans = t-h[i]*0.006;
		if(fabs(ans-a) < mi){
			cnt = i + 1;
			mi = fabs(ans-a);
		}
	}
	cout << cnt << endl;
}#include <iostream>
#include <iomanip>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	int n, t, a, h[1010], mi = 100000, cnt;
	double ans;
	cin >> n >> t >> a;
	rep(i, n){
		cin >> h[i];
		ans = t-h[i]*0.006;
		if(fabs(ans-a) < mi){
			cnt = i + 1;
			mi = fabs(ans-a);
		}
	}
	cout << cnt << endl;
}

Compiler output:
a.cc:30:2: error: stray '#' in program
   30 | }#include <iostream>
      |  ^
a.cc:30:3: error: 'include' does not name a type
   30 | }#include <iostream>
      |   ^~~~~~~
a.cc:42:5: error: redefinition of 'int comp(const void*, const void*)'
   42 | int comp(const void* a, const void* b){
      |     ^~~~
a.cc:13:5: note: 'int comp(const void*, const void*)' previously defined here
   13 | int comp(const void* a, const void* b){
      |     ^~~~
a.cc:46:5: error: redefinition of 'int main()'
   46 | int main() {
      |     ^~~~
a.cc:17:5: note: 'int main()' previously defined here
   17 | int main() {
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod=1e9+7;

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

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:28: error: expected primary-expression before '<' token
   18 |         if(abs(T-temp[i]) =< min){
      |                            ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> temp(n);
    vector<int> cal(n);
    vector<pair<int, int>>ans(n);
    for(int i = 0; i < n; i++) {
        temp[i] = t - h[i] * 0.006;
        temp[i] = temp[i] * 1000
        cal[i] = abs(a - temp[i]);
        ans[i] = make_pair(cal[i], i+1);
  }
  
  sort(ans.begin(), ans.end());
  cout << ans[0].second << endl;




    return 0;
}

Compiler output:
a.cc:8:3: error: extended character 　 is not valid in an identifier
    8 |   　a = 1000 * a;
      |   ^
a.cc: In function 'int main()':
a.cc:8:3: error: '\U00003000a' was not declared in this scope
    8 |   　a = 1000 * a;
      |   ^~~
a.cc:21:33: error: expected ';' before 'cal'
   21 |         temp[i] = temp[i] * 1000
      |                                 ^
      |                                 ;
   22 |         cal[i] = abs(a - temp[i]);
      |         ~~~
Language: C

#include <stdio.h>

double abs(int a);
int main(void) {
	int n, t, a;
	scanf("%d %d %d", &n, &t, &a);
	int h[n], ans;
	double tmp = 1e9;
	for(int i = 0; i < n; i++) {
		scanf("%d", &h[i]);
		double cmp = (double)t - (double)h[i] * 0.006;
		if(abs(cmp - a) < tmp) tmp = abs(cmp - a), ans = i + 1;
	}
	printf("%d\n", ans);
	return 0;
}

double abs(double a) {
	if(a < 0) return -a;
	else return a;
}



Compiler output:
main.c:3:8: warning: conflicting types for built-in function 'abs'; expected 'int(int)' [-Wbuiltin-declaration-mismatch]
    3 | double abs(int a);
      |        ^~~
main.c:2:1: note: 'abs' is declared in header '<stdlib.h>'
    1 | #include <stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:18:8: error: conflicting types for 'abs'; have 'double(double)'
   18 | double abs(double a) {
      |        ^~~
main.c:3:8: note: previous declaration of 'abs' with type 'double(int)'
    3 | double abs(int a);
      |        ^~~
Language: C

#include <stdio.h>

int abs(int a);
int main(void) {
	int n, t, a;
	scanf("%d %d %d", &n, &t, &a);
	int h[n], ans;
	double tmp = 1e9;
	for(int i = 0; i < n; i++) {
		scanf("%d", &h[i]);
		double cmp = (double)t - (double)h[i] * 0.006;
		if(abs(cmp - a) < tmp) tmp = abs(cmp - a), ans = i + 1;
	}
	printf("%d\n", ans);
	return 0;
}

double abs(double a) {
	if(a < 0) return -a;
	else return a;
}



Compiler output:
main.c:18:8: error: conflicting types for 'abs'; have 'double(double)'
   18 | double abs(double a) {
      |        ^~~
main.c:3:5: note: previous declaration of 'abs' with type 'int(int)'
    3 | int abs(int a);
      |     ^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <mathc>

#define mod 1000000007

using namespace std;
 
int main(void){
	
	int N, T, A;
	double sa=1000;
	int point;
	
	cin >> N >> T >> A;
	
	int H[N];
	
	for(int i=0; i<N; i++)
		cin >> H[i];
	
	for(int i=0; i<N; i++){
		if(abs((T-H[i]*0.006)-A) < sa){
			sa = abs((T-H[i]*0.006)-A);
			point = i+1;
		}
	}
	
	cout << point;
	
	return 0;
}

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

#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <math.h>

#define mod 1000000007

using namespace std;
 
int main(void){
	
	int N, T, A, sa=1000;
	int point;
	
	cin >> N >> T >> A;
	
	int H[N];
	
	for(int i=0; i<N; i++)
		cin >> H[i];
	
	for(int i=0; i<N; i++){
		if(abs(double)((T-H[i]*0.006)-A) < sa){
			sa = abs(double)((T-H[i]*0.006)-A);
			point = i+1;
		}
	}
	
	cout << point;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:24: error: expected primary-expression before 'double'
   24 |                 if(abs(double)((T-H[i]*0.006)-A) < sa){
      |                        ^~~~~~
a.cc:25:34: error: expected primary-expression before 'double'
   25 |                         sa = abs(double)((T-H[i]*0.006)-A);
      |                                  ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <math.h>

#define mod 1000000007

using namespace std;
 
int main(void){
	
	double N, T, A, sa=1000;
	int point;
	
	cin >> N >> T >> A;
	
	double H[N];
	
	for(int i=0; i<N; i++)
		cin >> H[i];
	
	for(int i=0; i<N; i++){
		if(abs((T-H[i]*0.006)-A) < sa){
			sa = abs((T-H[i]*0.006)-A);
			point = i;
		}
	}
	
	cout << point;
	
	return 0;
}

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

#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}

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

	int N=in(),X=in(),A=in();
        int min_val=1e9,min_index;
        REP(i,N){
            int H=in();
            int t=1000*X-6*H;
            if(min_val>t){
                min_val=t;
                min_index=i+1;
        }

	cout << min_index << endl;

	return 0;
}


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

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

int abs(double n){
  if(n<0) return -n;
  else return n;
}
int main(){
  int N,T,A,b=0;
  double a;
  cin >> N >> T >> A;
  cin >> a;
  a = T-a*0.006
  for(int i=0;i<N;i++){
    int h;
    cin >> h;
    double temp = T-h*0.006;
    if(abs(A-temp)<a){
      a = abs(A-temp);
      b = i;
    }
  }
  cout << b+1 << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before 'for'
   13 |   a = T-a*0.006
      |                ^
      |                ;
   14 |   for(int i=0;i<N;i++){
      |   ~~~           
a.cc:14:15: error: 'i' was not declared in this scope
   14 |   for(int i=0;i<N;i++){
      |               ^
Language: C++

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


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

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


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

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:36: error: 'x' was not declared in this scope
   20 |             min = abs((double)h[i]-x*0.006-a);
      |                                    ^
Language: C++

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


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

    return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:11: error: 'INF' was not declared in this scope
   14 |     min = INF;
      |           ^~~
a.cc:20:36: error: 'x' was not declared in this scope
   20 |             min = abs((double)h[i]-x*0.006-a);
      |                                    ^