Submission #8883980
Source Code Expand
#!usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop import sys import math import bisect import random def LI(): return [int(x) for x in sys.stdin.readline().split()] def I(): return int(sys.stdin.readline()) def LS():return [list(x) for x in sys.stdin.readline().split()] def S(): return list(sys.stdin.readline())[:-1] def IR(n): return [I() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] def LSR(n): return [LS() for i in range(n)] sys.setrecursionlimit(1000000) mod = 1000000007 def solve(): n,x,y = LI() a = LI() ans = abs(a[-1]-y) if n > 1: ans = max(ans,abs(a[-2]-a[-1])) print(ans) return #Solve if __name__ == "__main__": solve()
Submission Info
Submission Time | |
---|---|
Task | D - ABS |
User | dn6049949 |
Language | PyPy3 (2.4.0) |
Score | 500 |
Code Size | 835 Byte |
Status | AC |
Exec Time | 177 ms |
Memory | 39280 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 500 / 500 | ||||
Status |
|
|
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 | 173 ms | 38512 KB |
example_1 | AC | 172 ms | 38512 KB |
example_2 | AC | 169 ms | 38512 KB |
example_3 | AC | 169 ms | 38512 KB |
one_0 | AC | 170 ms | 38512 KB |
one_1 | AC | 169 ms | 38512 KB |
one_2 | AC | 169 ms | 38512 KB |
one_3 | AC | 170 ms | 38512 KB |
one_4 | AC | 169 ms | 38512 KB |
one_5 | AC | 170 ms | 38512 KB |
one_6 | AC | 168 ms | 38512 KB |
one_7 | AC | 170 ms | 38512 KB |
rand_0 | AC | 172 ms | 39280 KB |
rand_1 | AC | 169 ms | 38512 KB |
rand_10 | AC | 172 ms | 39152 KB |
rand_11 | AC | 170 ms | 38512 KB |
rand_12 | AC | 173 ms | 39152 KB |
rand_13 | AC | 172 ms | 39152 KB |
rand_14 | AC | 172 ms | 39152 KB |
rand_15 | AC | 170 ms | 38512 KB |
rand_2 | AC | 173 ms | 39152 KB |
rand_3 | AC | 174 ms | 39152 KB |
rand_4 | AC | 172 ms | 39280 KB |
rand_5 | AC | 172 ms | 39152 KB |
rand_6 | AC | 177 ms | 39152 KB |
rand_7 | AC | 174 ms | 39152 KB |
rand_8 | AC | 175 ms | 39152 KB |
rand_9 | AC | 173 ms | 39152 KB |