s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s298139227
p03550
u343523393
1554436964
Python
Python (3.4.3)
py
Runtime Error
18
3188
113
N,Z,W =list(map(int,input().split())) A=list(map(int,input().split())) print(max(abs(W-A[-1]),abs(A[-1]-A[-2])))
s676706477
p03550
u343523393
1554436890
Python
Python (3.4.3)
py
Runtime Error
19
3188
113
N,W,Z =list(map(int,input().split())) A=list(map(int,input().split())) print(max(abs(W-A[-1]),abs(A[-1]-A[-2])))
s076226266
p03550
u171366497
1554235970
Python
Python (3.4.3)
py
Runtime Error
17
2940
104
N,Z,W=map(int,input().split()) A=list(map(int,input().split())) print(max(abs(A[-1]-W),abs(A[-2]-A[-1]))
s657318637
p03550
u099566485
1551755752
Python
Python (3.4.3)
py
Runtime Error
18
3188
207
#078-C def IL(): return list(map(int,input().split())) def SL(): return input().split() def I(): return int(input()) def S(): return list(input()) n,z,w=IL() a=IL() print(max(abs(a[-1]-w),abs(a[-1]-a[-2])))
s504660456
p03550
u785578220
1550085283
Python
Python (3.4.3)
py
Runtime Error
17
3188
110
a,b,c=map(int,input().split()) x = list(map(int,input().split())) print(max(abs(b-x[-1]),abs(x[-1]-x[-2])))
s796568235
p03550
u533885955
1549663142
Python
Python (3.4.3)
py
Runtime Error
18
3188
121
N,Z,W = map(int,input().split()) a = list(map(int,input().split())) A = abs(a[-1]-W) B = abs(a[-2]-a[-1]) print(max(A,B))
s427873745
p03550
u316386814
1548908370
Python
Python (3.4.3)
py
Runtime Error
18
3188
140
n, z, w = list(map(int, input().split())) li = list(map(int, input().split())) ans = max(abs(w - li[-1]), abs(li[-1] - li[-2])) print(ans)
s966462368
p03550
u145035045
1548198893
Python
PyPy3 (2.4.0)
py
Runtime Error
2111
114520
541
n, z, w = map(int, input().split()) aList = list(map(int, input().split())) INF = 10 ** 20 def check(xScore, yScore, pointer, turn): if pointer == n:return abs(xScore - yScore) if turn == 0: ret = 0 for nextPointer in range(pointer, n): ret = max(ret, check(aList[nextPointer], yScor...
s174117872
p03550
u794250528
1547920915
Python
PyPy3 (2.4.0)
py
Runtime Error
914
46296
553
n, z, w = map(int, input().split()) a = list(map(int, input().split())) cache = {} def f(idx, turn, x, y): if idx == n: return abs(x - y) key = (idx, turn) if key in cache: return cache[key] if turn == 0: ans = -float('inf') for i in range(idx, n): ans...
s902227640
p03550
u794250528
1547920862
Python
Python (3.4.3)
py
Runtime Error
422
4160
553
n, z, w = map(int, input().split()) a = list(map(int, input().split())) cache = {} def f(idx, turn, x, y): if idx == n: return abs(x - y) key = (idx, turn) if key in cache: return cache[key] if turn == 0: ans = -float('inf') for i in range(idx, n): ans...
s269531552
p03550
u588341295
1547500598
Python
Python (3.4.3)
py
Runtime Error
19
3064
653
# -*- coding: utf-8 -*- # 再帰呼び出しの回数制限(デフォルト1000) sys.setrecursionlimit(10 ** 9) N, Z, W = map(int, input().split()) aN = list(map(int, input().split())) def dfs(turn, rest, x, y): if rest == 0: return abs(x - y) if turn % 2 == 0: mx = -1 for i in range(N-rest, N): x = aN[i...
s494654105
p03550
u588341295
1547492844
Python
Python (3.4.3)
py
Runtime Error
2104
4144
565
# -*- coding: utf-8 -*- N, Z, W = map(int, input().split()) aN = list(map(int, input().split())) def dfs(turn, rest, x, y): if rest == 0: return abs(x - y) if turn % 2 == 0: mx = -1 for i in range(N-rest, N): x = aN[i] idx = i+1 mx = max(dfs(turn+1,...
s392439448
p03550
u731028462
1544024177
Python
Python (3.4.3)
py
Runtime Error
18
3188
126
N,Z,W = list(map(int,input().split())) a = list(map(int,input().split())) ans = max(abs(a[-1]-a[-2]), abs(W-a[-1])) print(ans)
s019675211
p03550
u833070958
1538090636
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
61148
696
n, z, w = map(int, input().split()) aa = list(map(int, input().split())) memo = {} def act(xlast, ylast, turn): x = z if xlast == -1 else aa[xlast] y = w if ylast == -1 else aa[ylast] if xlast == n - 1 or ylast == n - 1: return abs(x - y) if (xlast, ylast, turn) in memo: return me...
s100570089
p03550
u833070958
1538090435
Python
Python (3.4.3)
py
Runtime Error
2108
10216
696
n, z, w = map(int, input().split()) aa = list(map(int, input().split())) memo = {} def act(xlast, ylast, turn): x = z if xlast == -1 else aa[xlast] y = w if ylast == -1 else aa[ylast] if xlast == n - 1 or ylast == n - 1: return abs(x - y) if (xlast, ylast, turn) in memo: return me...
s954687591
p03550
u952708174
1535146446
Python
Python (3.4.3)
py
Runtime Error
18
3188
656
def d_abs(N, Z, W, A): # 山札の枚数が1枚なら、Xがそれを引いて終わる。山札が2枚以上なら、 # Xは初手でN-1枚目かN枚目かのどちらかスコアが大きくなる方を取るのが最善。 # そうしなかった場合、Xが最善手を取らなかったことになって前提に反するか、 # Yが最善手を取ってスコアabs(A[N - 1] - A[N - 2])になるかのどちらかである ans = abs(A[0] - W) if N == 1 else max(abs(A[N - 1] - W), abs(A[N - 1] - A[N - 2])) return ans N,Z,W = [i...
s159661704
p03550
u135282263
1533873054
Python
Python (3.4.3)
py
Runtime Error
17
3064
188
n = int(input()) a = list(map(int,input().split())) x=0 y=0 a.sort() i=n-1 while (i>0): if a[i-1]==a[i]: x=y y=a[i] if x>0: break i-=2 else: i-=1 print(x*y)
s170678758
p03550
u439396449
1529883714
Python
Python (3.4.3)
py
Runtime Error
384
4392
657
N, Z, W = map(int, input().split()) A = [int(x) for x in input().split()] memo = [[None for _ in range(2)] for _ in range(2010)] def f(i, p, x, y): """ i番目にx, yが手持ちのとき、プレイヤーpが引いたときのスコア """ if i == N: return abs(x - y) if memo[i][p]: return memo[i][p] if p == 0: score ...
s982309657
p03550
u439396449
1529883017
Python
Python (3.4.3)
py
Runtime Error
410
4324
657
N, Z, W = map(int, input().split()) A = [int(x) for x in input().split()] memo = [[None for _ in range(2)] for _ in range(N + 1)] def f(i, p, x, y): """ i番目にx, yが手持ちのとき、プレイヤーpが引いたときのスコア """ if i == N: return abs(x - y) if memo[i][p]: return memo[i][p] if p == 0: score...
s175143775
p03550
u467736898
1528924370
Python
Python (3.4.3)
py
Runtime Error
2104
4352
644
N, Z, W = map(int, input().split()) A = list(map(int, input().split())) L = [] D = [] def rec(x, y, n, turn): xp, yp = x, y C = [] for i in range(n+1, N+1): x, y = xp, yp if i == N: C.append(abs(A[-1]-y if turn else x-A[-1])) continue if turn: x = ...
s481973695
p03550
u329709276
1528419138
Python
Python (3.4.3)
py
Runtime Error
17
3064
199
N,Z,W = map(int,input().split()) a = list(map(int,input().split())) amax = max(*a,Z,W) amin = min(*a,Z,W) alast = a[N-1] if N == 1: print(abs(W-a[0])) exit() print(max(amax-alast,amin-alast))
s504047161
p03550
u884982181
1528314027
Python
Python (3.4.3)
py
Runtime Error
19
3188
528
N,Z,W = map(int,input().split()) a = list(map(int,input().split())) owa = len(a) dai = abs(Z-W) syou = abs(Z-W) if abs(Z - W) >= abs(min(a) - max(a)): a = [] while a: for i in range(len(a)): if dai <= abs(a[i] - W): dai = max(abs(a[i] - W),dai) iti = i + 0 Z = a[iti] if iti == owa: break a ...
s774432655
p03550
u925364229
1528244171
Python
Python (3.4.3)
py
Runtime Error
17
2940
92
N,Z,W = map(int,input().split(" ")) a = list(map(int,input().split(" ")) print(abs(a[-1]-W))
s835605909
p03550
u064408584
1522123714
Python
Python (3.4.3)
py
Runtime Error
17
3060
123
if len(a)==1: print(abs(a[-1]-w)) elif abs(a[-2]-a[-1])>abs(a[-1]-w): print(abs(a[-2]-a[-1])) else: print(abs(a[-1]-w))
s499489511
p03550
u702582248
1521603133
Python
Python (3.4.3)
py
Runtime Error
18
3188
131
n,z,w=map(int,input().split()) a=list(map(int,input().split())) a[-1], b = w, a[-1] print(max((x-b) if x > a else b-x for x in a))
s570332721
p03550
u273201018
1521249474
Python
Python (3.4.3)
py
Runtime Error
2154
721204
550
import numpy as np N, Z, W = map(int, input().split()) A = np.array(list(map(int, input().split()))) f = [] if N > 2: for i in range(0, 2**(N-1)): # 1 枚目は必ず X string = str(bin(i))[2:] f.append(['1'] + ['0'] * (N - 1 - len(string)) + list(string)) else: f = ['1'] F = np.array(f) F = (F == '1...
s637920449
p03550
u132434645
1520983275
Python
Python (2.7.6)
py
Runtime Error
92
58924
547
cm = None cM = None def m(a, n, i, w): if w in cm[i]: return cm[i][w] m = abs(a[n - 1] - w) for k in range(i, n - 1): m = min(m, abs(M(a, n, k + 1, a[k]))) cm[i][w] = m return m def M(a, n, i, w): if w in cM[i]: return cM[i][w] M = abs(a[n - 1] - w) for k in range(i, n - 1): ...
s608175455
p03550
u858136677
1518042992
Python
Python (3.4.3)
py
Runtime Error
18
3064
180
def max(a,b): if a>=b: return a else: return b n,z,w = map(int,input().split()) a = list(map(int,input().split())) print(max(abs(a[n-1]-w),abs(a[n-1]-a[n-2]))
s698317444
p03550
u846150137
1514597741
Python
Python (3.4.3)
py
Runtime Error
18
3188
159
n,z,w=[int(i) for i in input().split(' ')] a=[int(i) for i in input().split(' ')] l0=abs(a[-1]-a[-2]) l1=abs(a[-1]-w) if l1>l0: print(l1) else: print(l0)
s731678076
p03550
u563710899
1512178775
Python
Python (3.4.3)
py
Runtime Error
2104
12156
500
N,Z,W=map(int,input().split()) a=list(map(int,input().split())) def ans(Z,W,A): length=len(A) if length==0: return abs(Z-W) else: i_list=[] for i in range(length): j_list=[] for j in range(length-i-1): j_list.append(ans(A[i],A[i+j+1],A[i+j+2:]...
s839515356
p03550
u847867174
1512010191
Python
Python (3.4.3)
py
Runtime Error
18
3188
371
def getNum(): N,Z,W = map(int,input().split()) cards = input() cards = cards.split() return N,Z,W,cards def cal(N,Z,W,cards): cand1 = abs(W - int(cards[-1])) cand2 = abs(int(cards[-1]) - int(cards[-2])) if cand1 >= cand2: print(cand1) else: print(cand2) def main(): ...
s454720179
p03550
u880646180
1511151088
Python
Python (3.4.3)
py
Runtime Error
17
2940
253
s1 = input() s2 = input() x, y, z = [int(i) for i in s1.split()] l = [int(i) for i in s2.split()] if x = 1: print(abs(z - l[x-1])) else: if abs(z - l[x-1]) > abs(l[x-1] - l[x-2]): print(abs(z - l[x-1])) else: print(abs(l[x-1] - l[x-2]))
s431274743
p03550
u880646180
1511133320
Python
Python (3.4.3)
py
Runtime Error
18
2940
223
x, y, z = [int(i) for i in s.split()] l = [int(i) for i in s.split()] if x = 1: print(abs(z - l[x-1])) else: if abs(z - l[x-1]) > abs(l[x-1] - l[x-2]): print(abs(z - l[x-1])) else: print(abs(l[x-1] - l[x-2]))
s097707941
p03550
u952708174
1510467555
Python
Python (3.4.3)
py
Runtime Error
17
3060
573
def D_abs(N, Z, W, A): if N == 1: # Xは山札のたった1枚を引かねばならず、Yは山札から1枚も引けないから return abs(A[0] - W) else: # 山札は一番上しか見れないので、 # Xがa_{N-1}を持ち、Yがa_{N}を持つか、 # Xがa_{N}を持ち、YがWまたはa_{N-1}を持つかの # どちらかで終了する。 return max(abs(A[N - 1] - W), abs(A[N - 1] - A[N - 2])) N,Z,W = [i...
s647251606
p03550
u498401785
1510460738
Python
Python (3.4.3)
py
Runtime Error
21
3188
718
nzw = input().split() n = int(nzw[0]) z = int(nzw[1]) w = int(nzw[2]) an = input().split() turn_x = True now_idx = 0 for j in range(n): tmp_idx = now_idx if(turn_x): max_dif = -1 for i in range(now_idx, n): if(abs(z - int(an[i])) >= max_dif): max_dif = abs(z - int(an[...
s890825467
p03550
u451017206
1510459137
Python
Python (3.4.3)
py
Runtime Error
17
3188
120
N, Z, W = map(int, input().split()) a = [int(i) for i in input().split()] print(max(abs(a[-1] - W), abs(a[-2] - a[-1])))
s370993967
p03550
u411537765
1510457989
Python
Python (3.4.3)
py
Runtime Error
20
3188
278
N, Z, W = map(int, input().split()) a = [int(n) for n in input().split()] b = a.pop() max = 0 if nota == []: for n in a: if abs(n - b) > max: max = abs(n - b) if abs(n - Z) > max: max = abs(n - Z) if abs(n - W) > max: max = abs(n - W) print(max)
s790478971
p03550
u498401785
1510457960
Python
Python (3.4.3)
py
Runtime Error
20
3188
767
nzw = input().split() n = int(nzw[0]) z = int(nzw[1]) w = int(nzw[2]) an = input().split() turn_x = True now_idx = 0 for j in range(n): tmp_idx = now_idx + 1 if(tmp_idx == n - 1): break if(turn_x): max_dif = -1 for i in range(now_idx + 1, n): if(abs(w - int(an[i])) >= max...
s570716346
p03550
u698535708
1510457956
Python
Python (3.4.3)
py
Runtime Error
2104
10092
817
def fx(p, x, y): global a, X if p == len(a): return abs(x - y) if x in X[p] and y in X[p][x]: return X[p][x][y] ret = 0 for i in range(p, len(a)): ret = max(fy(i+1, a[i], y), ret) if x not in X[p]: X[p][x] = {y: ret} else: X[p][x][y] = ret return r...
s226856807
p03550
u224050758
1510457902
Python
Python (3.4.3)
py
Runtime Error
26
3564
512
import math from collections import deque N, Z, W = map(int, input().split()) DECK = list(map(int, input().split())) def ans(a, b): print(a - b) def main(): deck = deque([]) deck.extend(DECK) first = deck.popleft() x = max(Z, first) y = W deck_max = max(deck) deck_min = min(deck) ...
s489358889
p03550
u698535708
1510457831
Python
Python (3.4.3)
py
Runtime Error
2104
5300
817
def fx(p, x, y): global a, X if p == len(a): return abs(x - y) if x in X[p] and y in X[p][x]: return X[p][x][y] ret = 0 for i in range(p, len(a)): ret = max(fy(i+1, a[i], y), ret) if x not in X[p]: X[p][x] = {y: ret} else: X[p][x][y] = ret return r...
s887696513
p03550
u498401785
1510457826
Python
Python (3.4.3)
py
Runtime Error
19
3188
727
nzw = input().split() n = int(nzw[0]) z = int(nzw[1]) w = int(nzw[2]) an = input().split() turn_x = True now_idx = 0 for j in range(n): tmp_idx = now_idx + 1 if(turn_x): max_dif = -1 for i in range(now_idx + 1, n): if(abs(w - int(an[i])) >= max_dif): max_dif = abs(w -...
s721450138
p03550
u779602548
1510457549
Python
Python (3.4.3)
py
Runtime Error
17
3188
220
#http://abc078.contest.atcoder.jp/ # -*- coding: utf-8 -*- n, z, w = map(int,input().split()) a = list(map(int,input().split())) ans = [] ans.append( abs( a[-1] - w ) ) ans.append( abs( a[-1] - a[-2] ) ) print(max(ans))
s827191733
p03550
u942033906
1510457413
Python
Python (3.4.3)
py
Runtime Error
18
3188
253
N,Z,W = map(int,input().split()) a = list(map(int,input().split())) std = abs(Z-W) last = a[0] absList = [abs(last-i) for i in a] ans = ans(last-W) for i in range(N-1): testList = absList[i+1:] if min(absList) > ans: ans = max(absList) print(ans)
s595846502
p03550
u698535708
1510457222
Python
Python (3.4.3)
py
Runtime Error
2104
4076
457
def fx(p, x, y): global a if p == len(a): return abs(x - y) ret = 0 for i in range(p, len(a)): ret = max(fy(i+1, a[i], y), ret) return ret def fy(p, x, y): global a if p == len(a): return abs(x - y) ret = float('inf') for i in range(p, len(a)): ret =...
s979696078
p03550
u808427016
1510456515
Python
Python (3.4.3)
py
Runtime Error
2104
15824
868
import sys line = sys.stdin.readline().strip() n, z, w = map(int, line.split()[:3]) line = sys.stdin.readline().strip() a = list(map(int, line.split()[:n])) #print(n, z, w) #print(a) def think_x(z, w, a, turn): if len(a) == 0: return abs(z - w) result = 0 result_i = None for i in range(len(a)):...
s310783652
p03550
u227020436
1510456124
Python
Python (2.7.6)
py
Runtime Error
2105
50596
788
#!/usr/bin/python # coding: utf-8 from sys import stdin memo = {} # それぞれ z 枚目, w 枚目を持っている局面での最適解 def solve(z, w, player): global a, memo n = max(z, w) + 1 # 取り終わっている枚数 if n == len(a): return abs(a[z] - a[w]) if (z, w, player) in memo: return memo[(z, w, player)] m = 0 if player == 0 else 100000000...
s462818199
p03550
u909643606
1510455856
Python
Python (3.4.3)
py
Runtime Error
17
2940
370
n,z,w=[int(i) for i in input().split()] a=[int(i) for i in input().split()] max=0 min=0 maxi=0 mini=0 for i in range(n): if a[i]>max: max=a[i] maxi=i if a[i]<min min=a[i] mini=i if a_max=max(a) a_min=min(a) a_last=a[-1] #print(a_max,a_min,a_last) answer=min(abs(a_last-w), ab...
s321965415
p03550
u354915818
1510454580
Python
Python (3.4.3)
py
Runtime Error
1266
21664
300
# coding: utf-8 # Here your code ! #!/usr/bin/env python3 # -*- coding: utf-8 -*- import numpy as np import bisect N , Z ,W = input().split() N = int(N) Z = int(Z) W = int(W) a = input().split() a = [int(i) for i in reversed(a)] rst = [ np.abs(W - a[0]) , np.abs(a[1] - a[0]) ] print(np.max(rst))
s358700757
p03550
u319612498
1510453730
Python
Python (3.4.3)
py
Runtime Error
17
2940
124
a=int(input()) 2.for i in range(a): 3. if(i*i>a): 4. print((i-1)*(i-1)) 5. break 6. 7.if a<=2: print("1")
s851086675
p03550
u319612498
1510453520
Python
Python (3.4.3)
py
Runtime Error
17
2940
4
gfdz
s710484899
p03551
u773065853
1577085440
Python
Python (3.4.3)
py
Runtime Error
17
3064
241
data = input().split(" ") n = int(data[0]) z = int(data[1]) w = int(data[2]) a = input().split(" ") if n != 1: b = int(a[n-2]) c = int(a[n-1]) ans = abs(w-c) if ans <= abs(b-c): ans = abs(b-c) print(ans) else: print(abs(w-int(a[0])))
s168704378
p03551
u773065853
1577085165
Python
Python (3.4.3)
py
Runtime Error
17
3064
193
data = input().split(" ") n = int(data[0]) z = int(data[1]) w = int(data[2]) a = input().split(" ") b = int(a[n-2]) c = int(a[n-1]) ans = abs(w-c) if ans <= abs(b-c): ans = abs(b-c) print(ans)
s831485535
p03551
u389910364
1560364717
Python
Python (3.4.3)
py
Runtime Error
17
3060
382
import os import sys if os.getenv("LOCAL"): sys.stdin = open("_in.txt", "r") sys.setrecursionlimit(2147483647) INF = float("inf") N, M = list(map(int, sys.stdin.readline().split())) N, M = list(map(int, sys.stdin.readline().split())) # 1 回の時間は M*1900 + (N-M)*100 time = M * 1900 + (N - M) * 100 # AC になる確率 p_ac =...
s325801317
p03551
u854685751
1529610369
Python
Python (3.4.3)
py
Runtime Error
17
2940
122
n, m = input().split(" ") # n, m = 100, 5 gacha = 1900 * m state = 100 * (n-m) res = (gacha + state) * 2**m print(res)
s854500386
p03551
u278832126
1529537688
Python
Python (3.4.3)
py
Runtime Error
17
3060
200
N, Z, W = map(int, input().split()) cards = list(map(int, input().split())) if N == 1: print(cards[0] - W) else: x = abs(cards[-1] - cards[-2]) y = abs(cards[-1] - W) print(max(x, y))
s965736798
p03551
u278832126
1529529695
Python
Python (3.4.3)
py
Runtime Error
17
2940
105
def main(N, M): n = 1 for _ in range(M): n *= 2 print n * ((N - M) * 100 + M * 1900)
s245831851
p03551
u278832126
1529529261
Python
Python (3.4.3)
py
Runtime Error
17
2940
74
n = 1 for _ in range(N): n *= 2 return n * ((M - N) * 100 + N * 1900)
s649288126
p03551
u520158330
1525722263
Python
Python (3.4.3)
py
Runtime Error
17
3060
177
N,M = map(int,input().split()) T = (1900*M)+(100*(N-M)) C = [pow(2,M),pow(2,M)-1] if M==4: M_set[1]=3 a = T*C[0] if a%C[1]==0: a = a//C[1] print(a) else: print(a)
s466511658
p03551
u520158330
1525722211
Python
Python (3.4.3)
py
Runtime Error
17
3060
167
N,M = map(int,input().split()) T = (1900*M)+(100*(N-M)) C = [pow(2,M),pow(2,M)-1] if M==4: M_set[1]=3 a = T*C[0] if a%C[1]==0: print(a//C[1]) else: print(a)
s935699654
p03551
u520158330
1525722080
Python
Python (3.4.3)
py
Runtime Error
18
3060
174
N,M = map(int,input().split()) T = (1900*M)+(100*(N-M)) C = [pow(2,M),pow(2,M)-1] if M==4: M_set[1]=3 a = T*C[0] if a//C[1] %C[1]==0: print(a//C[1]) else: print(a)
s983185339
p03551
u520158330
1525721856
Python
Python (3.4.3)
py
Runtime Error
17
3060
166
N,M = map(int,input().split()) T = (1900*M)+(100*(N-M)) C = [pow(2,M),pow(2,M)-1] if M==4: M_set[1]=3 ans = T*C[0]//C[1] if ans%C[1]==0 else T*C[0] print(ans)
s300930135
p03551
u520158330
1525721739
Python
Python (3.4.3)
py
Runtime Error
17
3060
151
N,M = map(int,input().split()) T = (1900*M)+(100*(N-M)) C = [pow(2,M),pow(2,M)-1] if M==4: M_set[1]=3 print(T*C[0]//C[1] if ans%C[1]==0 else T*C[0])
s718228025
p03551
u425351967
1515601178
Python
PyPy3 (2.4.0)
py
Runtime Error
177
38640
785
N = int(input()) a = [int(n) for n in input().split()] infty = 10**15 res = 0 edge = [[0]*(N+2) for _ in range(N+2)] for i, t in enumerate(a): if t > 0: edge[i][N+1] = t res += t else: edge[N][i] = -t for i in range(1, N+1): for j in range(2, N//i + 1): edge[i-1][i*j-1] = i...
s531868402
p03551
u283229916
1514946269
Python
Python (3.4.3)
py
Runtime Error
18
3060
137
n,z,w=map(int,input().split()) a=list(map(int,input().split())) cand1=abs(a[-1]-a[-2]) cand2=abs(a[-1]-w) res=max(cand1,cand2) print(res)
s750591451
p03551
u722641375
1512531586
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
def main(): N,M = map(int(input().split())) print((1900*M+100*(N-M))*2**M) if __name__ == '__main__': main()
s694921779
p03551
u722641375
1512531510
Python
Python (3.4.3)
py
Runtime Error
17
2940
118
def main(): N,M = int(input().split()) print((1900*M+100*(N-M))*2**M) if __name__ == '__main__': main()
s368061592
p03551
u667084803
1511411757
Python
Python (3.4.3)
py
Runtime Error
18
3060
129
N,Z,W=map(int,input().split()) A=list(map(int,input().split())) ans1=abs(A[N-1]-W) ans2=abs(A[N-1]-A[N-2]) print(A[N-1],W,A[N-2])
s106336728
p03551
u495415554
1511118228
Python
Python (3.4.3)
py
Runtime Error
29
3564
1046
import itertools import copy # 最大公約数 def gcd(x, y): while y != 0: x, y = y, x%y return x # 宝石の数 N = int(input()) # 宝石の得点 a = list(map(int, input().split())) # 宝石の得点に負があるか否か if min(a) >= 0: # 全てを計算して出力 print(sum(a)) else: # 宝石の得点が負であるインデックスを取得 minus = [i for i,j in enumerate(a) if j<0]...
s556376795
p03551
u510295687
1510688829
Python
Python (3.4.3)
py
Runtime Error
23
3316
89
# coding: utf-8 N, rand = map(int, input().split()) print (2**rand)*1900 + (N-rand)*100
s868141868
p03551
u207707177
1510468862
Python
Python (3.4.3)
py
Runtime Error
19
3064
288
n = int(input()) a = [int(i) for i in input().split()] sum = 0 ans = 0 for i in range(n): x = n-i sum = 0 for j in range(n//x): sum += a[x*(j+1)-1] if sum < 0: for k in range(n//x): a[x*(k+1)-1] = 0 for j in range(n): ans += a[j] print(ans)
s252223576
p03551
u039623862
1510459159
Python
Python (3.4.3)
py
Runtime Error
17
2940
167
n, x, y = map(int, input().split()) a = list(map(int, input().split())) if n == 1: print(abs(a[-1] - y)) else: print(max(abs(a[-1] - y), abs(a[-1] - a[-2])))
s103283858
p03551
u340781749
1510454380
Python
Python (3.4.3)
py
Runtime Error
17
3060
163
n,z,w=map(int,input().split()) aa=input().split() an=int(aa[-1]) if len(aa) > 1: am=int(aa[-2]) print(max(abs(an-w),abs(an-am))) else: print(abs(an-w))
s437770307
p03552
u985949234
1593599542
Python
Python (3.8.2)
py
Runtime Error
126
58268
1152
from collections import defaultdict,deque from sys import stdin,setrecursionlimit import heapq,bisect,math,itertools,string,queue,datetime,copy import numpy as np setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, stdin.readline().split())) N,Z,W = inpl() Als = inpl...
s050017124
p03552
u985949234
1593598047
Python
Python (3.8.2)
py
Runtime Error
131
58424
955
from collections import defaultdict,deque from sys import stdin,setrecursionlimit import heapq,bisect,math,itertools,string,queue,datetime,copy import numpy as np setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, stdin.readline().split())) N,Z,W = inpl() Als = inpl...
s278657600
p03552
u572142121
1587516547
Python
Python (3.4.3)
py
Runtime Error
17
3060
126
A=list(map(int, input().split())) if N==1: print(abs(A[-1]-W)) else: a=abs(A[-1]-W) b=abs(A[-2]-A[-1]) print(max(a,b))
s874911475
p03552
u572142121
1587516467
Python
Python (3.4.3)
py
Runtime Error
18
3064
212
N,Z,W=map(int,input().split()) A=list(map(int, input().split())) if N==1: print(abs(A[-1]-W)) elif N==2: print(abs(A[-1]-W),abs(A[0]-A[-1])) else: a=abs(A[-1]-W) b=abs(max(A[:N-1])-A[-1]) print(max(a,b)
s339924682
p03552
u408620326
1581786360
Python
Python (3.4.3)
py
Runtime Error
2104
10376
661
import sys input = sys.stdin.readline N, Z, W = [int(x) for x in input().strip().split()] a = [int(x) for x in input().strip().split()] d = {} def minmax(x, y, c, f): # print('x={}, y={}, c={}, f={}'.format(x, y, c, f)) if (x, y, c, f) in d: return d[(x, y, c, f)] if c == N: return abs(x - y...
s354857491
p03552
u408620326
1581786195
Python
Python (3.4.3)
py
Runtime Error
2104
4068
572
import sys input = sys.stdin.readline N, Z, W = [int(x) for x in input().strip().split()] a = [int(x) for x in input().strip().split()] def minmax(x, y, c, f): # print('x={}, y={}, c={}, f={}'.format(x, y, c, f)) if c == N: return abs(x - y) if f == 0: ret = -float('inf') for i in r...
s319547146
p03552
u941407962
1579790227
Python
PyPy3 (2.4.0)
py
Runtime Error
230
43244
493
N, Y, Z = map(int, input().split()) As = list(map(int, input().split())) dpx, dpy = [0]*(N-1), [0]*(N-1) #dpx[i] = min(dpy[i+1]...dpy[N-2], abs(As[N-1]-As[i])) #dpy[i] = max(dpx[i+1]...dpx[N-2], abs(As[N-1]-As[i])) for i in range(N-2, -1, -1): mny, mxx = 10**10, 0 for j in range(i+1, N-1): mny = min(mny...
s260716935
p03552
u673361376
1575408937
Python
Python (3.4.3)
py
Runtime Error
17
3188
159
N,Z,W = map(int,input().split()) A = list(map(int,input().split())) if abs(A[-1]-A[-2]) >= abs(A[-1]-W): print(abs(A[-1]-A[-2])) else: print(abs(A[-1]-W))
s169321684
p03552
u899975427
1556310545
Python
Python (3.4.3)
py
Runtime Error
18
3188
113
n,z,w = map(int,input().split()) a = [int(i) for i in input().split()] print(max(abs(a[-1]-w),abs(a[-2]-a[-1])))
s679785818
p03552
u015768390
1550841452
Python
Python (3.4.3)
py
Runtime Error
18
3188
143
n,z,w=map(int,input().split()) A=[int(x) for x in input().split()] print(max(abs(A[n-2]-A[n-1]),abs(A[n-1],w))) if n!=1 else print(abs(a[0]-w))
s830286019
p03552
u598167418
1539541909
Python
PyPy2 (5.6.0)
py
Runtime Error
43
29036
119
n,z,w = map(int,raw_input().split()) arr = map(int,raw_input().split()) print max(abs(arr[-1]-w),abs(arr[-1]-arr[-2]))
s850498349
p03552
u536113865
1538602970
Python
Python (3.4.3)
py
Runtime Error
17
3188
156
ai = lambda: list(map(int,input().split())) n, z, w = ai() a = ai() if n == a: print(abs(a[-1]-w)) else: print(max(abs(a[-1]-w), abs(a[-1]-a[-2])))
s830731823
p03552
u439396449
1529884048
Python
Python (3.4.3)
py
Runtime Error
360
4328
712
N, Z, W = map(int, input().split()) A = [int(x) for x in input().split()] memo = [[None for _ in range(2)] for _ in range(N + 1)] def f(i, p, x, y): """ i番目にx, yが手持ちのとき、プレイヤーpが引いたときのスコア """ if i == N: return abs(x - y) if memo[i][p]: return memo[i][p] if p == 0: score...
s589353525
p03552
u098968285
1524526046
Python
PyPy3 (2.4.0)
py
Runtime Error
176
39536
302
N, Z, W = map(int, input().split()) a = list(map(int, input().split())) if N == 1: print(a[0] - W) else: x = abs(a[-2] - a[-1]) y = abs(a[-1] - W) z = min(abs(max(A) - A[-1]), abs(a[-2]-a[-1])) w = min(abs(min(A) - A[-1]), abs(a[-2]-a[-1])) ans = max(x, y) print(ans)
s691237221
p03552
u283229916
1514946278
Python
Python (3.4.3)
py
Runtime Error
18
3188
137
n,z,w=map(int,input().split()) a=list(map(int,input().split())) cand1=abs(a[-1]-a[-2]) cand2=abs(a[-1]-w) res=max(cand1,cand2) print(res)
s897250280
p03552
u283229916
1514946261
Python
Python (2.7.6)
py
Runtime Error
10
2568
137
n,z,w=map(int,input().split()) a=list(map(int,input().split())) cand1=abs(a[-1]-a[-2]) cand2=abs(a[-1]-w) res=max(cand1,cand2) print(res)
s795333186
p03552
u257974487
1512891553
Python
Python (3.4.3)
py
Runtime Error
17
2940
151
N, Z, W = map(int,input().split()) p = list(map(int,input().split())) a = abs(p[N-2] - p[N-1]) b = abs(p[N-1] - W) print(max(a, b))
s248674753
p03552
u257974487
1512886157
Python
Python (3.4.3)
py
Runtime Error
18
3188
125
N, Z, W = map(int,input().split()) p = list(map(int,input().split())) a = abs(p[1] - p[2]) b = abs(p[2] - W) print(max(a, b))
s622370166
p03552
u722641375
1512532507
Python
Python (3.4.3)
py
Runtime Error
18
3188
177
def main(): N,Z,W = map(int,input().split()) a = list(map(int,input().split())) print(max(abs(a[N-1]-W,abs(a[N-1]-a[N-2])))) if __name__ == '__main__': main()
s439175602
p03552
u343675824
1510457960
Python
Python (3.4.3)
py
Runtime Error
413
4096
732
N, Z, W = map(int, input().split()) aa = list(map(int, input().split())) aa = [W] + aa N += 1 dp = [[-1] * N for i in range(2)] def dfs(xy, n, prev): index = n if dp[xy][n] != -1: return dp[xy][n] if xy == 0: m = 0 else: m = 1 << 64 for i in range(n+1, N): if i == ...
s162815921
p03552
u548384403
1510455892
Python
Python (2.7.6)
py
Runtime Error
11
2692
159
[N,Z,W]=map(int,raw_input().split()) A=map(int,raw_input().split()) if abs(A[-1]-W)>abs(A[-1]-A[-2]): print abs(A[-1]-W) else: print abs(A[-1]-A[-2])
s867649502
p03552
u528224561
1510455244
Python
Python (3.4.3)
py
Runtime Error
2104
4108
647
INF = 1e14 def minim(base,x,y,a): score = INF n = len(base)-a if n == 0: return abs(x-y) for i in range(n): _sc = maxim(base,x,base[i+a],i+a+1) if score > _sc: score = _sc return score def maxim(base,x,y,a): score = 0 n = len(base)-a if n == 0: ...
s493058936
p03552
u528224561
1510454367
Python
Python (3.4.3)
py
Runtime Error
2104
15836
609
INF = 1e14 def minim(x,y,a): score = INF n = len(a) if n == 0: return abs(x-y) for i in range(n): _sc = maxim(x,a[i],a[i+1:]) if score > _sc: score = _sc return score def maxim(x,y,a): score = 0 n = len(a) if n == 0: return abs(x-y) for...
s166798677
p03552
u340781749
1510454148
Python
Python (3.4.3)
py
Runtime Error
17
3188
112
n,z,w=map(int,input().split()) aa=input().split() an,am=int(aa[-1]),int(aa[-2]) print(max(abs(an-w),abs(an-am)))
s663289265
p03552
u039623862
1510454056
Python
Python (3.4.3)
py
Runtime Error
2104
4744
430
import functools n,x,y = map(int, input().split()) a = list(map(int, input().split())) @functools.lru_cache() def solve(x_turn, idx, x, y): if idx == n: return abs(x-y) if x_turn: score = [solve(False, i+1, a[i], y) for i in range(idx, n)] return max(score) else: score = [so...
s572024777
p03552
u656721037
1510453657
Python
Python (3.4.3)
py
Runtime Error
17
3064
9535
/* `-:://:::- `//:-------:/:` ...
s210600730
p03552
u054957956
1510453615
Python
Python (3.4.3)
py
Runtime Error
329
4096
491
n, _, y = map(int, input().split()) a = list(map(int, input().split())) a = [y] + a memo = [[-1 for i in range(n + 1)] for j in range(2)] def sol(i, turn): # ovaj drugi ima a[i] if memo[turn][i] != -1: return memo[turn][i] best = abs(a[i] - a[n]) for j in range(i + 1, n): pot = sol(j, 1...