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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s966629246 | p02556 | u509309113 | 1600415338 | Python | PyPy3 (7.3.0) | py | Runtime Error | 116 | 74688 | 385 | n = int(input())
points = []
for i in range(n) :
point = list(map(int, input(" ")))
points.append(point)
z = []
w = []
for i in range(len(points)) :
z.append(points[i][0] + points[i][1])
for i in range(len(points)) :
w.append(points[i][0] - points[i][1])
max_z = max(z) - min(z)
max_w = max(w) - mi... |
s099778578 | p02556 | u292746386 | 1600375614 | Python | Python (3.8.2) | py | Runtime Error | 510 | 34412 | 533 | import numpy as np
N = int(input())
x = np.empty(N, dtype=np.longlong)
y = np.empty(N, dtype=np.longlong)
for i in range(N):
x[i], y[i] = (int(t) for t in input().split())
ind = np.argsort(x)
X = x[ind]
Y = y[ind]
# max_dist = [0]
# for i in range(1, N):
# max_dist.append(np.max(-X[:i] - Y[:i]) + X[i] + Y[i... |
s304618389 | p02556 | u292746386 | 1600375468 | Python | Python (3.8.2) | py | Runtime Error | 515 | 34436 | 532 | import numpy as np
N = int(input())
x = np.empty(N, dtype=np.longlong)
y = np.empty(N, dtype=np.longlong)
for i in range(N):
x[i], y[i] = (int(t) for t in input().split())
ind = np.argsort(x)
X = x[ind]
Y = y[ind]
# max_dist = [0]
# for i in range(1, N):
# max_dist.append(np.max(-X[:i] - Y[:i]) + X[i] + Y[i... |
s006932825 | p02556 | u849559474 | 1600372545 | Python | Python (3.8.2) | py | Runtime Error | 434 | 45384 | 262 | n = int(input())
l = list()
for i in range(n):
l.append(list(map(int, input().split())))
max_d = 0
for i in range(n):
for j in range(i,n):
d = abs(array[i][0] - array[j][0]) + abs(array[i][1] - array[j][1])
if max_d < d:
max_d = d
print(max_d)
|
s428863558 | p02556 | u849559474 | 1600372390 | Python | Python (3.8.2) | py | Runtime Error | 117 | 27164 | 297 | import numpy as np
n = int(input())
array = np.empty(n)
for i in range(n):
array[i] = np.array(map(int, input().split()))
max_d = 0
for i in range(n):
for j in range(i,n):
d = np.abs(array[i,0] - array[j,0]) + np.abs(array[i,1] - array[j,1])
if max_d < d:
max_d = d
print(max_d)
|
s230113546 | p02556 | u849559474 | 1600372315 | Python | Python (3.8.2) | py | Runtime Error | 114 | 27020 | 300 | import numpy as np
n = int(input())
array = np.empty((n,2))
for i in range(n):
array[i] = np.array(map(int, input().split()))
max_d = 0
for i in range(n):
for j in range(i,n):
d = np.abs(array[i,0] - array[j,0]) + np.abs(array[i,1] - array[j,1])
if max_d < d:
max_d = d
print(max_d) |
s985414380 | p02556 | u849559474 | 1600372281 | Python | Python (3.8.2) | py | Runtime Error | 117 | 27144 | 300 | import numpy as np
n = int(input())
array = np.empty((n,2))
for i in range(n):
array[i] = np.array(map(int, input().split()))
max_d = 0
for i in range(n):
for j in range(i,n):
d = np.abs(array[i,0] - array[j,0]) + np.abs(array[i,1] - array[j,1])
if max_d < d:
max_d = d
print(max_d) |
s311539062 | p02556 | u849559474 | 1600372147 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8988 | 300 | import numpy as np
n = int(input())
array = np.empty((n,2))
for i in range(n):
array[i] = np.array(map(int, input().split()))
max_d = 0
for i in range(n):
for j in range(i,n):
d = np.abs(array[i,0] - array[j,0]) + np.abs(array[i,1] - array[j,1])
if max_d < d:
max_d = d
print(max_d) |
s888512452 | p02556 | u437215432 | 1600358583 | Python | Python (3.8.2) | py | Runtime Error | 372 | 27860 | 329 | def manhattan(n, x, y):
x2 = [0] * n
y2 = [0] * n
for i in range(n):
x0, y0 = xy[i]
x2[i] = x0 - y0
y2[i] = x0 + y0
print(max(max(x2) - min(x2), max(y2) - min(y2)))
n = int(input())
x = [0] * n
y = [0] * n
for i in range(n):
x[i] , y[i] = map(int, input().split())
manhattan(... |
s655363638 | p02556 | u344698790 | 1600357960 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9072 | 621 | x = [0] ** ((10**9)+1)
y = [0] ** ((10**9)+1)
n = int(input())
for i in range(n):
a,b = map(int,input().split())
x[a],y[b] = 1,1
#flag1,flag2 = 0,0
# for i in range((10**9)+1):
# if flag1 > 0:
# break
# else:
# if x[i] == 1:
# flag1 = i
# for i in range((10**9)+1):
# if x[i] == 1:
# flag2 = i
a = l... |
s517660622 | p02556 | u292746386 | 1600294159 | Python | Python (3.8.2) | py | Runtime Error | 491 | 29596 | 308 | import numpy as np
N = int(input())
x = np.empty(N, dtype=np.longlong)
y = np.empty(N, dtype=np.longlong)
for i in range(N):
x[i], y[i] = (int(t) for t in input().split())
dist = np.abs(x.reshape([-1, 1]) - x.reshape([1, -1])) + np.abs(y.reshape([-1, 1]) - y.reshape([1, -1]))
print(dist.max()) |
s431076717 | p02556 | u348805958 | 1600213675 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 189484 | 1548 | #!python3
import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
def resolve():
it = map(int, sys.stdin.read().split())
N = next(it)
if N == 3:
raise 1
D = 32
x1 = y1 = 10**9+1
x2 = y2 = 0
vis = set()
for xy in zip(it, it):
if xy in vis:
... |
s783033674 | p02556 | u033602950 | 1600213343 | Python | Python (3.8.2) | py | Runtime Error | 424 | 43628 | 513 | import sys
#import time
from collections import deque, Counter, defaultdict
#from fractions import gcd
import bisect
import heapq
#import math
import itertools
import numpy as np
input = sys.stdin.readline
sys.setrecursionlimit(10**8)
inf = 10**18
MOD = 1000000007
ri = lambda : int(input())
rs = lambda : input().strip(... |
s159818992 | p02556 | u348805958 | 1600202935 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2211 | 195332 | 1461 | #!python3
import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
def resolve():
it = map(int, sys.stdin.read().split())
N = next(it)
if N == 3:
raise 1
D = 32
x1 = y1 = 10**9+1
x2 = y2 = 0
vis = set()
for xy in zip(it, it):
if xy in vis:
... |
s017936568 | p02556 | u348805958 | 1600202852 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2208 | 129160 | 1461 | #!python3
import sys
iim = lambda: map(int, sys.stdin.readline().rstrip().split())
def resolve():
it = map(int, sys.stdin.read().split())
N = next(it)
if N == 2:
raise 1
D = 16
x1 = y1 = 10**9+1
x2 = y2 = 0
vis = set()
for xy in zip(it, it):
if xy in vis:
... |
s117156060 | p02556 | u814271993 | 1600192818 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8904 | 384 | import sys
def f(x,y):
return x-y.x+y
def main():
input = sys.stdin.buffer.readline
n = int(input())
x = [0]*n
y = [0]*n
for i in range(n):
x[i],y[i] = map(int,input().split())
f0 = [0]*n
f1 = [0]*n
for i in range(n):
f0[i],fi[i] = f(x[i],y[i])
print(max(max(f0)... |
s544032177 | p02556 | u015767468 | 1600158658 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9072 | 189 | x=[]
for i in range(N):
x.append(list(map(int,input().split())))
t=[]
for i in range(N):
for j in range(N):
t.append(abs(x[i][0]-x[j][0])+abs(x[i][1]-x[j][1]))
print(max(t)) |
s701014330 | p02556 | u094191970 | 1600134137 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9044 | 399 | from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))
n=int(input())
l=lnii()
if len(l)==1:
print(0)
exit()
x_max=0
x_min=10**10
y_max=0
y_min=10**10
for x,y in l:
s=x-y
x_max=max(x_max,s)
x_min=min(x_min,s)
t=x+y
y_max=max(y_max,t)
... |
s445248811 | p02556 | u185249212 | 1600130164 | Python | PyPy3 (7.3.0) | py | Runtime Error | 102 | 74564 | 5181 | from __future__ import print_function
from functools import reduce
from operator import mul
from collections import Counter
from collections import deque
from itertools import accumulate
from queue import Queue
from queue import PriorityQueue as pq
from heapq import heapreplace
from heapq import heapify
from heapq imp... |
s755122493 | p02556 | u923662841 | 1600120004 | Python | Python (3.8.2) | py | Runtime Error | 483 | 44384 | 281 | import numpy as np
N = int(input())
X = []
Y = []
for _ in range(N):
x,y = map(int, input().split())
X.append(x)
Y.append(y)
X = np.array(X)
Y = np.array(Y)
X_ = X.reshape((N,1))
Y_ = Y.reshape((N,1))
Z = np.abs(X-X_)+np.abs(Y-Y_)
z = Z.reshape((1,-1))
print(np.max(z)) |
s040706839 | p02556 | u923662841 | 1600119955 | Python | Python (3.8.2) | py | Runtime Error | 388 | 24880 | 262 | N = int(input())
X = []
Y = []
for _ in range(N):
x,y = map(int, input().split())
X.append(x)
Y.append(y)
X = np.array(X)
Y = np.array(Y)
X_ = X.reshape((N,1))
Y_ = Y.reshape((N,1))
Z = np.abs(X-X_)+np.abs(Y-Y_)
z = Z.reshape((1,-1))
print(np.max(z)) |
s615034853 | p02556 | u395313349 | 1600107130 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9044 | 244 | def main():
n = int(input())
a_li , b_li = [] , []
for _ in range(n):
x , y = int(input())
a_li.append(x + y)
b_li.append(x - y)
print(max(max(a_li) - min(a_li), max(b_li) - min(b_li)))
if __name__ == "__main__":
main() |
s155849822 | p02556 | u954731369 | 1600107104 | Python | Python (3.8.2) | py | Runtime Error | 465 | 29636 | 266 | import numpy as np
n = int(input())
x = np.empty(n, dtype=int)
y = np.empty(n, dtype=int)
for i in range(n):
x[i], y[i] = [int(d) for d in input().split()]
dist = np.max(
np.abs(x - x[1:].reshape(-1, 1)) \
+ np.abs(y - y[1:].reshape(-1, 1))
)
print(dist)
|
s989944887 | p02556 | u954731369 | 1600107004 | Python | Python (3.8.2) | py | Runtime Error | 493 | 29672 | 266 | import numpy as np
n = int(input())
x = np.empty(n, dtype=int)
y = np.empty(n, dtype=int)
for i in range(n):
x[i], y[i] = [int(d) for d in input().split()]
dist = np.max(
np.abs(x - x[1:].reshape(-1, 1)) \
+ np.abs(y - y[1:].reshape(-1, 1))
)
print(dist)
|
s212293559 | p02556 | u279317023 | 1600106942 | Python | PyPy3 (7.3.0) | py | Runtime Error | 89 | 74820 | 406 | import sys
input = sys.stding.readline
t = int(input())
po = []
for _ in range(t):
x,y = list(map(int,input().split()))
po.append((x,y))
po.sort()
dp = [-(10**99) for _ in range(t)]
for i in range(t):
value = min(x+y, x-y)
dp[i] = min(dp[i-1], value)
best = -9999999999999999999999999999
for i in rang... |
s754430059 | p02556 | u954731369 | 1600106510 | Python | Python (3.8.2) | py | Runtime Error | 110 | 27128 | 288 | import numpy as np
n = int(imput())
x = np.empty(n, dtype=int)
y = np.empty(n, dtype=int)
for i in range(n):
x[i], y[i] = [int(d) for d in input().split()]
dist = 0
for i in range(n - 1):
max(
dist,
np.max(np.abs(x[i] * x[i+1:]) + np.abs(y[i] * y[i+1:]))
)
print(dist) |
s284887534 | p02556 | u068727970 | 1600104111 | Python | Python (3.8.2) | py | Runtime Error | 791 | 51372 | 957 | N = int(input())
M = [list(map(int, input().split())) for _ in range(N)]
s = []
l = []
top = 2*(10**9)+1
low = 0
for j in range(N):
t = sum(M[j])
if low == t:
s.append(M[j])
elif low < t:
low = t
s = []
s.append(M[j])
if top == t:
l.append(M[j])
elif top > t... |
s278507926 | p02556 | u313117448 | 1600097311 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 74676 | 227 | N = int(input())
l = [list(map(int, input().split())) for i in range(N)]
d=list()
for i in range(N):
for j in range(N):
d.append(abs(l[i][0]-l[j][0]) + abs(l[i][1]-l[j][1]))
print(max(d)) |
s355745196 | p02556 | u706414019 | 1600078535 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8976 | 697 | import sys,math,collections,itertools
input = sys.stdin.readline
N=int(input())
XY = []
xAve = 0
yAve = 0
for _ in range(N):
x,y=map(int,input().split())
if (x,y) not in XY
XY.append((x,y))
xAve += x
yAve += y
xAve = xAve//N
yAve = yAve//N
XYnorm = [0]*4
for x,y in XY:
nX = x-xAve
... |
s976350522 | p02556 | u850087201 | 1600071573 | Python | PyPy3 (7.3.0) | py | Runtime Error | 87 | 74732 | 500 | N = int(input())
l = []
for i in range(N):
l.append([int(x) for x in input().split()])
xlim = []
ylim = []
def cha(a):
return [a[0]-a[1],a[0]+a[1]]
for i in range(N):
if cha(l[i])[0] <= cha(l[i])[1]:
ylim.append(cha(l[i])[1]))
else:
xlim.append(cha(l[i])[0])
xlim.sort()
ylim.sort()
... |
s260158631 | p02556 | u453623947 | 1600055843 | Python | Python (3.8.2) | py | Runtime Error | 688 | 75776 | 683 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 1
xmin = 10**9
ymax = 1
ymin = 10**9
for i in range(n):
if cheby[i][0] >= xmax :
xmax = cheby[i][0]
xa = i
if cheby[i][... |
s886312045 | p02556 | u453623947 | 1600055730 | Python | Python (3.8.2) | py | Runtime Error | 622 | 75628 | 679 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 1
xmin = 10**9
ymax = 1
ymin = 10**9
for i in range(n):
if cheby[i][0] > xmax :
xmax = cheby[i][0]
xa = i
if cheby[i][0... |
s768225626 | p02556 | u453623947 | 1600055531 | Python | Python (3.8.2) | py | Runtime Error | 620 | 75784 | 679 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 0
xmin = 10**9
ymax = 0
ymin = 10**9
for i in range(n):
if cheby[i][0] > xmax :
xmax = cheby[i][0]
xa = i
if cheby[i][0... |
s534210354 | p02556 | u453623947 | 1600055458 | Python | PyPy3 (7.3.0) | py | Runtime Error | 368 | 133348 | 681 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 0
xmin = 10**10
ymax = 0
ymin = 10**10
for i in range(n):
if cheby[i][0] > xmax :
xmax = cheby[i][0]
xa = i
if cheby[i]... |
s003036026 | p02556 | u262121009 | 1600044827 | Python | PyPy3 (7.3.0) | py | Runtime Error | 142 | 68704 | 172 | n = int(input())
w = []
for i in range(n):
x, y = map(int, input().split())
z.append(x + y)
w.append(x - y)
z.sort()
w.sort()
print(max(z[-1]-z[0], w[-1]-w[0])) |
s923404000 | p02556 | u991713078 | 1600040924 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8852 | 175 | N=int(input())
a,b,c,d=0,1e10,-1e10,1e10
for i in range(N):
A,B=int(input().pulit())
a=max(a,A+B)
b=min(b,A+B)
c=max(c,A-B)
d=min(d,A-B)
print(max(abs(a-b),abs(c-d)) |
s158111647 | p02556 | u773081031 | 1600038555 | Python | Python (3.8.2) | py | Runtime Error | 437 | 53424 | 209 | n = int(input())
u = [list(map(int, input().split())) for i in range(n)]
z = [u[i][0] + u[i][1] for i in range(n)]
w = [w[i][0] - w[i][1] for i in range(n)]
d = [max(z)-min(z), max(w)-min(w)]
print(max(d))
|
s302853281 | p02556 | u773081031 | 1600037381 | Python | Python (3.8.2) | py | Runtime Error | 885 | 111976 | 274 | n = int(input())
z = [[map(int, input().split())] for i in range(n)]
m = 0
d = 0
for i in range(n-1):
for j in range(i+1, n):
d = 0
d += max(z[i][0] - z[j][0], z[j][0] - z[i][0])
d += max(z[i][1] - z[j][1], z[j][1] - z[i][1])
if d>m:
m = d
print(m)
|
s390913322 | p02556 | u469254913 | 1600036517 | Python | Python (3.8.2) | py | Runtime Error | 358 | 64756 | 483 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
xy = np.array(xy,dtype='int32')
# print(xy)
diffs = np.expand_d... |
s866257037 | p02556 | u223904637 | 1600035590 | Python | Python (3.8.2) | py | Runtime Error | 695 | 58080 | 189 | n=int(input())
l=[]
for i in range(n):
l.append(list(map(int,input().split())))
p=sorted(l,key=lambda x: x[0]+x[1])
q=sorted(l,key=lambda x: x[0]-x[1])
print(max(p[-1]-p[0],q[-1]-q[0])) |
s603819504 | p02556 | u469254913 | 1600035512 | Python | Python (3.8.2) | py | Runtime Error | 494 | 84156 | 384 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
from scipy.spatial import distance
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
xy = np.array(xy)
md = distance.... |
s549807720 | p02556 | u469254913 | 1600035361 | Python | Python (3.8.2) | py | Runtime Error | 471 | 84156 | 475 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
from scipy.spatial import distance
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
xy = np.array(xy)
# print(xy)
... |
s744083597 | p02556 | u102655885 | 1600034672 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9112 | 294 | n = int(input())
max_z = 0
min_z = 10**10
max_w = 0
min_w = 10**10
for _ in range(n):
x, y = map(lambda x: int(x), input.split())
max_z = max(max_z, x + y)
min_z = min(min_z, x + y)
max_w = max(max_w, x - y)
min_w = min(min_w, x - y)
print(max(max_z-min_z, max_w-min_w)) |
s021163075 | p02556 | u514343483 | 1600034456 | Python | PyPy3 (7.3.0) | py | Runtime Error | 107 | 74628 | 277 | import numpy as np
N=int(input())
X=[]
Y=[]
man=0
for m in range(N):
x,y=map(int, input().split())
X.append(x)
Y.append(y)
for i in range(N):
for j in range(i,N):
res=np.abs(X[i]-X[j])+np.abs(Y[i]-Y[j])
if man<res:
man=res
print(man) |
s336050724 | p02556 | u329865314 | 1600033830 | Python | Python (3.8.2) | py | Runtime Error | 451 | 45408 | 201 | n = int(input())
l = []
for i in range(n):
l.append(list(map(int,input().split())))
m = []
for i in l:
a,b = i
k.append(a+b)
m.append(a-b)
k.sort()
m.sort()
print(max([k[-1]-k[0],m[-1] -m[0]])) |
s549688516 | p02556 | u469254913 | 1600033567 | Python | Python (3.8.2) | py | Runtime Error | 383 | 66536 | 467 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
def main():
N = int(input())
print(-1)
xy = [list(map(int,input().split())) for i in range(N)]
print(-1)
xy = np.array(xy)
# print(xy)
diffs... |
s433468121 | p02556 | u469254913 | 1600033498 | Python | Python (3.8.2) | py | Runtime Error | 368 | 66532 | 453 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
print(-1)
xy = np.array(xy)
# print(xy)
diffs = xy - xy.T
... |
s548878899 | p02556 | u469254913 | 1600033446 | Python | Python (3.8.2) | py | Runtime Error | 367 | 66524 | 439 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
xy = np.array(xy)
# print(xy)
diffs = xy - xy.T
print(-1)
... |
s757530815 | p02556 | u469254913 | 1600033377 | Python | Python (3.8.2) | py | Runtime Error | 367 | 66492 | 425 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
xy = np.array(xy)
# print(xy)
diffs = xy - xy.T
md = np.sum... |
s439708015 | p02556 | u474162944 | 1600033209 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9220 | 380 | N = int(input())
#i = 0
a_max = 2
a_min = 2*(10**9)
s_max = 0
s_min = 10**9
for i in N:
x,y=map(int,input().split())
add = x+y
sub = x-y
if add > a_max:
a_max = add
if add < a_min:
a_min = add
if sub > s_max:
s_max = sub
if sub < s_max:
s_max = sub
d_add = ... |
s766183388 | p02556 | u590995678 | 1600032808 | Python | PyPy3 (7.3.0) | py | Runtime Error | 94 | 74712 | 496 | #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pii = pair<int,int>;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define pb push_back
int main() {
ll N; cin>>N;
ll maxa=-3e9,mina=3e9;
ll maxb=-3e9,minb=3e9;
ll x,y;
re... |
s146533066 | p02556 | u664907598 | 1600032653 | Python | PyPy3 (7.3.0) | py | Runtime Error | 406 | 153148 | 522 | n=int(input())
xbox=[]
ybox=[]
for i in range(n):
x,y = map(int,input().split())
xbox.append(x)
ybox.append(y)
xmax=max(xbox)
xmin = min(xbox)
ymax=max(ybox)
ymin=min(ybox)
box1=[]
box2=[]
box3=[]
box4=[]
for i in range(n):
box1.append(xmax+ymax-xbox[i]-ybox[i])
box2.append(-xmin + ymax + xbox[i] - ... |
s335126074 | p02556 | u512873531 | 1600032441 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8916 | 236 | l, m = list(), list()
for _ in range(int(input())):
x, y = map(int, input().split())
l.append([x, y])
m.append([y, x])
l.sort(), m.sort()
print(max(l[-1][0]-l[0][0]+l[-1][1]-l[0][1], m[-1][0]-l[0][0]+l[-1][1]-l[0][1]))
|
s227658319 | p02556 | u512873531 | 1600032145 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8988 | 227 | l, m = list(), list()
for _ in range(int(input())):
x, y = map(int, input().split())
l.append([x, y])
m.append([y, x])
l.sort(), m.sort()
print(max(l[-1][0]-l[0][0]+l[-1][1]-l[0][1], m[-1][0]-l[0][0]+l[-1][1]-l[0][1])) |
s216254497 | p02556 | u729133443 | 1600031093 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9044 | 119 | a,b=[],
for z in[*open(0)][1:]:x,y=map(int,z.split());a+=x+y,;b+=x-y,
print(max(abs(max(a)-min(a)),abs(max(b)-min(b)))) |
s295518391 | p02556 | u453623947 | 1600030787 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9036 | 685 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 0
xmin = 10**10
ymax = 0
ymin = 10**10
for i in range(n):
if cheby[i][0] >= xmax :
xmax = cheby[i][0]
xa = i
if cheby[i... |
s785229888 | p02556 | u495667483 | 1600030781 | Python | Python (3.8.2) | py | Runtime Error | 396 | 63076 | 616 | import sys, math
from functools import lru_cache
sys.setrecursionlimit(10**9)
MOD = 10**9+7
def input():
return sys.stdin.readline()[:-1]
def mi():
return map(int, input().split())
def ii():
return int(input())
def i2(n):
tmp = [list(mi()) for i in range(n)]
return [list(i) for i in zip(*tmp)]
... |
s557752265 | p02556 | u798858168 | 1600030710 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8888 | 1098 | /*
JAI JAGANNATH!
*/
//@Author : zanj0
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
#define ff first
#define ss second
#define pb push_back
#define mod 1000000007
#define inf 1e18
#define ps(x,y) fixed<<setprecision(y)... |
s786645176 | p02556 | u469254913 | 1600030537 | Python | Python (3.8.2) | py | Runtime Error | 377 | 66384 | 469 | import numpy as np
# import math
# import copy
# from collections import deque
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10000)
def main():
N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
xy = np.array(xy)
# print(xy)
diffs = np.expand_dims(xy,axis=1)... |
s907413431 | p02556 | u453623947 | 1600030159 | Python | Python (3.8.2) | py | Runtime Error | 626 | 75696 | 682 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 0
xmin = 10**10
ymax = 0
ymin = 10**10
for i in range(n):
if cheby[i][0] > xmax :
xmax = cheby[i][0]
xa = i
if cheby[i]... |
s390164998 | p02556 | u453623947 | 1600030097 | Python | Python (3.8.2) | py | Runtime Error | 702 | 75572 | 681 | n = int(input())
xy = [list(map(int,input().split())) for i in range(n)]
cheby = []
for i in range(n):
l = [xy[i][0]-xy[i][1],xy[i][0]+xy[i][1]]
cheby.append(l)
xmax = 0
xmin = 10**10
ymax = 0
ymin = 10**10
for i in range(n):
if cheby[i][0] > xmax :
xmax = cheby[i][0]
xa = i
if cheby[i]... |
s451808090 | p02556 | u065578867 | 1600030080 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8968 | 414 | n = int(input())
maxsum = -float('inf')
minsum = float('inf')
maxdif = -float('inf')
mindif = float('inf')
for i in range(n):
x, y = map(int, input().split())
trysum = x + y
trydif = x - y
if trysum >= maxsum:
maxsum = trysum
if trysum <= minsum:
minsum = trysum
if trydif >= maxdif:
maxdif = try... |
s899441991 | p02556 | u566159623 | 1600030052 | Python | PyPy3 (7.3.0) | py | Runtime Error | 763 | 181024 | 1100 | from collections import defaultdict
dic = defaultdict(list)
inf = 10**6
N = int(input())
l = []
z = []
xma, xmi, yma, ymi = 0, inf, 0, inf
for _ in range(N):
x, y = map(int, input().split())
xma = max(xma, x)
yma = max(yma, y)
xmi = min(xmi, x)
ymi = min(ymi, y)
l.append([x, y])
z.append(x+y... |
s992689606 | p02556 | u699522269 | 1600030031 | Python | Python (3.8.2) | py | Runtime Error | 639 | 66396 | 268 | import numpy as np
N = int(input())
nums=[]
for _ in range(N):
nums.append(list(map(int,input().split())))
spots = np.array(nums)
diffs = np.expand_dims(spots, axis=1) - np.expand_dims(spots, axis=0)
distances = np.sum(abs(diffs), axis=-1)
print(distances.max()) |
s286644069 | p02556 | u454093752 | 1600029831 | Python | PyPy3 (7.3.0) | py | Runtime Error | 788 | 107564 | 386 | N = int(input())
K = []
for i in range(N):
x, y = map(int,input().split())
t = x + y
if x <= 0:
t -= 4*abs(x)
if y <= 0:
t -= 4*abs(y)
K.append([t, x, y])
K.sort()
ans = K[-1][0] - K[0][0]
for i in range(N-1):
if K[i][0] == K[i+1][0]:
A.append(K[i+1][1])
else:
... |
s866635434 | p02556 | u566159623 | 1600029803 | Python | PyPy3 (7.3.0) | py | Runtime Error | 816 | 155892 | 1060 | from collections import defaultdict
dic = defaultdict(list)
inf = 10**6
N = int(input())
l = []
z = []
xma, xmi, yma, ymi = 0, inf, 0, inf
for _ in range(N):
x, y = map(int, input().split())
xma = max(xma, x)
yma = max(yma, y)
xmi = min(xmi, x)
ymi = min(ymi, y)
l.append([x, y])
z.append(x+y... |
s499316754 | p02556 | u179376941 | 1600029706 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9200 | 399 | n = int(input())
max_t = -float('inf')
min_t = float('inf')
dic_p_x = {}
for _ in range(n):
x, y = map(int, input().split())
c = x + y
if c > max_t:
max_t = c
if c < min_t:
min_t = c
if not dic_p[c]:
dic_p[c] = []
dic_p_x[c].append(x)
max_d = max_t - min_t
for key, lst in dic_p.items():
a, b =... |
s899914971 | p02556 | u405864101 | 1600029643 | Python | Python (3.8.2) | py | Runtime Error | 451 | 45400 | 279 | N = int(input())
xys = []
for _ in range(N):
xys.append(list(map(int, input().split(" "))))
max_dist = 0
for i in range(N):
for j in range(i + 1, N):
dist = abs(xys[0][i] - xys[0][j]) + abs(xys[1][i] - xys[1][j])
if dist > max_dist:
max_dist = dist |
s728107680 | p02556 | u040094338 | 1600029630 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8948 | 2828 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<vl> vvl;
double EPS=1e-9;
int INF=1000000005;
long ... |
s271069968 | p02556 | u308616113 | 1600029628 | Python | Python (3.8.2) | py | Runtime Error | 32 | 8956 | 252 | l = [];
for i in range(int(input())):
x = list(map(int,input().split()));
l.append(x);
sum = 0;
for i in range(len(l)):
for j in range(len(l)):
if i!=j:
k = abs(len[i][0]-len[j][0])+abs(len[i][1]-len[j][1]);
if(sum<k)
sum = k;
print(sum) |
s693374030 | p02556 | u926266624 | 1600029618 | Python | Python (3.8.2) | py | Runtime Error | 817 | 77216 | 500 | N = int(input())
ListN = [[0 for i in range(2)] for j in range(N)]
for i in range (N):
x, y, = map(int, input().split())
ListN[i] = [x,y]
ListN = list(map(list, set(map(tuple, ListN))))
ListNZ = [0 for i in range(N)]
minz =10**5
maxz =0
mini=0
maxi=0
for i in range(N-1):
ListNZ = (ListN[i][0]**2 + ListN[i... |
s324114867 | p02556 | u588341295 | 1600029615 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 69052 | 1206 | import sys
from collections import Counter
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c for j in range(b)] for i in range(a)]
def list3d(a, b, c, d): return [[[d for k in range(c)] for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e for l in range(d)] for k... |
s294723365 | p02556 | u506422818 | 1600029610 | Python | Python (3.8.2) | py | Runtime Error | 442 | 39192 | 329 | points = []
max = 0
for i in range(int(input())):
a,b = map(int, input().split())
points.append([a,b])
for i in points:
tempanswer = 0
for j in points[i:]:
tempanswer = abs(j[0] - i[0]) + abs(i[1] - j[1])
if tempanswer > max:
max = tempanswer
p... |
s821038662 | p02556 | u156815136 | 1600029605 | Python | Python (3.8.2) | py | Runtime Error | 451 | 46648 | 1698 | #from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from math import gcd
from itertools import combinations,permutations,accumulate, product # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
... |
s415779055 | p02556 | u509739538 | 1600029604 | Python | PyPy3 (7.3.0) | py | Runtime Error | 626 | 111428 | 690 | from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools
def readInt():
return int(input())
def readInts():
return list(map(int, input().split()))
def readChar():
return input()
def readChars():
return input().split()
n = readInt()
data = []
fo... |
s298611170 | p02556 | u693025087 | 1600029603 | Python | PyPy3 (7.3.0) | py | Runtime Error | 138 | 68408 | 2321 | # -*- coding: utf-8 -*-
# map(int, input().split())
N = int(input())
def dist(dot1, dot2):
dx = abs(dot1[0]-dot2[0])
dy = abs(dot1[1]-dot2[1])
return dx+dy
dots = []
for n in range(N):
x,y = map(int, input().split())
dots.append((x,y))
# 全探索
# max_len = 0
# for i in range(N):
# for j in rang... |
s658608782 | p02556 | u935558307 | 1600029593 | Python | PyPy3 (7.3.0) | py | Runtime Error | 881 | 142572 | 780 | import statistics
N = int(input())
XY = [list(map(int,input().split())) for _ in range(N)]
sumX = []
sumY = []
for x,y in XY:
sumX.append(x)
sumY.append(y)
avaX = statistics.median(sumX)
avaY = statistics.median(sumY)
zone1 = []
zone2 = []
zone3 = []
zone4 = []
for x,y in XY:
if x < avaX and y >= avaY:
... |
s025384232 | p02556 | u510331904 | 1600029592 | Python | Python (3.8.2) | py | Runtime Error | 1254 | 55940 | 936 | #!/usr/bin/env python3
import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
return sys.stdin.readline()[:-1]
def gcd(*numbers):
return reduce(math.gcd, numbers)
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
... |
s492631994 | p02556 | u224346910 | 1600029591 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2209 | 136560 | 676 | from itertools import combinations
import sys
N = int(input())
XY = [list(map(int, input().split())) for _ in range(N)]
min_diff = 10**9
max_diff = 1
min_sum = 2 * 10**9
max_sum = 2
for x,y in XY:
min_diff = min(x-y, min_diff)
max_diff = max(x-y, max_diff)
min_sum = min(x+y, min_sum)
max_sum = max(x+... |
s007043807 | p02556 | u546853743 | 1600029589 | Python | Python (3.8.2) | py | Runtime Error | 366 | 9164 | 233 | n=int(input())
max=0
for i in range(n):
x,y=list(map(int,input().split()))
for i in range(n):
for j in range(i+1,n):
if (abs(x[i]-x[j])+abs(y[i]-y[j]))>max:
max = (abs(x[i]-x[j])+abs(y[i]-y[j]))
print(max) |
s515905857 | p02556 | u845573105 | 1600029587 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 68620 | 1338 | X = []
Y = []
maxX = 0
minX = 10**9
maxY = 0
minY = 10**9
minxy = float("inf")
maxxy = -float("inf")
minnxy = float("inf")
maxnnx = -float("inf")
N = int(input())
for i in range(N):
x, y = map(int, input().split())
minxy = min(minxy, y-x)
maxxy = min(maxxy, y-x)
minnxy = min(minnxy, x + y)
maxnxy = max(max... |
s340550672 | p02556 | u240234332 | 1600029583 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8980 | 333 | N = int(input())
i, ma, mi = 0, 0, 10**9
x = []
y = []
while i < N
a, b = map(int, input().split())
x.append(a)
y.append(b)
ma = max(x[i]*y[i], ma)
mi = min(x[i]*y[i], mi)
if ma == x[i]*y[i]:
cma = i
if mi == x[i]*y[i]:
cmi = i
i += 1
print(abs(x[cma] - x[cmi]) + abs(y[cm... |
s401956594 | p02556 | u701263911 | 1600029579 | Python | Python (3.8.2) | py | Runtime Error | 648 | 80924 | 366 | import numpy as np
from scipy.spatial.distance import cityblock
N = int(input())
s = [list(map(int, input().split())) for i in range(N)]
max = 0
for i in len(N):
for j in len(N):
# if s[i] == s[j]:
# continue
# else:
cb = abs(s[i][0] - s[j][0]) + abs(s[i][1] - s[j][1])
... |
s742208021 | p02556 | u355137116 | 1600029577 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9020 | 405 | n = int(input())
x_y = [[] for i in range(n)]
for i in range(n):
x_y[i] = list(map(int, input().split()))
x_ = sorted(x_y, key=lambda x: x[0])
#print(x_)
ans = 0
for l in range(n):
for r in range(n-1,l,-1):
# print(l,r)
x = x_[r][0] - x_[l][0]
if x < 0:
x = -x
y = x_[r][1] - x_[l][1]
if y < 0:
... |
s970570292 | p02556 | u354804355 | 1600029572 | Python | Python (3.8.2) | py | Runtime Error | 881 | 134384 | 376 | #ABC178 E
import numpy as np
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
min = math.sqrt(10**9 *2)
max = 0
min_idx = 0
max_idx = 0
for i in range(n):
tmp = x[i]**2 + y[i]**2
if tmp < min:
min_idx = i
if tmp > max:
max_idx = i
ans = abs(x[max_idx]... |
s172777197 | p02556 | u384796740 | 1600029563 | Python | Python (3.8.2) | py | Runtime Error | 27 | 8960 | 206 | N=input()
p=[]
for i in range(N):
p.append(list(map(int, input().split())))
q=[]
for i in range(N):
for j in range(N-i):
q.append(abs(p[i][0]-p[i+j][0])+abs(p[i][1]-p[i+j][1]))
print(max(q)) |
s012873130 | p02556 | u240234332 | 1600029560 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8948 | 334 | N = int(input())
i, ma, mi = 0, 0, 10**18
x = []
y = []
while i < N
a, b = map(int, input().split())
x.append(a)
y.append(b)
ma = max(x[i]*y[i], ma)
mi = min(x[i]*y[i], mi)
if ma == x[i]*y[i]:
cma = i
if mi == x[i]*y[i]:
cmi = i
i += 1
print(abs(x[cma] - x[cmi]) + abs(y[c... |
s564434938 | p02556 | u328179275 | 1600029538 | Python | Python (3.8.2) | py | Runtime Error | 2212 | 225728 | 408 | import numpy as np
from numba import jit
n = int(input())
xy = [map(int, input().split()) for _ in range(n)]
x, y = [list(i) for i in zip(*xy)]
@jit
def one(x,y):
a=np.zeros(0)
b=np.zeros(0)
for i in range(10000):
for j in range(i+1,10000):
a = np.insert(a,0,abs(x[j]-x[i]))
... |
s173244220 | p02556 | u710282484 | 1600029535 | Python | Python (3.8.2) | py | Runtime Error | 1816 | 72768 | 420 | n=int(input())
l=[input().split() for _ in range(n)]
dp=[0]*(n+2)
dp1=[0]*(n+2)
for i in range(n):
for j in range(1,n):
if not (l[i][0]==0 and l[j][0]==0):
dp[i+j] = max(abs(int(l[i][0]) - int(l[j][0])), dp[i+j-1])
if not (l[i][1] == 0 and l[j][1] == 0):
dp1[i+j] = max(abs(in... |
s369055796 | p02556 | u580073714 | 1600029520 | Python | Python (3.8.2) | py | Runtime Error | 623 | 66476 | 281 | import numpy as np
N = int(input())
a = [[0] *2] * N
for i in range(N):
a[i] = list(map(int, input().split()))
cities = np.array(a)
all_diffs = np.expand_dims(cities, axis=1) - np.expand_dims(cities, axis=0)
distance = np.sum(np.abs(all_diffs), axis=-1)
print(np.max(distance)) |
s680403007 | p02556 | u273914730 | 1600029512 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9076 | 323 | N=int(input())
xy=[map(int,input().split()) for i in range(N)]
x,y=[list(j) for j in zip(*xy)]
m=0
t=0
for k in range(N):
for l in range(k,N-1):
if (abs(x[k]-x[l]))<t:
m=m
else:
if (abs(x[k]-x[l])+abs(y[k]-y[l]))>m:
t=(abs(x[k]-x[l])
m=abs(x[k]-x[l])+abs(y[k]-y[l])
print(... |
s024402272 | p02556 | u258406742 | 1600029488 | Python | Python (3.8.2) | py | Runtime Error | 400 | 36036 | 293 | a = int(input())
b = []
for i in range(a):
x,y = map(int, input().split())
b.append((x,y))
lg = 0
for i in range(a):
for j in range(i,a):
tl = abs(b[i][0] - b[j][0])
if t1 < lg: continue
t2 = abs(b[i][1] - b[j][1])
t3 = t1 + t2
lg = t3 if t3 > lg else lg
print(lg)
|
s677099133 | p02556 | u926266624 | 1600029478 | Python | Python (3.8.2) | py | Runtime Error | 901 | 77112 | 498 | N = int(input())
ListN = [[0 for i in range(2)] for j in range(N)]
for i in range (N):
x, y, = map(int, input().split())
ListN[i] = [x,y]
ListN = list(map(list, set(map(tuple, ListN))))
ListNZ = [0 for i in range(N)]
minz =10**9
maxz =0
mini=0
maxi=0
for i in range(N):
ListNZ = (ListN[i][0]**2 + ListN[i][... |
s147854666 | p02556 | u771680013 | 1600029460 | Python | PyPy3 (7.3.0) | py | Runtime Error | 145 | 68836 | 776 | from sys import stdin
N = int(stdin.readline().strip())
vals = [None,None,None,None]
xminy_min = float("inf")
xminy_max = 0
xplusy_min = float("inf")
xplusy_max = 0
for _ in range(N):
x,y = map(int,stdin.readline().strip().split())
xpy = abs(x+y)
xmy = abs(x-y)
if xpy < xplusy_min:
xplusy_min ... |
s226757182 | p02556 | u273914730 | 1600029438 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9072 | 319 | N=int(input())
xy=[map(int,input().split()) for i in range(N)]
x,y=[list(j) for j in zip(*xy)]
m=0
t=0
for k in range(N):
for l in range(k,N-1):
if (abs(x[k]-x[l]))<t:
m=m
else:
if (abs(x[k]-x[l])+abs(y[k]-y[l]))>m:
t=(abs(x[k]-x[l])
m=abs(x[k]-x[l])+abs(y[k]-y[l])
print(m)
|
s696629392 | p02556 | u771680013 | 1600029428 | Python | PyPy3 (7.3.0) | py | Runtime Error | 223 | 71152 | 805 | from sys import stdin
N = int(stdin.readline().strip())
vals = [None,None,None,None]
xminy_min = float("inf")
xminy_max = 0
xplusy_min = float("inf")
xplusy_max = 0
for _ in range(N):
x,y = map(int,stdin.readline().strip().split())
xpy = abs(x+y)
xmy = abs(x-y)
print("yes")
if xpy < xplusy_min:
... |
s959574736 | p02556 | u892340697 | 1600029422 | Python | Python (3.8.2) | py | Runtime Error | 532 | 9180 | 297 | n = int(input())
mod = pow(10, 9) + 7
l = []
for i in range(2001):
if i < 3:
l.append(0)
elif 3 <= i <= 5:
l.append(1)
else:
sum_ = 1
for j in range(i-5):
sum_ += l[i-(3+j)]
sum_ = sum_ % mod
l.append(sum_)
print(l[n]) |
s004303585 | p02556 | u248996551 | 1600029409 | Python | PyPy3 (7.3.0) | py | Runtime Error | 2207 | 97688 | 1625 | N=int(input())
X=[]
Y=[]
Z=[]
import sys
if N==2:
x_1,y_1=map(int,input().split())
x_2,y_2=map(int,input().split())
print(abs(x_1-x_2)+(y_1-y_2))
sys.exit()
for i in range(N):
x,y=map(int,input().split())
X.append(x)
Y.append(y)
if [x,y] not in Z:
Z.append([x,y])
#Z.a... |
s844229855 | p02556 | u506422818 | 1600029407 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8920 | 316 | points = []
max = 0
for i in range(int(input()):
a,b = map(int, input().split())
points.append([a,b])
for i in points:
tempanswer = 0
for j in points[i:]:
tempanswer = abs(j[0] - i[0]) + abs(i[1] - j[1])
if tempanswer > max:
max = tempanswer
print(max) |
s621925674 | p02556 | u699522269 | 1600029386 | Python | Python (3.8.2) | py | Runtime Error | 637 | 66552 | 287 | import numpy as np
N = int(input())
nums=[]
for _ in range(N):
nums.append(list(map(int,input().split())))
spots = np.array(nums)
all_diffs = np.expand_dims(spots, axis=1) - np.expand_dims(spots, axis=0)
distance = np.sum(abs(all_diffs), axis=-1)
print(distance)
print(distance.max()) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.