TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):

n = int(input())
#t - h[i] * 0.006

t,a = map(int,input().split())
h = list(map(int,input().split()))

o = []

for i in range(n):
    o.append(t - h[i] * 0.006)


p = abs(a - h[0])

q = 0
for i in range(n)[1:]:
    if abs(a - o[i]) < p:
        p = abs(a - o[i])
        q = i

print(q + 1)

n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
p = 10 ** 8
ans = 0
for i in range(n):
    x = t - h[i] * 0.006
    x = abs(a - x)
    if p > x:
        p = x
        ans = i + 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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+1)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int,input()
t, a = map(int,input().split())
list_oA = [51]
list_lA = [10*5-6/1000]
o_kome = []
l_kome = []
H = list(map(int,input().split()))
kome = 0
for i in H:
    T = t -i*6/1000
    kome += 1
    if T == a:
        print(kome)
    elif T > a:
        list_oA.append(T)
        o_kome.append(kome)
    else:
        list_lA.append(T)
        l_kome.append(kome)
sa_o = min(list_oA)- a
sa_l = a - max(list_lA)
if sa_o > sa_l:
    print(max(l_kome))
else:
    print(min(o_kome))


n = int,input()
t, a = map(int,input().split())
dic_oA = {}
dic_lA = {}
H = list(map(int,input().split()))
kome = 0

for i in H:
    T = t -i*6/1000
    kome += 1        
    if T >= a:
        dic_oA[kome] = T
    else:
        dic_lA[kome] = T

if len(dic_oA) == 0:
    print(max(dic_lA,key=dic_lA.get))
elif len(dic_lA) == 0:
    print(min(dic_oA,key=dic_oA.get))
else:
    sa_o = min(dic_oA.values())- a
    sa_l = a - max(dic_lA.values())
    if sa_o > sa_l:
        print(max(dic_lA,key=dic_lA.get))
    else:
        print(min(dic_oA,key=dic_oA.get))





Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
h = list(map(int, input().split()))

best_point=0
best=float('inf')
i=0
for hi in h:
    tmp = t - (hi * 0.006)
    dif = abs(a - tmp)
    if abs(dif) < abs(best):
        best = dif
        best_point = i + 1
        print(best_point)
    i += 1
print(best_point)

n=int(input())
t,a=map(int,input().split())
hl=list(map(int,input().split()))

best=float('inf')
bp=1
for i in range(n):
    avr = t-(hl[i]*0.006)
    dif = abs(avr-a)
    if dif < best:
        best = dif
        bp = i+1
print(bp)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = 0
for i in li:
    if abs(nearest - a) > abs((t - i * 0.006) - a):
        nearest = i
print(l.index(nearest) + 1)

n = int(input())
t,a = map(int,input().split())
li = list(map(int,input().split()))
nearest = 0
for i in li:
    if abs(nearest - a) < abs((t - i * 0.006) - a):
        nearest = i
print(li.index(nearest) + 1)

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
dif = 1000
for i in range(N):
    Tx = T - H[i] * 0.006
    if  abs(Tx - A) < dif:
        dif = abs(Tx - A)
        ans = i + 1
print(ans)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 10**10
for i in range(N):
  tmp = T - 0.006*H[i]
  ans = min(ans, abs(A-tmp))
print(ans)

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

index = 0
ans = 10**10
for i in range(N):
  tmp = T - 0.006*H[i]
  if ans > abs(A-tmp):
    ans = abs(A-tmp)
    index = i+1
print(index)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# abc113_b.py
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
lowest = 10**9
ans = 0
for i in range(N):
    tmperture = abs(A-(T-H[i]*0.006))
    print(tmperture)
    if abs(tmperture) < lowest:
        ans = i + 1
        lowest = tmperture
print(ans)

# abc113_b.py
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
lowest = 10**9
ans = 0
for i in range(N):
    tmperture = abs(A-(T-H[i]*0.006))
    if abs(tmperture) < lowest:
        ans = i + 1
        lowest = tmperture
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np

n = int(input())
t, a = map(int, input().split())
h = np.array(list(map(int, input().split())))

A = list(map(lambda x: abs(t-x*0.006), h))
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx+1)

import numpy as np

n = int(input())
t, a = map(int, input().split())
h = np.array(list(map(int, input().split())))

A = [abs(a-(t-x*0.006)) for x in h]
[idx] = [i for i, x in enumerate(A) if x == min(A)]

print(idx+1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t ,a=list(map(int, input().split()))
h = list(map(int,input().split(' ')))

min=100000000000000
min_index=n+1
for i in range(len(h)):
  v = abs(t - h[i]*0.006)
  if v < min:
    min=v
    min_index=i
print(min_index+1)


n=int(input())
t ,a=list(map(int, input().split()))
h = list(map(int,input().split(' ')))

min=100000000000000
min_index=n+1
for i in range(len(h)):
  v = abs(t - h[i]*0.006-a)
  if v < min:
    min=v
    min_index=i
print(min_index+1)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())

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

ans=[]

for i in range(n):
    ans.append(abs(a-(t-h[i]*0.006)))

print(min(ans))

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

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

ans=[]

for i in range(n):
    ans.append(abs(a-(t-h[i]*0.006)))

print(ans.index(min(ans))+1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
_ = 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])


_ = 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(places_h)]

sorted_res = sorted(res, key=lambda place: place[1])

print(sorted_res[0][0] + 1)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = [int(x) for x in input().split()]
H = list(map(int, input().split()))
min = 100000
result = 0

for i in range(N):
    if abs(A - (T-H[i]*0.006)) < min:
        min = abs(A - (T-H[i]*0.006))
        result = i

print(result)

N = int(input())
T, A = [int(x) for x in input().split()]
H = list(map(int, input().split()))
min = 100000
result = 0

for i in range(N):
    if abs(A - (T-H[i]*0.006)) < min:
        min = abs(A - (T-H[i]*0.006))
        result = i+1

print(result)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np

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

temp = list(map(lambda x: T - x*0.006, height))
print(height)
print(temp)

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

print(temp.index(getNearesValue(temp, A)) + 1)


# -*-coding: utf-8 -*-
N = int(input())
T, A = map(int, input().split())

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

best_near = 100000000
ans = 0
for i in range(N):
    temp = T - H[i]*0.006
    if best_near > abs(A - temp):
        best_near = abs(A - temp)
        ans = i+1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = np.array(input().split(), dtype="int")[:2]
H = [int(i) for i in input().split()]
    
min_dif = 10000
place = 0
for i in range(N):
  temp = T - H[i] *0.006
  dif = abs(A-temp)
        
  
  if min_dif >= dif:
    min_dif = dif
    place = i+1
    
print(place)

from unittest.mock import patch
import numpy as np

def palace():
    
    N = int(input())
    T, A = np.array(input().split(), dtype="int")[:2]
    H = [int(i) for i in input().split()]
    
    min_dif = 10000
    place = 0
    for i in range(N):
        temp = T - H[i] *0.006
        dif = abs(A-temp)
        
        
        if min_dif >= dif:
            min_dif = dif
            place = i+1
    
    print(place)

import numpy as np

def palace():
    
    N = int(input())
    T, A = np.array(input().split(), dtype="int")[:2]
    H = [int(i) for i in input().split()]
    
    min_dif = 10000
    place = 0
    for i in range(N):
        temp = T - H[i] *0.006
        dif = abs(A-temp)
        
        
        if min_dif >= dif:
            min_dif = dif
            place = i+1
    
    print(place)
    
    
palace()

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
h = [abs(A - (T - x * 0.006)) for x in H]

m = h[0]
ans = 1
for i in range(len(h)):
    if h[i] < m:
        m = h[i]
        ans = i + 1


print(h)

N = int(input())
T, A = [int(i) for i in input().split()]
H = [int(i) for i in input().split()]
h = [abs(A - (T - x * 0.006)) for x in H]

m = h[0]
ans = 1
for i in range(len(h)):
    if h[i] < m:
        m = h[i]
        ans = i + 1


print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
imin=100000
suf=0
for i in range(n):
  h[i]=t- h[i]＊0.006
  if imin > abs(a- h[i]):
    imin=abs(a- h[i])
    suf=i
print(i)
  
    

n=int(input())
t,a=list(map(int,input().split()))
h=list(map(int,input().split()))
imin=100000
suf=0
for i in range(n):
  h[i]=t- h[i]*0.006
  if a>=h[i]:
    if imin>a-h[i]:
      #print("!!",a-h[i],h[i],i)
      imin=abs(a- h[i])
      suf=i
  else:
    if imin>h[i]-a:
      #print("!!",a-h[i],h[i],i)
      imin=abs( h[i]-a)
      suf=i 
print(suf+1)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
#B - Palace
import numpy as np
N = int(input())
T,A = map(int, input().split())
H =  list(map(int, input().split()))

temp = np.argsort([abs(T-h*0.006) for h in H])[0]
print(temp+1)

import numpy as np
N = int(input())
T,A = map(int, input().split())
H =  list(map(int, input().split()))

temp = np.argsort([abs(A - (T-h*0.006)) for h in H])[0]
print(temp+1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
cand = 10**9
ans = 0
for i in range(N):
  temp = T - H[i] * 0.006
  if abs(A - temp) < cand:
    cand = abs(A - temp)
    ans = i + 1
    print(cand, i+1)
    
print(ans)

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
cand = 10**9
ans = 0
for i in range(N):
  temp = T - H[i] * 0.006
  if abs(A - temp) < cand:
    cand = abs(A - temp)
    ans = i + 1    
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t, a = (float(_) for _ in input().split())
h = [float(_) for _ in input().split()]

p = 0
ans = 9999999999
for i in range(n):
    at = t - h[i]*0.006
    print(abs(at-a))
    if(abs(at-a) < ans):
        ans = abs(at-a)
        p = i

print(p)

n = int(input())
t, a = (float(_) for _ in input().split())
h = [float(_) for _ in input().split()]
 
p = 0
ans = 9999999999
for i in range(n):
    at = t - h[i]*0.006
    if(abs(at-a) < ans):
        ans = abs(at-a)
        p = i+1
 
print(p)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
h = list(map(int, input().split()))
 
 
min = 10000
mini = 0
 
for i, x in enumerate(h):
  val = T - x*0.006
  gap = abs(A-val)
  if gap < min:
    min = gap
    mini = i
 
print(mini)

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


min = 10000
mini = 0

for i, x in enumerate(h):
  val = T - x*0.006
  gap = abs(A-val)
  if gap < min:
    min = gap
    mini = i

print(mini+1)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans, min = 0, 1e9
for i in range(N):
  if abs((T-H[i]*0.006) - A) < m:
    ans = i
    m = abs((T-H[i]*0.006) - A)
print(i)

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans, m = 0, 1e9
for i in range(N):
  if abs((T-H[i]*0.006) - A) < m:
    ans = i+1
    m = abs((T-H[i]*0.006) - A)
print(ans)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

L = [abs(A-(T-i*0.006)) for i in H]
print(L.index(min(L)+1))


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

ans = 1
ans_t = abs(A-(T-H[1]*0.006))
for i in range(N):
    if abs(A-(T-H[i]*0.006)) < ans_t:
        ans = i+1
        ans_t = abs(A-(T-H[i]*0.006))
print(ans)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
index = 0
degree = 0
for i in range(len(l)):
  diff = (t-l[i]*0.006)-a
  if diff < 0 :
    diff = -diff
  if degree > diff:
    degree = diff
    index = i
print(i+1)

n = int(input())
t, a = map(int, input().split())
l = list(map(int, input().split()))
index = 0
degree = 0
for i in range(len(l)):
  diff = (t-l[i]*0.006)-a
  if degree > diff:
    degree = diff
    index = i
print(i+1)

import sys

input = sys.stdin.readline

def main():
    l = []
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    for  i in range(N):
      l.append(abs(A-(T-h[i]*0.006)))
    print(l.index(min(l))+1)

if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    if temp < tmp:
        tmp = tmp
        tmpa = i
print(tmpa + 1)

n = int(input())
t, a = map(int, input().split())
t *= 1000
a *= 1000
lst = list(map(int, input().split()))
tmp = abs(t - 6 * lst[0] - a)
tmpa = 0
for i in range(1, n):
    temp = abs(t - 6 * lst[i] - a)
    if temp < tmp:
        tmp = temp
        tmpa = i
print(tmpa + 1)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ans = 100000
count = 0
for i in range(n):
    ch = abs(a - (t - h[i]*6/1000))
    print(ch)
    if abs(ans-a) > ch:
        ans = ch
        count = i+1
print(count)

n = int(input())
t,a = map(int,input().split())
h = list(map(int,input().split()))
ch = [10000]*n
for i in range(n):
    ch[i] = abs(a - (t - h[i]*6/1000))
print(ch.index(min(ch))+1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
    n = int(input())
    t, a = [ int(v) for v in input().split() ]
    height_list = [ abs(t-a-int(V)*0.006) for v in input().split() ]
    print(height_list.index(min(height_list))+1)

n = int(input())
t, a = [ int(v) for v in input().split() ]
height_list = [ int(v) for v in input().split() ]
height_list = [ abs(t-a-i*0.006) for i in height_list ]
print(height_list.index(min(height_list))-1)

n = int(input())
t, a = [ int(v) for v in input().split() ]
height_list = [ abs(t-a-int(V)*0.006) forfor v in input().split() ]
print(height_list.index(min(height_list))+1)


n = int(input())
t, a = [ int(v) for v in input().split() ]
height_list = [ abs(t-a-int(v)*0.006) for v in input().split() ]
print(height_list.index(min(height_list))+1)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif

N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]

lisnew = [tempDif(H,T,A) for H in lis]
print(i for i,x in lisnew if x == min(lisnew))

def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif

N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]

lisnew = [tempDif(H,T,A) for H in lis]
print(i for i,x in enumerate(lisnew) if x == min(lisnew))

def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif
 
N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]
 
lisnew = [tempDif(H,T,A) for H in lis]
print(listnew.index(max(listnew)))

def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif

N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]

lisnew = [tempDif(H,T,A) for H in lis]
s = [i for i,x in enumerate(lisnew) if x == min(lisnew)]
print(s[0])

def tempDif(h,T,A):
  temp = T - 0.006*h
  dif = A -temp
  if dif < 0:
    dif = -dif
  return dif
 
N = int(input())
T,A = map(int,input().split())
lis = [int(n) for n in input().split()]
 
lisnew = [tempDif(H,T,A) for H in lis]
print(lisnew.index(min(lisnew))+1)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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

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

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(id+1)

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)

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

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

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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)

from 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)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + H[0] * 0.006)
for i in range(N):
  d = T - H[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i
print(ans)


N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + h[0] * 0.006)
for i in range(N):
  d = T - h[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i
print(ans)

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = abs(A - T + H[0] * 0.006)
for i in range(N):
  d = T - H[i] * 0.006
  a = abs(A - d)
  if m >= a:
    m = a
    ans = i + 1
print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
m=a
ans=0
for i in h:
  if abs((t-i*0.006)-a) < m:
    m=abs((t-i*0.006)-a)
    ans=i+1
print(ans)

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
m=a
ans=0
for i in n:
  if abs((t-h[i]*0.006)-a) < m:
    m=abs((t-h[i]*0.006)-a)
    ans=i+1
print(ans)

n=int(input())
t,a=map(int,input().split())
h=list(map(int,input().split()))
m=100000
ans=0
for i in range(n):
  if abs((t-h[i]*0.006)-a) < m:
    m=abs((t-h[i]*0.006)-a)
    ans=i+1
print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
tmp = 10 ** 10
for i in range(N):
    if tmp > abs(T - H[i]*0.006):
        tmp = abs(T - H[i]*0.006)
        res = i
print(res+1)
    

N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
tmp = 10 ** 10
for i in range(N):
    if tmp > abs(A - T + H[i]*0.006):
        tmp = abs(A - T + H[i]*0.006)
        res = i
print(res+1)
    

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
T,A = map(int, input().split())
H = list(map(int, input().split()))

diff = 1000
index = 0

for i in range(N):
  tmp = abs(T - H[i]*0.006)
  if diff > tmp:
    diff = tmp
    index = i + 1
    
print(index)

n = int(input())
t,a = map(int, input().split())
ls = list(map(int, input().split()))
res = float('inf')

for i in range(n):
    tmp = t - ls[i] * 0.006
    if res > abs(a-tmp):
        res = abs(a-tmp)
        ans = i + 1
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>t*(1000)-6*H[i]:
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  

n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  


n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = H[i]
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans)
  


n=int(input())
t,a=map(int,input().split())
H=list(map(int,inpt().split()))
minn=10**10
for i in range(n):
  if minn>t*(1000)-6*H[i]:
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  

n=int(input())
t,a=map(int,input().split())
H=list(map(int,inpt().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  

n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = H[i]
    minn=t*(1000)-6*H[i]
print(ans)
  


n=int(input())
t,a=map(int,input().split())
H=list(map(int,input().split()))
minn=10**10
for i in range(n):
  if minn>abs((t*(1000)-6*H[i])-a*1000):
    ans = i
    minn=abs((t*(1000)-6*H[i])-a*1000)
print(ans+1)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t, a = map(int, input().split())
h = [int(_) for _ in input().split()]

nearest = 100000000
ans = 0

for idx, i in enumerate(h):
    temp = abs(t - i * 0.006)
    if nearest > temp:
        nearest = temp
        ans = idx + 1

print(ans)

n = int(input())
t, a = map(int, input().split())
h = [int(_) for _ in input().split()]

nearest = 100000000
ans = 0

for idx, i in enumerate(h):
    temp = t - i * 0.006
    temp = abs(a-temp)
    if nearest > temp:
        nearest = temp
        ans = idx + 1

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
diff = [abs((t-x*0.006)-a) for x in listh]
print(diff.index(min(diff)+1))


n = int(input())
t, a = map(int, input().split())
listh = list(map(int, input().split()))
diff = [abs((t-x*0.006)-a) for x in listh]
print(diff.index(min(diff))+1)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(abs(ans[i]) - abs(A_raw[i])))

print(built)

for k in range(0, N):
	built_num = 0
	if built[built_num] > built[built_num + k]:
		built_num = k

print(str(built_num + 1))



def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))

for k in range(0, N - 1):
	if built[k] > built[k + 1]:
		built_num = k + 1
	else:
		built_num = k

print(str(built_num))



def ave_temp(temp, height):
	return temp - (height * 0.006)

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

ans = []
A_raw = []
built = []
for i in range(0, N):
	ans.append(ave_temp(T, H[i]))
	A_raw.append(A)
	built.append(abs(ans[i] - A_raw[i]))
#print(ans)

#print(built)
index = 0

a = min(built)

for k in range(0, N):
	if a == built[k]:
		built_num = k
	

print(str(built_num + 1))


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
t,a=map(int,input().split())
h=map(int,input().split())
t1=[]
for i in range(n):
    t1.append(abs(a-(t-h[i]*0.006)))
print(t1.index(min(t1))+1)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
m=100100100100
for i in range(N):
  if abs(A-H[i])<m:
    m=abs(A-H[i])
    ans=i
print(ans)

N=int(input())
T,A=map(int,input().split())
H=list(map(int,input().split()))
z=[abs(A-T+i*0.006) for i in H]
print(z.index(min(z))+1)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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()

import sys

def solve(N, T, A, ls_H):
    li = [abs(A-(T-(i*0.006))) for i in ls_H]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return answer

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()))

main()

Verdicts: Runtime Error

Accepted