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):
s = [input() for i in range(3)]
temp = 0
for i in range(len(s)-1):
  for j in range(i):
    if int(s[i])-int(s[j]) > int(s[5]):
      temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

import math
n = [int(input()) for i in range(6)]
temp = 9
answer = 0
for i in n:
  last_dig = i % 10
  if last_dig < temp:
    temp = last_dig
  answer += math.ceil(i/10)*10
print(answer - 10 + temp)

temp = input().split()
a, b, c, d, e, k = int(temp[0]), int(temp[1]), int(temp[2]), int(temp[3]), int(temp[4]), int(temp[5])
answer = 0
if e - d > k:
  answer += 1
if d - c > k:
  answer += 1
if c - b > k:
  answer += 1
if b - a > k:
  answer += 1
if answer == 0:
  print('Yay!')
else:
  print(':(')

s = [input() for i in range(3)]
temp = 0
if int(s[1])-int(s[0]) > int(s[5]):
  temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

import math
n = [int(input()) for i in range(5)]
temp = 9
answer = 0
for i in n:
  last_dig = i % 10
  if last_dig <= temp:
    temp = last_dig
  answer += math.ceil(i/10)*10
print(answer - 10 + temp)

i = [int(input()) for i in range(5)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp == 0:
  print('Yay!')
else:
  print(':(')


i = [int(input()) for i in range(5)]
print(':(')

i = [int(input()) for i in range(5)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[3] - i[2] > i[4]:
  temp += 1
if i[2] - i[1] > i[4]:
  temp += 1  
if i[1] - i[0] > i[4]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

i = [int(input()) for i in range(5)]
temp = 0
for j in range(len(i)-1):
  for k in range(j-1):
    if i[j] - i[k] > i[5]:
      temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')


s = [int(input()) for i in range(3)]
temp = 0
for i in range(len(s)-1):
  for j in range(i):
    if s[i]-s[j] > s[5]:
      temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

i = [int(input()) for i in range(3)]
temp = 0
if i[1] - i[0] > i[5]:
  temp += 1
if temp == 0:
  print('Yay!')
else:
  print(':(')

i = [int(input()) for i in range(6)]
temp = 0
if i[4] - i[3] > i[5]:
  temp += 1
if i[4] - i[2] > i[5]:
  temp += 1
if i[4] - i[1] > i[5]:
  temp += 1
if i[4] - i[0] > i[5]:
  temp += 1
if i[3] - i[2] > i[5]:
  temp += 1
if i[3] - i[1] > i[5]:
  temp += 1
if i[3] - i[0] > i[5]:
  temp += 1
if i[2] - i[1] > i[5]:
  temp += 1
if i[2] - i[0] > i[5]:
  temp += 1  
if i[1] - i[0] > i[5]:
  temp += 1  
if temp != 0:
  print(':(')
else:
  print('Yay!')

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted