Problem:


Score: 200 points

Problem Statement

A country decides to build a palace.

In this country, the average temperature of a point at an elevation of x meters is T-x \times 0.006 degrees Celsius.

There are N places proposed for the place. The elevation of Place i is H_i meters.

Among them, Princess Joisino orders you to select the place whose average temperature is the closest to A degrees Celsius, and build the palace there.

Print the index of the place where the palace should be built.

It is guaranteed that the solution is unique.

Constraints

1 \leq N \leq 1000

0 \leq T \leq 50

-60 \leq A \leq T

0 \leq H_i \leq 10^5

All values in input are integers.

The solution is unique.

Input

Input is given from Standard Input in the following format:

N
T A
H_1 H_2 ... H_N

Output

Print the index of the place where the palace should be built.

Sample Input 1

2
12 5
1000 2000

Sample Output 1

1

The average temperature of Place 1 is 12-1000 \times 0.006=6 degrees Celsius.

The average temperature of Place 2 is 12-2000 \times 0.006=0 degrees Celsius.

Thus, the palace should be built at Place 1.

Sample Input 2

3
21 -11
81234 94124 52141

Sample Output 2

3



Sample input:
2
12 5
1000 2000


Sample output:
1

Submission status: Runtime Error

Solution code:
import pandas as pd

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

t = [abs(A - (T - i*0.006)) for i in H]
print(pd.Series(t).idxmin()+1)

Submission status: Runtime Error

Solution code:
import pandas as pd

N = int(input())
T, A = map(int, input().split())
H= list(map(int, input().split()))

t = []
for i in H:
    t.append(abs(A - (T - i*0.006)))

print(pd.Series(t).idxmin()+1)

Submission status: Runtime Error

Solution code:
n = int(input())
T, A = list(map(int, input().split())) # 定数Tと平均気温
places = list(map(int, input().split())) # 山の地点
# Aとの差が最も小さいplaceを出力する
place = 0 # ここにplaceを突っ込む　これで参照
ans = 0
for p in places:
    cnt = abs(T - p * 0.006) # [6.0, 0.0]
    t  = abs(A-cnt)
    if ans:
        pass
    else:
        ans = t
    if t < ans:
        ans = t
        place = p

print(places.index(place) + 1) # => placeに-11が入っているといっている

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map( int, input().split())
H = list( map( int, input.split()))
         
K = []
Ksorted=[]
tmp=[]
 
for i in range(N):
  tmp.append( T - H[i] * 0.006)
  K.append(abs( A - tmp[i]))
  Ksorted = sorted(K)
  
T = K.index(Ksorted[0])
print(T+1)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A  map( int, input().split())
H = list( map( int, input.split()))
         
K = []
Ksorted=[]
tmp=[]

for i in range(N):
  tmp.append( T - H[i] * 0.006)
  K.append(abs( A - tmp[i]))
  Ksorted = sorted(K)
  
T = K.index(Ksorted[0])
print(T + 1)

Submission status: Runtime Error

Solution code:
_ = input()
t, desire = map(int, input().split())
places_h = map(int, input().split())

def desire_delta(place_h, t, desire):
  avg_tmp = t - place_h * 0.006
  return max(desire - avg_tmp, avg_tmp - desire)

res = [(idx, desire_delta(h, t, desire)) for idx, h in enumerate(place_h)]

sorted_res = sorted(res, key=lambda idx, delta: delta)

print(sorted_res[0])

Submission status: Runtime Error

Solution code:
def inputnumber(msg):
    try:
        n = input(msg)
        result = int(n)
        return result
    except ValueError:
        return inputnumber(msg)
def main():
    koho = inputnumber("候補数 :")
    if not (1 <= koho <= 1000):
        return
    T,A = map(int,input().split())
    if not (0 <= T <= 50 and -60 <= A <= T):
        return
    N = int(input())
    a = []
    for i in range(N):
        a.append(input())
    for who in a :



if __name__=='__main__':
    main()
    print("終了")

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

res, height = 0, 100001
for i in range(N) :
    if height > abs(A - tmp) :
        height = abs(A - tmp)
        res = i + 1

print(res)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split())
places = map(int, [input() for _ in range(n)]

k = places.map(lambda x: abs(a - t - (H * 0.006)) // が最小となるindex
    

target = enumerate(k)        
ans = (0, 99999)

for i in target:
    if i[1] < ans[1]:
        ans = i

print(i[0])

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.06)-a))
print(ans.index(min(a))+1)

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(abs((t-h[i]*0.06)-a))
print(a.index(min(a))+1)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
#include <vector>
#include <cmath>
using namespace std;

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

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>



using namespace std;



int main(){

    int n,t,a;
    cin >> n>>t>>a;
    int res = INT_MAX;
    int res_idx = 0;
    vector<int> v;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        int curc = 12-1000*c;
        v.push_back(abs(curc - a));
    }

    cout << min_element(v.begin(), v.end()) - v.begin() + 1;
}

Submission status: Runtime Error

Solution code:
can = int(input())
input_data = list(map(int,input().split()))
t = input_data[0]
A = input_data[1]

input_data = list(map(int,input().split()))
dic = abs(A-(t-input_data[0]*0.006))
for i in range(len(input_data)-1):
    kion = abs(A-(t-input_data[i+1]*0.006))
    if kion<dic:
        ans = i + 2
        
        
print(int(ans))

Submission status: Runtime Error

Solution code:
can = int(input())
input_data = list(map(int,input().split()))
t = input_data[0]
A = input_data[1]

input_data = list(map(int,input().split()))
dic = abs(A)
for i in range(len(input_data)):
    kion = abs(A-(t-input_data[i]*0.006))
    if kion<dic:
        ans = i + 1
        
        
print(int(ans))

Submission status: Runtime Error

Solution code:
import sys
 
def solve(N, T, A, ls_H):
    temperature = []
    difference = []
    near = []
    ti = 10**5//1
    for x in ls_H :
        air = T - x * 0.006
        temperature.append(air)
    #print(temperature)
    
    for y in temperature :
        til = A - y
        difference.append(til)
    #print(difference)
    
    for z in difference :
        near.append(abs(z))
    #print(near)
    
    for i in near :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 # Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
import numpy as np

N = input()
T,A = map(int,input().split())
li = input().split()

celsiuses = []
for i for li:
	celsius = T-li[i]*0.006
	celsiuses.append(celsius)

def getNearValue(list, num):
	idx = np.abs(np.asarray(list) - num).argmin()
	return list[idx]

if __name__ = "__main__":

ans = getNearValue(celsiuses, A)

ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
import sys
def main():
    ws = sys.stdin.readline().strip().split()
    n = int(ws[0])
    m = int(ws[1])
    ls_a = []
    ls_b = [[] for i in range(n)]
    for i in range(M):
        p,y = map(int, sys.stdin.readline().strip().split())
        ls_a.append([p,y])
        ls_b[p-1].append(y)
    for i in range(n):
        ls_b[i].sort()
    for i in range(m):
        print(str(ls_a[i][0]).zfill(6) + str(ls_b[ls_a[i][0]-1].index(ls_a[i][1])+1).zfill(6))
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
input();I=map(int,input().split());t,a=I();d,i=9**9,0
for j,v in enumerate(I()):
 w=abs(a-t+v*0.006)
 if w<d:d=w;i=j
print(i+1)

Submission status: Runtime Error

Solution code:
n,t,a,*h=map(int,open(0).read().spilt())
d,i=10**18,0
for j in range(n):
  if abs(a-t+h[j]*0.006)<d:
    d=abs(a-t+h[j]*0.006)
    i=j
print(i+1)

Submission status: Runtime Error

Solution code:
n,t,a,*h=map(int,open(0).read().spilt())
d,i=10**18,0
for j in range(n):
  if abs(a-t+h*0.006)<d:
    d=abs(a-t+h*0.006)
    i=j
print(i+1)

Submission status: Runtime Error

Solution code:
n = int(input())
t,a = map(int,input().split())
ar = list(map(int,input().split()))
mxt,tt,ind = 100000000, 0,0
for i in range(n):
    tt = t - ar[i]*0.006
    f = 0
    if a<0 and tt < 0:
        f a,tt =1, abs(a),abs(tt)
    if abs(a-tt) < mxt:
        mxt = abs(a-tt)
        ind = i
    if f == 1:
        a = -a
print(ind+1)

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000 * 1000
    for x in ls_H :
        do = 1000 * T - x * 6
        dosi.append(do)
    # print(dosi)
    
    for y in dosi :
        ti = 1000 * A - y
        titen.append(ti)
    # print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    # print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    # print(ti)
    return titen1.index(ti) + 1
 
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000 * 1000
    for x in ls_H :
        do = 1000 * T - x * 6
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = 1000 * A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1
 
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1
 
 
def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)
 
def main():
    print(solve(*readQuestion()))
 
# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 1000000
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 100000
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
 main()

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 10**5//1
    for x in ls_H :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 10**5//1
    for x in list1 :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1


def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
 main()

Submission status: Runtime Error

Solution code:
import sys

def solve(N, T, A, ls_H):
    dosi = []
    titen = []
    titen1 = []
    ti = 10**5//1
    for x in list1 :
        do = T - x * 0.006
        dosi.append(do)
    #print(dosi)
    
    for y in dosi :
        ti = A - y
        titen.append(ti)
    #print(titen)
    
    for z in titen :
        titen1.append(abs(z))
    #print(titen1)
    
    for i in titen1 :
        if ti > i :
            ti = i
    #print(ti)
    return titen1.index(ti) + 1

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

# Uncomment before submission
main()

Submission status: Runtime Error

Solution code:
import sys
def solve(a,b,lst_ab):
    li = [abs(b-(a-(i*0.006))) for i in lst_ab]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return print(answer)

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    line2 = sys.stdin.readline().rstrip()
    list1 = line2.split(" ")
    line3 = sys.stdin.readline().rstrip()
    list2 = line3.split(" ")
    return int(list1[0]),int(list1[1]),list2
 
def main():
    t,a,h = readQuestion()
    answer = solve(t,a,h)
    print(answer)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=(int(i) for i in input().split(' '))
h=[int(i) for i in input().split(' ')]
T=[]
for i in range(n):
  T[i]=t-h[i]
index=0
for i in range(n):
  if abs(T[i]-a)<abs(T[index]-a):
    index=i
print(index+1)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
T, A = [int(i) for i in input().split()]

diff_min = 999999999
diff_i = 0
H = [int(i) for i in input().split()]
for i, n in enumerate(H):
    diff = math.abs(A - (T - 0.006*n))
    if diff < diff_min:
        diff = diff_min
        diff_i = i + 1

print(diff_i)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split(" "))


nums = map(int, input().split(" "))

xxx = map(lambda x: abs(a-t-0.006*x), nums)

m = min(xxx)

for i, v in xxx.enumerate:
    if m == v:
        print(i)

Submission status: Runtime Error

Solution code:
n = int(input())
t, a = map(int, input().split(" "))


nums = map(int, input().split(" "))

xxx = map(lambda x: abs(a-t-0.006*x), nums)

m = min(xxx)

for i, v in xxx.enumerete:
    if m == v:
        print(i)

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int, input().split())
H = [int(i) for i in input().split]

dif = float("inf")

for i in range(N):
    temp = T - H[i] * 0.006
    dif2 = abs(A-temp)
    if dif2 < dif:
        dif = dif2
        ans = i

print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
def main():

    n = int(input())
    N, M = map(int, input().split())
    e = list(map(int, input().split()))
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141
    for j in range(n):
        t = N - e[j]*0.006
        tt = abs(M - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().suplit())
h=list(input().suplit())
b=1
c=abs(t-h[0]*0.006-a)
for i in n :
  if(abs(t-h[i]*0.006-a)<c):
    b=i+1
    c=abs(t-h[i]*0.006-a)
  else:
    continue
print(b)

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
h = list(map(int,input().split()))
minimu = 1234567890
for i in range(n):
  if( minimu > abs(h[i]*0.006-t):
     minimu=abs(h[i]*0.006-t)
     ans = i+1
print(ans)

Submission status: Runtime Error

Solution code:
site = input()
T,A = map(int,input().split())
H = list(map(int, input().split()))

put = 10 ** 5
for i in H:
  a = abs(T - H[i]*0.006)
  if put < a:
    put = a
print(a)

Submission status: Runtime Error

Solution code:
t,a = map(int,input().split())
hight = list(map(int, input().split()))
ans = 100000
ansnumber = 0
num = 1
for i in hight:
    tmp = math.fabs(a -(t-i*0.006))
    if ans > tmp:
         ans = tmp
         ansnumber = num
         num = num + 1
print(ansnumber)

Submission status: Runtime Error

Solution code:
number = int(input())

input_str = input().split()
temp = int(input_str[0])
goal = int(input_str[1])

Hn = list(map(int, input().split()))

avg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]

if goal >= 0:
    print(int((avg_temp.index(max(avg_temp))) + 1))
else:
    print(int((avg_temp.index(min(avg_temp))) + 1))

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
for i in range(n):
    h[i]i=abs(t-h[i]*0.006-a)
print(h.index(min(h))+1)

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int,input().split(" "))
temp = []
for i in range(N):
  temp.append(map(int,input().split(" ")))
j = 0
k = 0
flag = 0
s = []
while j < N:
  k = T - (0.006)*temp[j]
  if k >= A:
    s.append(k - A)
  else:
    s.append(A - k)
  if s[j] <= s[flag]:
    flag = j
  j = j + 1
print(flag)

Submission status: Runtime Error

Solution code:
list=input().split("\n")
number=int(list[0])
list_2=list[1].split(" ")
t=int(list_2[0])
a=int(list_2[1])
list_3=list[2].spilit(" ")
index=1
min=abs(a-(t-int(list_3[0])))
target_index=1
for height in list_3:
    temp=t-int(height)*0.006
    diff=abs(a-temp)
    if diff < min :
        min = diff
        target_index = index
    index += 1    
print(target_index)

Submission status: Runtime Error

Solution code:
N = int(input())
T,A = map(int,input().split(" "))
temp = []
for i in range(N):
  temp.append(map(int,input().split(" ")))
j = 0
k = 0
flag = 0
s = []
while j < N:
  k = T - (0.006)*temp[j]
    if k >= A:
      s.append(k - A)
    else:
      s.append(A - k)
  if s[j] <= s[flag]:
    flag = j
  j = j + 1
print(j)

Submission status: Runtime Error

Solution code:
input_str = input().split("\n")
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]

if goal >= 0:
    print(int((avg_temp.index(max(avg_temp))) + 1))
else:
    print(int((avg_temp.index(min(avg_temp))) + 1))

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    ttt = []
    n = int(input())
    e = [list(map(int, input().split())) for _ in range(n)]
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for j in range(n):
        t = e[0][0] - e[1][j]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
    ttt = []
main()

Submission status: Runtime Error

Solution code:
# avg_temp = temp - x * 0.006

input_str = input().split("\n")
# a = [int(x) for x in a]
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [(temp - (Hn * 0.006)) / goal for Hn in Hn]

if goal >= 0:
    print(int((avg_temp.index(max(avg_temp))) + 1))
else:
    print(int((avg_temp.index(min(avg_temp))) + 1))

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    #ttt = []
    n = int(input())
    e = [list(map(int, input().split())) for _ in range(n)]
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for j in range(n):
        t = e[0][0] - e[1][j]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
ttt = []
main()

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    ttt = []
    n = int(input())
    e = [list(map(int, input().split())) for _ in range(n)]
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for j in range(n):
        t = e[0][0] - e[1][j]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()

Submission status: Runtime Error

Solution code:
for sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    temperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
print(ans)

Submission status: Runtime Error

Solution code:
N=input()#候補の数
TA=input()#T-x*0.006 Aに最も近い	
T=int(TA[0])#max
A=int(TA[1])#目的値
I=input()#xたち
XS=I.split()#標高たち list
S=[]
for X in XS:
  K=T-int(X)*0.006#気温
  if A < K:
  	S.append(K-A)#誤差を求める
  elif K < A:
    S.append(A-K)
M=None
N=None
for C in S:
  if C!=None and M!=None:
    if C < M:
      M=C
      N=S.index(C)
    else:
      pass
  else:
    M=C
    N=S.index(C)
print(str(int(N)+1))

Submission status: Runtime Error

Solution code:
# avg_temp = temp - x * 0.006

input_str = input().split("\n")
# a = [int(x) for x in a]
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [(temp - (Hn * 0.006)) for Hn in Hn]

print(int((avg_temp.index(max(avg_temp))) + 1))

Submission status: Runtime Error

Solution code:
for sys import stdin
N=int(stdin.readline().rstrip())
T,A=[int(x) for x in stdin.readline().rstrip().split()]
elev=[int(x) for x in stdin.readline().rstrip().split()]
cnt=0
comp=10000
for i in elev:
    cnt+=1
    tmperature=T-(i*0.006)
    tmp=abs(A-temperature)
    if comp > tmp:
        comp=tmp
        ans=cnt
pritn(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    ttt = []
    n = int(input())
    e = [list(map(int, input().split())) for i in range(n)]
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for j in range(n):
        t = e[0][0] - e[1][j]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

li = []
temp = 10 ** 5
for i in range(N):
    t = int(T - (H[i] * 0.006))
    li.append(t)
    if abs(A - t) < temp:
        temp = abs(A-t)

if A < 0:
    idx = li.index(-(temp-A))
else:
    idx = li.index(temp+A)

print(idx+1)

Submission status: Runtime Error

Solution code:
input_str = input().split("\n")
number = int(input_str[0])

temp = int(input_str[1].split()[0])
goal = int(input_str[1].split()[1])

Hn = list(map(int, input_str[2].split()))

avg_temp = [int(temp - (Hn * 0.006)) for Hn in Hn]

print(int((avg_temp.index(max(avg_temp)))+1))

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    ttt = []
    n = int(input())
    e = [list(map(int, input().split())) for _ in range(n)]
    #e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for i in range(n):
        t = e[0][0] - e[1][i]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()

Submission status: Runtime Error

Solution code:
n=input()
t,a=input().split()
h=[]
n=int(n)
t=int(t)
a=int(a)
b=input().split()
min=1000
for i in range(n):
     b[i]=int(b[i])
     if min > abs(a-t+0.006*b[i]):
          min=abs(a-t+0.006*b[i]))
          id=i+1
print(id)

Submission status: Runtime Error

Solution code:
N=input()#候補の数
TA=input()#T-x*0.006 Aに最も近い	
T=int(TA[0])#max
A=int(TA[1])#目的値
I=input()#xたち
XS=I.split()#標高たち list
S=[]
for X in XS:
  K=T-int(X)*0.006#気温
  if A<K:
  	S.append(K-A)#誤差を求める
  elif K<A:
    S.append(A-K)
M=None
N=None
for C in S:
  if C!=None:
    if C<M:
      M=C
      N=S.index(C)
    else:
      pass
  else:
    M=C
    N=S.index(C)
print(str(int(N)))

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
    ttt = []
    n = int(input())
    e = [[int(i) for i in input().split()] for i in range(int(input()))]
    #n = 3
    #e = [[21,-11],[81234,94124,52141]]
    for i in range(n):
        t = e[0][0] - e[1][i]*0.006
        tt = abs(e[0][1] - t)
        ttt.append(tt)
    ttt = np.array(ttt)
    print(np.argmin(ttt)+1)
main()

Submission status: Runtime Error

Solution code:
i=int(input())
A, T = input().strip().split(' ') 
A, T = [int(A), int(T)]
array = list(map(int, input().strip().split(' ')))
ans=[0]＊i 
j=0
ans[j]=abs(array[j]-(A-T)/0.006)
kai=ans[j]
for j in range(0,i,1):
    ans[j]=abs(array[j]-(A-T)/0.006)
    if ans[j]＜kai
        kai=ans[j]
        ko=j
print(ko)

Submission status: Runtime Error

Solution code:
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

t = []
temp = 10 ** 5
for i in range(N):
    t.append(int(T - H[i] * 0.006))
    if abs(t[i] - A) <= temp:
        temp = abs(t[i] - A)

if A < 0:
    print(t.index((temp-A) * -1)+1)
else:
    print(t.index(temp+A)+1)

Submission status: Runtime Error

Solution code:
i=int(input())
A, T = input().strip().split(' ') 
A, T = [int(A), int(T)]
array = list(map(int, input().strip().split(' ')))
ans=[0]＊i 
ans[i]=abs(array[i]-(A-T)/0.006)
kai=ans[i]
for j in range(0,i,1):
    ans[j]=abs(array[j]-(A-T)/0.006)
    if ans[j]＜kai
        kai=ans[j]
        ko=j
print(ko)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
  int N,T,A;
  cin >> N >> T >> A;
  double min_diff = 1000;
  int pos = -1;
  for( int i=0;i<N;i++ )
    {
      int h;
      cin >> h;
      if( min_diff > fabs(T-h*0.006-A) )
	{
	  pos = i;
	  min_diff = fabs(T-h*0.006-A);
	}
    }
  cout << pos+1 << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())

h=[int(input()) for i in range(n)]

min=1000
for i in range(n):
  temp=abs(t-0.006*h[i]-a)
  if min>temp:
    min=temp
    id=i
print(id+1)

Submission status: Runtime Error

Solution code:
import numpy as np
def main():
  ttt = []
  n = int(input())
  e = [[int(i) for i in input().split()] for i in range(int(input()))]
  for i in range(n):
    t = e[0][0] - e[1][i]*0.006
    tt = abs(e[0][1] - t)
    ttt.append(tt)
  ttt = np.array(ttt)
  print(np.argmin(ttt)+1)
main()

Submission status: Runtime Error

Solution code:
i=int(input())
A, T = input().strip().split(' ') 
A, T = [int(A), int(T)]
array = list(map(int, input().strip().split(' ')))
ans=[0]＊i 
ans[i]=abs(array[i]-(A-T)/0.006)
kai=ans[i]
for j in range(0,i,1):
    ans[i]=abs(array[i]-(A-T)/0.006)
    if ans[i]＜kai
        kai=ans[i]
        ko=i
print(ko)

Submission status: Runtime Error

Solution code:
n=int(input())
t,a=map(int,input().split())

h=[int(input()) for i in range(n)]

min=1000
for i in range(n):
  temp=abs(t-0.006*h[i]-a)
  print(temp)
  if min>temp:
    min=temp
    id=i
print(i+1)

Submission status: Runtime Error

Solution code:
n input()
t, a = map(int,input().split())
ary=[int(x) for x in input().split()]
x = (t-a)/0.006
def getNearestValue(list, num):
    idx = np.abs(np.asarray(list) - num).argmin()
    return list[idx]
print(getNearestValue(ary, x))