Problem: In AtCoder city, there are five antennas standing in a straight line. They are called Antenna A, B, C, D and E from west to east, and their coordinates are a, b, c, d and e, respectively.   Two antennas can communicate directly if the distance between them is k or less, and they cannot if the distance is greater than k.   Determine if there exists a pair of antennas that cannot communicate **directly**.   Here, assume that the distance between two antennas at coordinates p and q (p < q) is q - p.

Submission attempts (in order):
array1 = [int(input()) for i in range(6)]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
    if (i < 4 and array2[4 - i] - array2[0] > k):
        print(':(')
        break
    if (i < 3 and array2[4 - i] - array2[1] > k):
        print(':(')
        break
    if (i < 2 and array2[4 - i] - array2[2] > k):
        print(':(')
        break
    if (i < 1 and array2[4 - i] - array2[3] > k):
        print(':(')
        break
    if (i == 4):
        print('Yay!')

print(':(')

input = []
array = []
for i in input():
  input.append(int(i))
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
	if (array[size - i] - array[0] > k):
      print(':(')
      break
    if (i < 3):
      if (array[size - i] - array[1] > k):
      	print(':(')
        break
    if (i < 2):
      if (array[size - i] - array[2] > k):
      	print(':(')
        break
	if (i < 1):
      if (array[size - i] - array[3] > k):
        print(':(')
        break
    if (i == 4):
      print('Yay')

input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
  if (i < 4):
    if (array[size - i] - array[0] > k):
      print(':(')
      break
  if (i < 3):
    if (array[size - i] - array[1] > k):
      print(':(')
      break
  if (i < 2):
    if (array[size - i] - array[2] > k):
      print(':(')
      break
  if (i < 1):
    if (array[size - i] - array[3] > k):
      print(':(')
      break
  if (i == 4):
    print('Yay')

array1 = [int(input()) for i in range(6)]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
    if (i < 4 and array2[4 - i] - array2[0] > k):
    	print(':(')
        break
    if (i < 3 and array2[4 - i] - array2[1] > k):
    	print(':(')
        break
    if (i < 2 and array2[4 - i] - array2[2] > k):
    	print(':(')
        break
    if (i < 1 and array2[4 - i] - array2[3] > k):
    	print(':(')
        break
    if (i == 4):
        print('Yay!')

input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
	if (array[size - i] - array[0] > k):
      print(':(')
      break
    if (i < 3):
      if (array[size - i] - array[1] > k):
      	print(':(')
        break
    if (i < 2):
      if (array[size - i] - array[2] > k):
      	print(':(')
        break
	if (i < 1):
      if (array[size - i] - array[3] > k):
        print(':(')
        break
    if (i == 4):
      print('Yay')

array = []
for i in input():
  array.append(i)

size = len(array)

for i in range(size):
	if (array[size - i] - array[0] >= 18):
      print(':(')
    if (i < 3):
      if (array[size - i] - array[1] >= 18):
      	print(':(')
      else:
        print('Yay!')
    if (i < 2):
      if (array[size - i] - array[1] >= 18):
      	print(':(')
      else:
        print('Yay!')
	if (i < 1):
      if (array[size - i] - array[1] >= 18):
      	print(':(')
      else:
        print('Yay!')

input = []
array = []
input = [int(input() for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
	if (array[size - i] - array[0] > k):
      print(':(')
      break
    if (i < 3):
      if (array[size - i] - array[1] > k):
      	print(':(')
        break
    if (i < 2):
      if (array[size - i] - array[2] > k):
      	print(':(')
        break
	if (i < 1):
      if (array[size - i] - array[3] > k):
        print(':(')
        break
    if (i == 4):
      print('Yay')

input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
  if (i < 4):
    if (array[size - i - 1] - array[0] > k):
      print(':(')
      break
  if (i < 3):
    if (array[size - i - 1] - array[1] > k):
      print(':(')
      break
  if (i < 2):
    if (array[size - i - 1] - array[2] > k):
      print(':(')
      break
  if (i < 1):
    if (array[size - i - 1] - array[3] > k):
      print(':(')
      break
  if (i == 4):
    print('Yay')

array1 = [int(input()) for i in range(6)]
# array1 = [15,18,26,35,36,18]
array2 = input[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')

array = [int(input()) for i in range(5)]
array_sub = [i % 10 for i in array]
new_lst = [i for i in array_sub if i != 0]
minimum = min(new_lst)
sum = 0
for i in array:
  if (i % 10 == 0):
    sum += i
  else:
    if (i % 10 == minimum):
      sum += i
    else:
      sum += (i + (10 - (i % 10)))
print(sum)

input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
  if (i < 4):
    if (array[size - i - 1] - array[0] > k):
      print(':(')
      break
  if (i < 3):
    if (array[size - i - 1] - array[1] > k):
      print(':(')
      break
  if (i < 2):
    if (array[size - i - 1] - array[2] > k):
      print(':(')
      break
  if (i < 1):
    if (array[size - i - 1] - array[3] > k):
      print(':(')
      break
  if (i == 4):
    print('Yay')

array1 = [int(input()) for i in range(6)]
array2 = input[:5]
k = array1[5] 

for i in range(5):
    if (i < 4):
        if (array2[4 - i] - array2[0] > k):
            print(':(')
            break
    if (i < 3):
        if (array2[4 - i] - array2[1] > k):
            print(':(')
            break
    if (i < 2):
        if (array2[4 - i] - array2[2] > k):
            print(':(')
            break
    if (i < 1):
        if (array2[4 - i] - array2[3] > k):
            print(':(')
            break
    if (i == 4):
        print('Yay!')

array1 = [int(input()) for i in range(5)]
array2 = [i for i in array1 if i % 10 == 0]
array3 = [i for i in array1 if i % 10 =! 0]
array4 = [i % 10 for i in array3]
sum1 = 0
sum2 = sum(array2)
if (len(array3) != 0):
  idx = array4.index(min(array4))
  for k, i in enumerate(array3):
    if (k == idx):
      sum1 += i
    else:
      sum1 += i + (10 - i % 10)
  print(sum1 + sum2)

input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
  	if (i < 4):
      if (array[size - i] - array[0] > k):
        print(':(')
        break
    if (i < 3):
      if (array[size - i] - array[1] > k):
      	print(':(')
        break
    if (i < 2):
      if (array[size - i] - array[2] > k):
      	print(':(')
        break
	if (i < 1):
      if (array[size - i] - array[3] > k):
        print(':(')
        break
    if (i == 4):
      print('Yay')

input = []
array = []
input = [int(input()) for i in range(6)]
array = input[:5]
k = input[5] 
size = len(array)
for i in range(size):
    if (i < 4):
        if (array[size - i - 1] - array[0] > k):
            print(':(')
            break
    if (i < 3):
        if (array[size - i - 1] - array[1] > k):
            print(':(')
            break
    if (i < 2):
        if (array[size - i - 1] - array[2] > k):
            print(':(')
            break
    if (i < 1):
        if (array[size - i - 1] - array[3] > k):
            print(':(')
            break
    if (i == 4):
        print('Yay!')

array1 = [int(input()) for i in range(6)]
array2 = array1[:5]
k = array1[5] 
 
for i in range(5):
  if (i < 4 and array2[4 - i] - array2[0] > k):
    print(':(')
    break
  if (i < 3 and array2[4 - i] - array2[1] > k):
    print(':(')
    break
  if (i < 2 and array2[4 - i] - array2[2] > k):
    print(':(')
    break
  if (i < 1 and array2[4 - i] - array2[3] > k):
    print(':(')
    break
  if (i == 4):
    print('Yay!')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted