Submission #8772792


Source Code Expand

N,Z,W = map(int,input().split())
A = list(map(int,input().split()))
if N == 1:
  print(abs(A[0]-W))
  exit()
  
if abs(A[-1]-A[-2]) >= abs(A[-1]-W):
  print(abs(A[-1]-A[-2]))
else:
  print(abs(A[-1]-W))

Submission Info

Submission Time
Task D - ABS
User yagi3
Language Python (3.4.3)
Score 500
Code Size 213 Byte
Status AC
Exec Time 18 ms
Memory 3188 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 4
AC × 28
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All example_0, example_1, example_2, example_3, one_0, one_1, one_2, one_3, one_4, one_5, one_6, one_7, rand_0, rand_1, rand_10, rand_11, rand_12, rand_13, rand_14, rand_15, rand_2, rand_3, rand_4, rand_5, rand_6, rand_7, rand_8, rand_9
Case Name Status Exec Time Memory
example_0 AC 17 ms 3060 KB
example_1 AC 17 ms 2940 KB
example_2 AC 17 ms 2940 KB
example_3 AC 17 ms 3060 KB
one_0 AC 17 ms 2940 KB
one_1 AC 17 ms 3060 KB
one_2 AC 17 ms 2940 KB
one_3 AC 17 ms 3060 KB
one_4 AC 17 ms 2940 KB
one_5 AC 17 ms 3060 KB
one_6 AC 17 ms 3060 KB
one_7 AC 17 ms 3060 KB
rand_0 AC 18 ms 3188 KB
rand_1 AC 17 ms 3060 KB
rand_10 AC 17 ms 3188 KB
rand_11 AC 17 ms 3060 KB
rand_12 AC 18 ms 3188 KB
rand_13 AC 18 ms 3188 KB
rand_14 AC 18 ms 3188 KB
rand_15 AC 17 ms 3060 KB
rand_2 AC 18 ms 3188 KB
rand_3 AC 18 ms 3188 KB
rand_4 AC 18 ms 3188 KB
rand_5 AC 18 ms 3060 KB
rand_6 AC 17 ms 3188 KB
rand_7 AC 18 ms 3060 KB
rand_8 AC 18 ms 3188 KB
rand_9 AC 18 ms 3188 KB