Submission #8884448


Source Code Expand

#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n,z,w = LI()
a = LI()
if n == 1:
    ans = abs(a[0]-w)
else:
    ans = max(abs(a[-2] - a[-1]),abs(a[-1] - w))
print(ans)

Submission Info

Submission Time
Task D - ABS
User nrkt
Language PyPy3 (2.4.0)
Score 500
Code Size 683 Byte
Status AC
Exec Time 178 ms
Memory 38768 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 167 ms 38256 KB
example_1 AC 161 ms 38256 KB
example_2 AC 165 ms 38256 KB
example_3 AC 171 ms 38256 KB
one_0 AC 160 ms 38256 KB
one_1 AC 164 ms 38256 KB
one_2 AC 164 ms 38256 KB
one_3 AC 170 ms 38256 KB
one_4 AC 165 ms 38256 KB
one_5 AC 164 ms 38384 KB
one_6 AC 172 ms 38256 KB
one_7 AC 166 ms 38256 KB
rand_0 AC 165 ms 38640 KB
rand_1 AC 165 ms 38256 KB
rand_10 AC 171 ms 38640 KB
rand_11 AC 170 ms 38256 KB
rand_12 AC 172 ms 38640 KB
rand_13 AC 165 ms 38640 KB
rand_14 AC 169 ms 38640 KB
rand_15 AC 163 ms 38256 KB
rand_2 AC 165 ms 38640 KB
rand_3 AC 164 ms 38640 KB
rand_4 AC 178 ms 38640 KB
rand_5 AC 177 ms 38640 KB
rand_6 AC 163 ms 38640 KB
rand_7 AC 168 ms 38640 KB
rand_8 AC 169 ms 38768 KB
rand_9 AC 165 ms 38640 KB