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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s057875876 | p03837 | u977389981 | 1555706707 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 1274 | import heapq
import copy
V, M = map(int, input().split())
d = [0] * V
prev = [0] * V
cost = [[INF] * V for i in range(V)]
for i in range(M):
a, b, c = map(int, input().split())
cost[a - 1][b - 1] = c
cost[b - 1][a - 1] = c
def dijkstra_back(s, t):
for i in range(V):
prev[i] = s
d... |
s181173681 | p03837 | u977389981 | 1555706512 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 1274 | import heapq
import copy
V, M = map(int, input().split())
d = [0] * V
prev = [0] * V
cost = [[INF] * V for i in range(V)]
for i in range(M):
a, b, c = map(int, input().split())
cost[a - 1][b - 1] = c
cost[b - 1][a - 1] = c
def dijkstra_back(s, t):
for i in range(V):
prev[i] = s
d... |
s517658925 | p03837 | u675497468 | 1554911420 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38588 | 2834 | def gen_graph(input_list):
graph = {}
for item in input_list:
if not item[0] in graph:
graph[item[0]] = {}
if not item[1] in graph:
graph[item[1]] = {}
graph[item[0]][item[1]] = item[2]
graph[item[1]][item[0]] = item[2]
return graph
def get_lowest_... |
s832768219 | p03837 | u674885198 | 1553810383 | Python | Python (3.4.3) | py | Runtime Error | 173 | 4980 | 1117 | n,m=list(map(int, input().split()))
abc = []
for i in range(m):
abc.append(list(map(int, input().split())))
bools = [False for i in range(n)]
dp =[[[0,[]] for i in range(n)] for i in range(n)]
for i in range(len(abc)):
a=abc[i][0]
b=abc[i][1]
c=abc[i][2]
a=a-1
b=b-1
dp[a][b][0]=dp[a][b][0... |
s203705926 | p03837 | u352623442 | 1553808439 | Python | PyPy3 (2.4.0) | py | Runtime Error | 334 | 52056 | 883 | n,m =map(int,input().split())
inf = 10**15
dist = [[inf for i in range(n)] for i in range(n)]
route = [[ [] for i in range(n)] for i in range(n)]
import copy
for i in range(m):
ak,bk,ck = map(int,input().split())
dist[ak-1][bk-1] =ck
dist[bk-1][ak-1] =ck
for i in range(n):
for k in range(n):
... |
s562341915 | p03837 | u352623442 | 1553808117 | Python | PyPy3 (2.4.0) | py | Runtime Error | 331 | 53900 | 751 | n,m =map(int,input().split())
inf = 10**15
dist = [[inf for i in range(n)] for i in range(n)]
route = [[ [] for i in range(n)] for i in range(n)]
import copy
for i in range(m):
ak,bk,ck = map(int,input().split())
dist[ak-1][bk-1] =ck
dist[bk-1][ak-1] =ck
for i in range(n):
for k in range(n):
... |
s107654394 | p03837 | u824237520 | 1552575188 | Python | Python (3.4.3) | py | Runtime Error | 2121 | 269628 | 1166 | import sys
sys.setrecursionlimit(10000)
n, m = map(int, input().split())
abc = [tuple(int(x) - 1 for x in input().split()) for _ in range(m)]
#res = [[9999999 for _ in range(n)] for _ in range(n)]
e = [dict() for _ in range(n)]
for i in range(m):
a, b, c = abc[i][0], abc[i][1], abc[i][2]
e[a][b] = [c, i]
... |
s976815720 | p03837 | u603253967 | 1551720815 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1638 | from collections import defaultdict
def dd(N, abc, ne_table, start_i):
used_edge = set()
pivot = start_i
kouho = {start_i: (0, 0, True)} # value: (d, path,kakutei)
for _ in range(N - 1):
current_dist, path, kaku = kouho[pivot]
assert kaku
edges_i = ne_table[pivot] # エッジリスト... |
s855005660 | p03837 | u572144347 | 1551024419 | Python | PyPy3 (2.4.0) | py | Runtime Error | 197 | 38896 | 296 | #!/mnt/c/Users/moiki/bash/env/bin/python
sx,sy,tx,ty = map(int, input().split())
ans = ""
#UP
ans += "U" * (ty-sy)
ans += "R" * (tx-sx)
ans += "D" * (ty-sy)
ans += "L" * (tx-sx)
ans += "L" + "U"* (ty-sy+1) + "R" * (tx-sx+1) + "D"
ans += "R" + "D" * (ty-sy+1) + "L"*(tx-sx+1) + "U"
print(ans)
|
s213294744 | p03837 | u316386814 | 1550367641 | Python | Python (3.4.3) | py | Runtime Error | 148 | 12636 | 462 | n, m = list(map(int, input().split()))
import numpy as np
dists = np.ones((n + 1, n + 1)) * (10 ** 6)
edges = []
for _ in range(m):
a, b, c = list(map(int, input().split()))
dists[a, b] = dists[b, a] = c
edges.append(a, b, c)
for i in range(1, n + 1):
dists[i, i] = 0
for i in range(1, 1 + n):
dists... |
s945595786 | p03837 | u983918956 | 1550355950 | Python | PyPy3 (2.4.0) | py | Runtime Error | 181 | 38684 | 1435 | from collections import deque
sx,sy,tx,ty = map(int,input().split())
ans_list = []
(tx,ty) = (tx-sx,ty-sy); (sx,sy) = (0,0)
H,W = ty+3,tx+3
visited = [[0]*(tx+3) for i in range(ty+3)]
d = [[1,0],[0,1],[-1,0],[0,-1]]
(sx,sy) = (sx+1,sy+1); (tx,ty) = (tx+1,ty+1)
def bfs(si,sj,gi,gj):
tr = [[si,sj]]
q = deque([[si... |
s621636772 | p03837 | u054106284 | 1543981338 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3828 | 1656 | import heapq
import math
def make_Graph(N, edges):#頂点の名前はi - 1で受け付ける
graph = {}
for i in range(N):
graph[i] = {}
for j in range(N):
graph[i][j] = 0
for edge in edges:
a, b, c = edge
graph[a][b] = c
graph[b][a] = c
return graph
def Dijkstra(graph, sta... |
s791274953 | p03837 | u505420467 | 1543434071 | Python | Python (3.4.3) | py | Runtime Error | 279 | 17176 | 431 | from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse.csgraph import dijkstra
n,m=map(int,input().split())
dis=[[float('inf') for i in range(n)]for j in range(n)]
for i in range(n):
dis[i][i]=0
for i in range(m):
a,b,t=map(int,input().split())
dis[a-1][b-1]=t
dis[b-1][a-1]=t
cost=dijkstra(di... |
s489056248 | p03837 | u200030766 | 1542489448 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3188 | 938 | #ダイクストラ法
V, E=map(int,input().strip().split(' '))
inf=10**9
cost=[[inf]*V for i in range(V)]
edge=[]
for i in range(E):
fr, to, co=map(int,input().strip().split(' '))
cost[fr-1][to-1]=co
cost[to-1][fr-1]=co
edge.append([fr-1,to-1])
d=[]
for i in range(V):
d.append(dijkstra(i))
cand=E
for i in ... |
s182501619 | p03837 | u169650582 | 1542393994 | Python | Python (3.4.3) | py | Runtime Error | 2121 | 258744 | 634 | N,M=map(int,input().split())
Islands=[[] for i in range(N)]
Edge=[]
S=0
for i in range(M):
a,b,c=map(int,input().split())
Islands[a-1].append([b-1,c])
Islands[b-1].append([a-1,c])
Edge.append([a-1,b-1])
for m in range(M):
a=Edge[m][0]
b=Edge[m][1]
for i in Islands[a]:
if i[0]==b:
c_m=i[1]
List... |
s600072643 | p03837 | u620084012 | 1540295000 | Python | PyPy3 (2.4.0) | py | Runtime Error | 200 | 41196 | 572 | # ABC 051 D
INF = 7+10**9
N, M = map(int,input().split())
P = []
D = [[INF for k in range(N)] for l in range(N)]
for k in range(N):
D[k][k] = 0
for k in range(M):
a, b, c = map(int,input().split())
P.append([a-1,b-1,c])
D[a-1][b-1] = c
D[b-1][a-1] = c
# Floyd-Warshall
for k in range(M):
for l i... |
s396835419 | p03837 | u785989355 | 1538295731 | Python | Python (2.7.6) | py | Runtime Error | 376 | 2948 | 750 |
INF = 10**6 + 1
N,M = map(int,raw_input().split())
a_l=[]
b_l=[]
c_l=[]
for i in range(M):
a,b,c=map(int,raw_input().split())
a_l.append(a-1)
b_l.append(b-1)
c_l.append(c-1)
d = [[INF for j in range(N)] for i in range(N)]
for i in range(N):
d[i][i]=0
for i in range(M):
d[a_l[i]... |
s850611178 | p03837 | u785989355 | 1538295613 | Python | Python (2.7.6) | py | Runtime Error | 13 | 2816 | 829 | INF = 10**6 + 1
N,M = map(int,raw_input().split())
a_l=[]
b_l=[]
c_l=[]
for i in range(M):
a,b,c=map(int,raw_input().split())
a_l.append(a-1)
b_l.append(b-1)
c_l.append(c-1)
d = [[] for i in range(N)]
for i in range(N):
for j in range(N):
if i==j:
d[i][j].append(0)
... |
s124361553 | p03837 | u690536347 | 1535740252 | Python | Python (3.4.3) | py | Runtime Error | 599 | 3380 | 528 | n,m=map(int,input().split())
inf=float("inf")
r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in r(n)] for i in r(n)]
a,b,c=[None]*n,[None]*n,[None]*n
for i in r(m):
a[i],b[i],c[i]=map(int,input().split())
a[i]-=1
b[i]-=1
l[a[i]][b[i]]=min(l[a[i]][b[i]],c[i])
l[b[i]][a[i]]=min(l[b[i]][a[i]],c[i])
for k in... |
s718038058 | p03837 | u690536347 | 1535740151 | Python | Python (3.4.3) | py | Runtime Error | 582 | 3380 | 490 | n,m=map(int,input().split())
inf=float("inf")
r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in r(n)] for i in r(n)]
a,b,c=[None]*n,[None]*n,[None]*n
for i in r(m):
a[i],b[i],c[i]=map(int,input().split())
a[i]-=1
b[i]-=1
l[a[i]][b[i]]=c[i]
l[b[i]][a[i]]=c[i]
for k in r(n):
for i in r(n):
for j in r... |
s214754452 | p03837 | u690536347 | 1535739886 | Python | Python (3.4.3) | py | Runtime Error | 637 | 3380 | 482 | n,m=map(int,input().split())
inf=float("inf")
r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in r(n)] for i in r(n)]
a,b,c=[None]*n,[None]*n,[None]*n
for i in r(m):
a[i],b[i],c[i]=map(int,input().split())
l[a[i]-1][b[i]-1]=c[i]
l[b[i]-1][a[i]-1]=c[i]
for k in r(n):
for i in r(n):
for j in r(n):
l... |
s314868252 | p03837 | u690536347 | 1535739697 | Python | Python (3.4.3) | py | Runtime Error | 661 | 3444 | 489 | from itertools import product as p
n,m=map(int,input().split())
inf=float("inf")
r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in r(n)] for i in r(n)]
a,b,c=[None]*n,[None]*n,[None]*n
for i in r(m):
a[i],b[i],c[i]=map(int,input().split())
l[a[i]-1][b[i]-1]=c[i]
l[b[i]-1][a[i]-1]=c[i]
for k,i,j in p(*[r(n)]*... |
s233769290 | p03837 | u690536347 | 1535739555 | Python | PyPy3 (2.4.0) | py | Runtime Error | 246 | 45932 | 505 | from itertools import product as p
n,m=map(int,input().split())
inf=float("inf")
r=lambda n:range(n)
l=[[inf if i!=j else 0 for j in range(n)] for i in r(n)]
a,b,c=[None]*n,[None]*n,[None]*n
for i in r(m):
a[i],b[i],c[i]=map(int,input().split())
l[a[i]-1][b[i]-1]=c[i]
l[b[i]-1][a[i]-1]=c[i]
for k,i,j in p(*[r(... |
s929930376 | p03837 | u584355711 | 1488862800 | Python | Python (3.4.3) | py | Runtime Error | 502 | 3188 | 881 | # -*- coding: utf-8 -*-
INF=10**10
def main():
n,m=list(map(int,input().split()))
a=[0 for _ in range(n)]
b=[0 for _ in range(n)]
c=[0 for _ in range(n)]
d=[[INF for i in range(n)] for i in range(n)]
for i in range(m):
a[i],b[i],c[i]=list(map(int,input().split()))
a[i]-=1
... |
s424792364 | p03837 | u584355711 | 1488862003 | Python | Python (3.4.3) | py | Runtime Error | 508 | 3312 | 881 | # -*- coding: utf-8 -*-
INF=10**10
def main():
n,m=list(map(int,input().split()))
a=[0 for _ in range(n)]
b=[0 for _ in range(n)]
c=[0 for _ in range(n)]
d=[[INF for i in range(n)] for i in range(n)]
for i in range(n):
a[i],b[i],c[i]=list(map(int,input().split()))
a[i]-=1
... |
s352817267 | p03837 | u252805217 | 1487071861 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3444 | 732 | from itertools import product as prod
n, m = [int(x) for x in input().split()]
gr = [[] for _ in range(n)]
for _ in range(m):
a, b, c = [int(x) for x in input().split()]
a -= 1
b -= 1
gr[a].append((b, c))
gr[b].append((a, c))
numset = set(range(n))
def dist(i, j, gr=gr):
tmp_d = float("inf")
... |
s661287284 | p03837 | u010110540 | 1487006621 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3444 | 491 | MAX = 9999
N, M = map(int, input().split())
cost = []
dist = [[MAX] * N for i in range(N)]
for i in range(N):
dist[i][i] = 0
#print(dist)
for i in range(M):
cost.append(list(map(int, input().split())))
#print(cost)
for a, b, c in cost:
dist[a-1][b-1] = c
dist[b-1][a-1] = c
print(dist)
for k in range(N):
for... |
s566998985 | p03837 | u156163787 | 1483846387 | Python | PyPy3 (2.4.0) | py | Runtime Error | 193 | 38640 | 787 | import numpy
import random
def used(dp,u,v,w):
n=len(dp)
for i in range(n):
for j in range(i+1,n):
if dp[i][j]==dp[i][u]+w+dp[v][j] or dp[i][j]==dp[i][v]+w+dp[u][j]:
return True
return False
while 1:
try:
n,m=map(int,input().split())
es=[]
fo... |
s722905919 | p03837 | u205166254 | 1483844530 | Python | PyPy3 (2.4.0) | py | Runtime Error | 1109 | 45916 | 1053 | n, m = map(int, input().split())
nd = [[] for _ in range(n + 1)]
eg = [True] * m
for i in range(m):
a, b, c = map(int, input().split())
nd[a].append([b, c, i])
nd[b].append([a, c, i])
for i in range(1, n):
for j in range(i + 1, n + 1):
tr = [10 * 10] * (n + 1)
fg = [False] * (n + 1)
... |
s546864772 | p03838 | u306412379 | 1601324047 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9036 | 381 | x, y = map(int, input().split())
if 0 <= x <= y:
ans = y - x
elif 0 <= y <= x:
ans = x + y + 1
elif x < 0 and 0 < y and -x <= y:
ans = x + y + 1
elif x < 0 and 0 < y and -x > y:
ans = y - x
elif x > 0 and y < 0 and -x <= y:
ans = x + y + 1
elif x > 0 and y < 0 and -x > y:
ans = -x - y + 2
elif x < y < ... |
s933302834 | p03838 | u350093546 | 1600780701 | Python | PyPy3 (7.3.0) | py | Runtime Error | 108 | 74572 | 123 | x,y=map(int,input().split())
ans=abs(abs(x)-abs(y))
if y<x<0 or 0<y<x:
ans+=2
elif y<x x<0<y:
ans+=1
print(ans) |
s982916278 | p03838 | u634046173 | 1600146451 | Python | PyPy3 (7.3.0) | py | Runtime Error | 79 | 74748 | 449 | x,y = map(int, input().split())
if x == y :
print(0)
elif (-x) == y:
print(1)
elif x >= 0 and x <= y:
print(y-x)
elif x >= 0 and x > y:
if x <= (-y): #10 -11
print(abs(x-(-y))+1)
else: # 10 -9
print(abs(y-(-x))+1)
elif x < 0 and x > y: # -1 -3
print(min(abs(x-y)+2, -y -x+1))
elif... |
s043530974 | p03838 | u411923565 | 1599838226 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9124 | 355 | # A - Simple Calculator
x,y = map(int,input().split())
if y > x:
ans = y - x
else:
# B を押す
if x != 0:
x *= -1
ans = 1
# y の絶対値との差分を押す
ans += max(abs(x),abs(y)) - min(abs(x),abs(y))
x += max(abs(x),abs(y)) - min(abs(x),abs(y))
# B を押す
if x != y:
ans += 1
print(ans... |
s376300250 | p03838 | u536034761 | 1599515259 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9208 | 248 | x, y = map(int, input().split())
ans = 10 ** 9 + 3
if y >= x:
ans = min(ans, abs(y - x))
if - y >= x:
ans = min(ans, abs(-y - x) + 1)
if y >= -x:
ans = min(ans, abs(y + x) + 1)
if - y >= -x:
ans(min(ans, abs(-y + x) + 2))
print(ans) |
s181139044 | p03838 | u794448346 | 1598563020 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9028 | 484 | x,y = map(int,input().split())
ax = abs(x)
ay = abs(y)
if ax == ay and x != y:
a = 1
elif x > y and 0 < y:
a = ax - ay + 2
elif x > y and y = 0:
a = ax - ay + 1
elif x > y and 0 > y:
if ay > ax and x >= 0:
a = ay - ax + 1
elif ay > ax and x < 0:
a = ay - ax + 2
elif ax > ay:
... |
s079001556 | p03838 | u794448346 | 1598561248 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8992 | 391 | x,y = map(int,input().split())
ax = abs(x)
ay = abs(y)
if x > y and 0 < y:
x = -x
a = y - x + 1
if ay > ax and x >= 0:
a = ay - x +
elif x > y and 0 >= y:
if ay > ax and x >= 0:
a = ay - x + 1
elif ay > ax and x < 0:
a = ay + x + 2
else:
a = 1
elif y > x and x ... |
s023056514 | p03838 | u397384480 | 1598559482 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9128 | 533 | x,y = map(int,input().split())
if y == x:
print(0)
else:
if abs(y) >= abs(x):
tmp = abs(y)-abs(x)
if x>=0 and y>=0:
print(tmp)
elif x>=0 and y<0:
print(tmp+1)
elif x<0 and y>=0:
print(tmp+1)
else:
print(abs(y)-x+1)
else:... |
s579767658 | p03838 | u397384480 | 1598559456 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9224 | 534 | x,y = map(int,input().split())
if y == x:
print(0)
else:
if abs(y) >= abs(x):
tmp = abs(y)-abs(x)
if x>=0 and y>=0:
print(tmp)
elif x>=0 and y<0:
print(tmp+1)
elif x<0 and y>=0:
#print(tmp+1)
print(1/0)
else:
pri... |
s331784934 | p03838 | u397384480 | 1598559420 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9228 | 534 | x,y = map(int,input().split())
if y == x:
print(0)
else:
if abs(y) >= abs(x):
tmp = abs(y)-abs(x)
if x>=0 and y>=0:
print(tmp)
elif x>=0 and y<0:
print(tmp+1)
elif x<0 and y>=0:
print(tmp+1)
else:
#print(abs(y)-x+1)
... |
s861017933 | p03838 | u072717685 | 1597638960 | Python | PyPy3 (7.3.0) | py | Runtime Error | 93 | 74744 | 670 | import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
x, y = map(int, input().split())
if x < y:
if 0 < y and 0 < x:
print(y - x)
elif 0 < x and 0 < y:
print(y - abs(x) + 1)
elif y == 0:
print(-x)
elif x == 0:
... |
s962095632 | p03838 | u503111914 | 1597375246 | Python | Python (3.8.2) | py | Runtime Error | 28 | 9108 | 213 | x,y = map(int,input().split())
if abs(x) == abs(y):
print(0 if a == b else 1)
elif x < y:
print(min(y - x,abs(y + x) + 1))
else:
print(min(abs(y+x),abs(y-x))+ 1 if a * b <= 0 else min(abs(y+x),abs(y-x))+ 2)
|
s401348994 | p03838 | u503111914 | 1597373943 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9096 | 92 | x,y = map(int,input().split())
ans = abs(abs(x)-abs(y))
print(ans if X * y > 0 else ans + 1) |
s666062135 | p03838 | u503111914 | 1597370863 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8920 | 61 | x,y = map(int,input().split())
print(min(abs(y-x),abs(x+y)+1) |
s514721457 | p03838 | u201928947 | 1597368269 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68744 | 151 | x,y = map(int,input().split())
ans = 10000000000
for a,b,c in [(x,y,0)(x,-y,1)(-x,y,1)(-x,-y,2)]:
if a < b:
ans = min(ans,b-a+c)
print(ans) |
s228696393 | p03838 | u835283937 | 1596364829 | Python | Python (3.8.2) | py | Runtime Error | 21 | 9024 | 247 | def main2():
x, y = map(int, input().split())
delta = abs(abs(x) - abs(y))
c1 = delta + 0 + 0
c2 = delta + 0 + 1
c3 = delta + 1 + 0
c4 = delta + 1 + 1
print(min(c1, c2, c3, c4))
if __name__ == "__main__":
main() |
s171208704 | p03838 | u933341648 | 1595676284 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9132 | 145 | x, y = map(int, input().split())
d = abs(abs(y) - abs(x))
if x // abs(x) == y // abs(y):
if x > y:
d += 2
else:
d += 1
print(d)
|
s531706178 | p03838 | u781262926 | 1594769415 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8992 | 159 | x, y = map(int, input().split())
d = abs(abs(x) - abs(y))
if 0 <= x < y or x < y <= 0:
print(d)
elif y <= 0 <= x or x < 0 < y:
print(d+1)
else
print(d+2) |
s286581943 | p03838 | u597455618 | 1594423299 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8944 | 129 | def main():
x, y = map(int, input().split())
print(min(max(y-x, x-y+2), abs(x+y)+1)
if __name__ == '__main__':
main() |
s455297817 | p03838 | u597455618 | 1594423217 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8956 | 129 | def main():
x, y = map(int, input().split())
print(min(max(x+y, y-x+2), abs(x+y)+1)
if __name__ == '__main__':
main() |
s020522061 | p03838 | u437215432 | 1594061231 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9204 | 797 | # AGC008A
def func(x, y):
if y >= x:
if x >= 0:
return y - x
else:
if y > 0:
if abs(x) > abs(y):
return 1 - x - y
else:
return 1 + x + y
elif y <= 0:
return y - x
else:
... |
s888529284 | p03838 | u962718741 | 1594049857 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9188 | 393 | def main():
x, y = map(int, input().split())
A = abs(abs(x) - abs(y))
if x * y > 0:
if x < y:
B = 0
else:
B = 2
elif x == 0:
if x < y:
B = 0
else:
B = 1
elif y == 0:
if x < y:
B = 0
else:
... |
s111324131 | p03838 | u848263468 | 1593197221 | Python | Python (3.8.2) | py | Runtime Error | 30 | 8868 | 177 | x,y=map(int,input().split())
if abs(x),abs(y)>pow(10,9):
exit()
s=abs(y)-abs(x)
buttona=s
buttonb=0
if y < 0:
buttonb+=1
if x < 0:
buttonb+=1
print(buttona+buttonb)
|
s530499400 | p03838 | u179169725 | 1592967099 | Python | PyPy3 (7.3.0) | py | Runtime Error | 96 | 74704 | 412 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x * y < 0: # 異符号ならば答えは一つ
print(abs(abs(x) - abs(y)) + 1)
elif 0 <= x < y:
print(y - x)
elif 0 <= y < x:
print(x + y + 1)
raise ValueError()
elif x < y <= 0:
print(y - x)
else:
... |
s964565214 | p03838 | u179169725 | 1592967078 | Python | PyPy3 (7.3.0) | py | Runtime Error | 85 | 68348 | 412 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x * y < 0: # 異符号ならば答えは一つ
print(abs(abs(x) - abs(y)) + 1)
elif 0 <= x < y:
print(y - x)
elif 0 <= y < x:
print(x + y + 1)
elif x < y <= 0:
print(y - x)
raise ValueError()
else:
... |
s161665659 | p03838 | u179169725 | 1592966058 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9200 | 587 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x > 0:
if x < y:
print(y - x)
elif 0 <= y: # ここがちがうまじ?
print(x + y + 1)
else:
print(min(1 + x + y, -y - x + 1, key=lambda z: 10 ** 10 if z < 1 else z))
r... |
s356011674 | p03838 | u179169725 | 1592965987 | Python | PyPy3 (7.3.0) | py | Runtime Error | 86 | 74496 | 602 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x > 0:
if x < y:
print(y - x)
elif 0 <= y: # ここがちがうまじ?
print(x + y + 1)
else:
print(min(1 + x + y, -y - x + 1, key=lambda z: 10**10 if z < 1 else z))
else: # xが... |
s650925471 | p03838 | u179169725 | 1592965481 | Python | PyPy3 (7.3.0) | py | Runtime Error | 84 | 74664 | 517 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x > 0:
if x < y:
print(y - x)
elif 0 <= y: # ここがちがう
print(x + y + 1)
else:
print(min(1 + x + y, -y - x + 1))
else: # xが負
if y < x:
print(2 + x - y)
... |
s450434611 | p03838 | u179169725 | 1592965455 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74588 | 498 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x > 0:
if x < y:
print(y - x)
elif 0 <= y: # ここがちがう
print(x + y + 1)
else:
print(min(1 + x + y, -y - x + 1))
else: # xが負
if y < x:
print(2 + x - y)
... |
s595319693 | p03838 | u179169725 | 1592965418 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 74544 | 477 | # https://atcoder.jp/contests/agc008/tasks/agc008_a
# どう見ても符号反転は1回するのが最適
# ひたすら場合分け
x, y = map(int, input().split())
if x > 0:
if x < y:
print(y - x)
elif 0 <= y:
print(x + y + 1)
raise ValueError()
else:
print(min(1 + x + y, -y - x + 1))
else: # xが負
if y < x:
... |
s923318393 | p03838 | u445624660 | 1592713010 | Python | Python (3.8.2) | py | Runtime Error | 33 | 9140 | 1195 | # 0<=a<=bのときの攻め方 ... 進むしかないね
# 0<=b<=a ... 一回だけ符号をかえたらあとは進むしかないね <- 意味不明だがなんかちがうらしい は????????????????
# ...よくよく考えたら進んだあとにもっかい符号変えてショートカットできるわ...
# a<=0<=b ... abs(a)<abs(b)なら符号をかえたらショートカットできるね ちがったらすすむしかないね
# b<=0<=a ... abs(a)<abs(b)ならすすんでから符号かえればいいね ちがったら符号かえてからすすめばいいね これは同じことだよ
# a<=b<=0 ... 進む... |
s330095315 | p03838 | u445624660 | 1592712509 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9204 | 981 | # 0<=a<=bのときの攻め方 ... 進むしかないね
# 0<=b<=a ... 一回だけ符号をかえたらあとは進むしかないね
# a<=0<=b ... abs(a)<abs(b)なら符号をかえたらショートカットできるね ちがったらすすむしかないね
# b<=0<=a ... abs(a)<abs(b)ならすすんでから符号かえればいいね ちがったら符号かえてからすすめばいいね これは同じことだよ
# a<=b<=0 ... 進むしかないね
# b<=a<=0 ... 符号変えてすすんで符号かえればいいね
a, b = map(int, input().split())
if 0 <= a <= b:
... |
s526861220 | p03838 | u445624660 | 1592712149 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9196 | 984 | # 0<=a<=bのときの攻め方 ... 進むしかないね
# 0<=b<=a ... 一回だけ符号をかえたらあとは進むしかないね
# a<=0<=b ... abs(a)<abs(b)なら符号をかえたらショートカットできるね ちがったらすすむしかないね
# b<=0<=a ... abs(a)<abs(b)ならすすんでから符号かえればいいね ちがったら符号かえてからすすめばいいね これは同じことだよ
# a<=b<=0 ... 進むしかないね
# b<=a<=0 ... 符号変えてすすんで符号かえればいいね
a, b = map(int, input().split())
if 0 <= a <= b:
... |
s239420898 | p03838 | u445624660 | 1592712107 | Python | Python (3.8.2) | py | Runtime Error | 31 | 9132 | 974 | # 0<=a<=bのときの攻め方 ... 進むしかないね
# 0<=b<=a ... 一回だけ符号をかえたらあとは進むしかないね
# a<=0<=b ... abs(a)<abs(b)なら符号をかえたらショートカットできるね ちがったらすすむしかないね
# b<=0<=a ... abs(a)<abs(b)ならすすんでから符号かえればいいね ちがったら符号かえてからすすめばいいね これは同じことだよ
# a<=b<=0 ... 進むしかないね
# b<=a<=0 ... 符号変えてすすんで符号かえればいいね
a, b = map(int, input().split())
if 0 <= a <= b:
... |
s397988851 | p03838 | u263824932 | 1591839586 | Python | PyPy3 (2.4.0) | py | Runtime Error | 164 | 38256 | 421 | x,y=map(int,input().split())
if abs(x) == abs(y):
print(1)
elif x==0:
if y < 0:
print(1-y)
else:
print(y)
elif x > 0:
if abs(y) < x:
print(1+y+x)
else:
if y > 0:
print(y-x)
else:
print(y-x)+1
else:
if abs(y) <x:
print(y-x)
... |
s742817113 | p03838 | u474925961 | 1591500698 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 191 | x,y=map(int,input().split())
cnt=0
cnt+=y-x
cnt1=1
cnt1+=y+x
cnt2=1
cnt2+=-y-x
cnt3=2
cnt3+=-y+x
a=[cnt,cnt1,cnt2,cnt3]
foe i in a:
if i<0:
i=10**10
print(min(cnt,cnt1,cnt2,cnt3)) |
s773563313 | p03838 | u227085629 | 1591136352 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 147 | x,y = map(int,input().split())
k = abs(abs(x)-abs(y))
if x < 0 and y <= 0 or x >= 0 and y > 0:
if x > y:
ans += 2
else:
ans += 1
print(ans) |
s663252774 | p03838 | u924691798 | 1590871069 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 289 | x, y = map(int, input().split())
if x >= 0 and y >= 0:
if x <= y:
ans = abs(x-y)
else:
ans = abs(x-y)+2
elif x < 0 and y < 0:
if x <= y:
ans = abs(x-y)
else:
ans = abs(x-y)+2
elif x >= 0 and y <= 0:
ans = abs(abs(x)-abs(y))+1
print(ans)
|
s737290257 | p03838 | u075595666 | 1590815550 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38384 | 225 | a = list(map(int,input().split()))
ans = a[1]
c = a[0]%2+a[3]%2+a[4]%2
if c == 3:
ans += a[0]+a[3]+a[4]
elif c == 2 and a[0]*a[3]*a[4] != 0:
ans += a[0]+a[3]+a[4]-1
else:
ans += a[0]//2*2+a[3]//2*2+a[4]//2*2
print(ans)
|
s195828599 | p03838 | u346395915 | 1590590541 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 289 | sys.stdin = open('../ABC/test.txt')
x, y = map(int, input().split())
ans = 10**18
if y - x >= 0:
ans = min(ans, y-x)
x *= -1
if y - x >= 0:
ans = min(ans, y-x)
x *= -1
y *= -1
if y - x >= 0:
ans = min(ans, y-x)
x *= -1
if y -x >= 0:
ans = min(ans, y-x)
print(ans) |
s211220213 | p03838 | u314089899 | 1590554979 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 391 | x,y = map(int, input().split())
#方法は
#ずっと加算 #ex 5 10 , -10 -5
#反転させてから加算 ex 10 -5 , -10 20
#反転して加算して反転 -10 -20, 10 -5
#の3パターン
#ずっと加算
ans = 2*10**9
if y==x:
print(0)
elif y=-x:
print(1)
else:
for i in [y-x,abs(y-x),1+y-(-x),1+abs(y-(-x))+1]:
if i > 0:
ans = min(ans,i)
print(ans) |
s095077899 | p03838 | u314089899 | 1590554822 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 288 | x,y = map(int, input().split())
#方法は
#ずっと加算 #ex 5 10
#反転させてから加算 ex 10 -5
#反転して加算して反転 -10 -20
#の3パターン
#ずっと加算
ans = 2*10**9
for i in [y-x,1+y-(-x),1+abs(y-(-x))+1]
if i > 0:
ans = min(ans,i)
print(ans) |
s834367313 | p03838 | u314089899 | 1590554053 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 1193 | x,y = map(int, input().split())
if x == y: #ex. 10 10
print(0)
elif x == -y: #ex. 10 -10
print(1)
elif x == 0:
if y > 0:
print(y) #数字を合わせるだけ
elif y < 0:
print(y+1) #数字を合わせてから反転
elif x > 0:
if y > 0:
if x > y: #20 10
print(1+x-y+1) #反転させて合わせて反転
elif x < y:... |
s023972756 | p03838 | u871980676 | 1590260436 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 179 | x,y=map(int,input().split())
res = []
if x>0 and y>0:
res.append(abs(y-x))
elif x*y<0:
res.append(1+abs(y+x))
elif x<0 and y<0:
res.append(2+abs(y-x))
print(min(res))
|
s844551014 | p03838 | u811000506 | 1590197933 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 172 | x,y = map(int,input().split())
if x<0:
m_x = x*(-1)
x = m_x*(-1)
if x<=y:
print(y-x)
elif m_x<=y and y<x:
print(abs(y-m_x)+1)
else:
print(abs(y-x)+2) |
s807967925 | p03838 | u502731482 | 1590195598 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 398 | x, y = map(int, input().split())
ans = 10 ** 10
for i in range(2):
for j in range(2):
a = x
b = y
cnt = 0
if i == 1:
a *= -1
cnt = 1
if j == 1:
b *= -1
cnt += 1
if a >= b:
continue
cnt += b - a
... |
s734523312 | p03838 | u276204978 | 1589612737 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | x, y = map(int, input().split())
def f(x):
return 10**10 if x < 0 else x
print(min(f(y-x), f(y+x)+1, f(-y-x)+1, f(-y+x2))) |
s566270383 | p03838 | u276204978 | 1589612607 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | x, y = map(int, input().split())
mn = 10**9
f = lambda x: mn if x < 0 else x
print(min(f(y-x), f(y+x)+1, f(-y-x)+1, f(-y+x2))) |
s232686588 | p03838 | u474423089 | 1589509092 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 112 | from math import inf
A,B=map(int,input().split(' '))
print(min([i if i>0 else inf for i in [B-A,A+B+1,-B+A+2]])) |
s481384752 | p03838 | u474423089 | 1589507802 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 171 | A,B=map(int,input().split(' '))
if A<=B:
print(min(B-A,abs(B)-abs(A)))
elif A<0 or 0<B:
raise TypeError
print(A-B+2)
else:
raise TypeError
print(A+B+1) |
s866991176 | p03838 | u263753244 | 1589077227 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38256 | 257 | x,y=map(int,input().split())
x0=x
y0=y
X=[1,1,-1,-1]
Y=[1,-1,1,-1]
l=[]
for i in range(4):
x=x*X[i]
y=y*Y[i]
if y-x>=0:
q=y-x
if X[i]==-1:
q+=1
if Y[i]==-1:
q+=1
l.append(q)
x=x0
y=y0
print(min(l)) |
s779049357 | p03838 | u293198424 | 1588693140 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38640 | 184 | x,y = map(int,input().split())
mn = 10**10
if x<=y: ans = min(ans,y-x)
if -x<=y: ans = min(ans,1+y-(-x))
if x<=-y: ans = min(ans,-y-x+1)
if -x<=-y: ans = min(ans,-y-(-x)+1)
print(ans)
|
s921335766 | p03838 | u366886346 | 1588650425 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 749 | n=int(input())
x=list(map(int,input().split()))
a=[]
b=[]
ans=[]
yn=0
count=1
count2=0
count3=0
for i in range(n):
check=i*n+((n-i-1)*(n-i))//2
if check+i+1<x[i] or x[i]<((i+2)*(i+1))//2:
yn+=1
break
lena=len(a)
if yn==1:
print("No")
else:
print("Yes")
for i in range(n):
for ... |
s777514808 | p03838 | u459419927 | 1588253123 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 317 | from sys import stdin
N,Y=list(map(int,stdin.readline().strip().split()))
YY=abs(Y)
NN=abs(N)
count=YY-NN
if count<0:
print(NN-YY+1)
elif count==0:print(0)
else:
if N>0 and Y>0:
print(count)
elif N>0 and Y<0:
print(count+1)
elif N<0 and Y>0:
print(count+1)
else:N<0(count+2) |
s889853937 | p03838 | u459419927 | 1588252982 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 290 | from sys import stdin
N,Y=list(map(int,stdin.readline().strip().split()))
YY=abs(Y)
NN=abs(N)
count=YY-NN
if count<0:
print(Y-N)
else:
if N>0 and Y>0:
print(count)
elif N>0 and Y<0:
print(count+1)
elif N<0 and Y>0:
print(count+1)
else:N<0(count+2) |
s807976095 | p03838 | u810356688 | 1587680761 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 474 | import sys
def input(): return sys.stdin.readline().rstrip()
def main():
x,y=map(int,input().split())
if x==-y:
print(1)
elif x*y>0:
if x<y:
print(y-x)
else:
print(x-y+2)
elif x*y<0
print(abs(x+y)+1)
else:
if x>0:
print(x+1)... |
s066291906 | p03838 | u375695365 | 1587665956 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 340 | x,y=map(int,input().split())
ans=abs(x)-abs(y)
if ans==0:
if x==y:
print(ans)
else:
print(1)
elif ans<0:
if x<0 and y<0 :
print(ans+2)
else:
print(ans)
else:
if x<=0 and y=<0:
print(abs(ans))
elif 0<x and 0<y:
print(abs(ans)+2)
else:
... |
s147104270 | p03838 | u024340351 | 1587660144 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 623 | x, y = map(int, input().split())
if x == y:
print(0)
exit()
if x == -y:
print(1)
exit()
if x > y:
if x > 0 and y > 0:
print(x-y+2)
exit()
elif x > 0 and y == 0:
print(x+1)
exit()
elif x > 0 and abs(y) <x:
print(1+x-abs(y))
exit()
elif x>0 and abs(y) == x:
print(1)
exit()
elif x >0 and abs(y)... |
s676240488 | p03838 | u148551245 | 1587571151 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 92 | a, b = map(int, input().split())
ans = min(
b - a if b >= a else 2 + (-b - a)
)
print(ans) |
s549064933 | p03838 | u668785999 | 1586647789 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 506 | x,y = map(int,input().split())
ans = 0
if(y > 0):
if(x > y):
ans += 1
ans += -y +x
elif(x >= 0):
ans += y -x
elif(x > -y):
ans += 1
ans += y + x
else:
ans += 1
ans += -y -x
else:
if(x > -y):
ans += 1
ans += y + x
elif(x >= ... |
s572258726 | p03838 | u135389999 | 1584764162 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 762 | x,y = map(int,input().split())
if abs(y) > abs(x):
if x > 0 and y > 0:
print(y-x)
elif x < 0 and y <0:
print(abs(y)-abs(x)+2)
else:
print(abs(y)-abs(x)+1)
elif abs(y) < abs(x):
if x > 0 and y > 0:
print(x - y + 2)
elif x < 0 and y <0:
print(abs(y-x)+ 2)
else:
print(abs(abs(y)-abs(x... |
s330695983 | p03838 | u135389999 | 1584763728 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 380 | x,y = map(int,input().split())
if abs(y) > abs(x):
if x > 0 and y > 0:
print(y-x)
elif x < 0 and y <0:
print(abs(y)-abs(x)+2)
else:
print(abs(y)-abs(x)+1)
elif abs(y) < abs(x):
if x > 0 and y > 0:
print(ads(y-x+2))
elif x < 0 and y <0:
print(abs(y-x))
else:
print(abs(abs(y)-abs(x))... |
s779646910 | p03838 | u135389999 | 1584762973 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 354 | x,y = map(int,input().split())
if abs(y) > abs(x):
if x > 0 and y > 0:
print(y-x)
elif x < 0 and y <0:
print(y-x+2)
else:
print(y-x+1)
elif abs(y) < abs(x):
if x > 0 and y > 0:
print(ads(y-x+2))
elif x < 0 and y <0:
print(abs(y-x))
else:
print(abs(y-x+1))
else:
if x == y:
prin... |
s976380877 | p03838 | u434872492 | 1584676412 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 487 | x,y=map(int,input().split())
ans=0
if x<y:
if 0<=x:
ans=abs(y-x)
else:
z=abs(x)
ans=abs(y-x)
if z<=y:
b=ans(y-z)
if b<ans:
ans=1
ans+=b
else:
if 0<=y:
z=-x
ans+=1
ans+=abs(y-z)
else:
y... |
s500393814 | p03838 | u836737505 | 1584589465 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 383 | x,y = map(int, input().split())
if abs(x) <= abs(y):
c = abs(abs(x) - abs(y))
if x >= 0 and y >= 0:
print(c)
elif x < 0 and y < 0:
print(c+2)
else:
print(c+1)
else:
c = abs(abs(x) - abs(y))
if y = 0:
print(c)
elif x >= 0 and y >= 0:
print(c+2)
elif... |
s145179088 | p03838 | u813174766 | 1584459716 | Python | PyPy3 (2.4.0) | py | Runtime Error | 162 | 38256 | 59 | a,b=map(int,input()split())
print(min(abs(a-b),abs(a+b)+1)) |
s421611383 | p03838 | u547608423 | 1583737014 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 291 | x,y=map(int,input().split())
X=abs(x)
Y=abs(y)
if x<y:
if x*y>0:
print(y-x)
elif x*y==0:
print(abs(X-Y))
else:
print(abs(X-Y)+1)
else:
if x*y>=0:
print(abs(X-Y)+2)
elif x*y=0:
print(abs(X-Y)+1)
else:
print(abs(X-Y)+1) |
s690431413 | p03838 | u704563784 | 1583372371 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 323 | a, b = map(int, input().split())
def cal(a,b):
if a < b:
dist1 = b - a
dist2 = abs(b + a) + 1
return min(dist1, dist2)
elif a > b:
if a >= 0 and b < 0:
return abs(a+b) + 1
else:
dist1 = a - b + 2
return min(dist1, dist2)
print(cal(a,b))
... |
s005388299 | p03838 | u088552457 | 1583042262 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38384 | 190 | x, y = map(int, input().split())
l = []
if x <= y:
l.appen(y-x)
if -x <= y:
l.append(y + x + 1)
if x <= -y:
l.append(-y-x+1)
if -x <= -y:
l.append(-y+x+2)
print(min(l)) |
s325997946 | p03838 | u088552457 | 1583042128 | Python | PyPy3 (2.4.0) | py | Runtime Error | 161 | 38256 | 190 | x, y = map(int, input().split())
l = []
if x <= y:
l.appen(y-x)
if -x <= y:
l.append(y + x + 1)
if x <= -y:
l.append(-y-x+1)
if -x <= -y:
l.append(-y+x+2)
print(min(l)) |
s297799009 | p03838 | u857428111 | 1582517398 | Python | PyPy3 (2.4.0) | py | Runtime Error | 161 | 38256 | 83 | x,y=map(int,input())
t=abs(y)-abs(x)
if x*y<0:
t+=1
elif x>y:
t+=2
print(t) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.