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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s726869500 | p00118 | u104911888 | 1370443119 | Python | Python | py | Runtime Error | 0 | 0 | 464 | mv=((0,1),(0,-1),(1,0),(-1,0))
def dfs(y,x):
c=L[y][x]
L[y][x]="."
for dx,dy in mv:
mx=x+dx
my=y+dy
if 0<=mx<W and 0<=my<H and L[my][mx]==c:
dfs(my,mx)
while True:
H,W=map(int,raw_input().split())
if H==W==0:break
L=[list(raw_input()) for i in range(H)]
cn... |
s566944681 | p00118 | u633068244 | 1399193290 | Python | Python | py | Runtime Error | 0 | 0 | 494 | def solve(s,i,x,y):
A[y][x] = i
if x < W-1 and A[y][x+1] == s: solve(s,i,x+1,y)
if y < H-1 and A[y+1][x] == s: solve(s,i,x,y+1)
if x > 0 and A[y][x-1] == s: solve(s,i,x-1,y)
if y > 0 and A[y-1][x] == s: solve(s,i,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) fo... |
s591899040 | p00118 | u633068244 | 1399193773 | Python | Python | py | Runtime Error | 0 | 0 | 448 | def fill0(s,x,y):
A[y][x] = 0
if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in rang... |
s845204267 | p00118 | u633068244 | 1399193832 | Python | Python | py | Runtime Error | 0 | 0 | 459 | def fill0(s,x,y):
A[y][x] = 0
if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0 and W == 0: break
A = [list(raw_input()) fo... |
s977223317 | p00118 | u633068244 | 1399194220 | Python | Python | py | Runtime Error | 0 | 0 | 466 | def fill0(A,s,x,y):
A[y][x] = 0
if x < W-1 and A[y][x+1] == s: fill0(A,s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(A,s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(A,s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(A,s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for... |
s038812201 | p00118 | u633068244 | 1399204392 | Python | Python | py | Runtime Error | 0 | 0 | 386 | def fill0(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for y in range(H):
for x in range(W):
if A[y][x... |
s006416354 | p00118 | u633068244 | 1399204504 | Python | Python | py | Runtime Error | 0 | 0 | 393 | def fill0(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
return
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for y in range(H):
for x in range(W):
if... |
s276553282 | p00118 | u633068244 | 1399204805 | Python | Python | py | Runtime Error | 0 | 0 | 386 | def fill0(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for y in range(H):
for x in range(W):
if A[y][x]... |
s994137520 | p00118 | u633068244 | 1399204891 | Python | Python | py | Runtime Error | 0 | 0 | 222 | def fill0(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
print 1 |
s710452918 | p00118 | u633068244 | 1399204900 | Python | Python | py | Runtime Error | 0 | 0 | 213 | def fill0(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break |
s167900983 | p00118 | u633068244 | 1399205038 | Python | Python | py | Runtime Error | 0 | 0 | 383 | def fill0(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(s,x+1,y); fill0(s,x,y+1); fill0(s,x-1,y); fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for y in range(H):
for x in range(W):
if A[y][x]... |
s227513265 | p00118 | u633068244 | 1399205170 | Python | Python | py | Runtime Error | 0 | 0 | 419 | def fill0(A,H,W,s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill0(A,H,W,s,x+1,y); fill0(A,H,W,s,x,y+1); fill0(A,H,W,s,x-1,y); fill0(A,H,W,s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for y in range(H):
fo... |
s198980601 | p00118 | u633068244 | 1399205364 | Python | Python | py | Runtime Error | 0 | 0 | 367 | def fill(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill(s,x+1,y); fill(s,x,y+1); fill(s,x-1,y); fill(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for y in range(H):
for x in range(W):
if A[y][x] != 0... |
s825814472 | p00118 | u633068244 | 1399205469 | Python | Python | py | Runtime Error | 0 | 0 | 367 | def fill(s,x,y):
if 0 <= x <= W-1 and 0 <= y <= H-1 and A[y][x] == s:
A[y][x] = 0
fill(s,x+1,y); fill(s,x,y+1); fill(s,x-1,y); fill(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in range(H)]
ans = 0
for b in range(H):
for a in range(W):
if A[b][a] != 0... |
s505126420 | p00118 | u633068244 | 1400122435 | Python | Python | py | Runtime Error | 0 | 0 | 616 | def fill0(s,x,y):
A[y][x] = 0
if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = ... |
s801372266 | p00118 | u633068244 | 1400122507 | Python | Python | py | Runtime Error | 0 | 0 | 473 | def fill0(s,x,y):
try: A[y][x] = 0
except: pass
if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_inp... |
s824668782 | p00118 | u633068244 | 1400122614 | Python | Python | py | Runtime Error | 0 | 0 | 462 | def fill0(s,x,y):
A[y][x] = 0
if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for i in rang... |
s681045379 | p00118 | u633068244 | 1400122804 | Python | Python | py | Runtime Error | 0 | 0 | 530 | def fill0(s,x,y):
A[y][x] = 0
try: if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
except: pass
try: if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
except: pass
try: if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
except: pass
try: if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
except: pass
while 1:
H,W = map(int,... |
s430528704 | p00118 | u633068244 | 1400122848 | Python | Python | py | Runtime Error | 0 | 0 | 549 | def fill0(s,x,y):
try: A[y][x] = 0
except: pass
try: if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
except: pass
try: if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
except: pass
try: if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
except: pass
try: if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
except: pass
while... |
s987440849 | p00118 | u633068244 | 1400122996 | Python | Python | py | Runtime Error | 0 | 0 | 464 | def fill0(s,x,y):
global A
A[y][x] = 0
if x < W-1 and A[y][x+1] == s: fill0(s,x+1,y)
if y < H-1 and A[y+1][x] == s: fill0(s,x,y+1)
if x > 0 and A[y][x-1] == s: fill0(s,x-1,y)
if y > 0 and A[y-1][x] == s: fill0(s,x,y-1)
while 1:
H,W = map(int,raw_input().split())
if H == 0: break
A = [list(raw_input()) for... |
s623010221 | p00119 | u462831976 | 1494788020 | Python | Python3 | py | Runtime Error | 20 | 7784 | 662 | # -*- coding: utf-8 -*-
import sys
import os
import math
m = int(input())
n = int(input())
# Manage people who entered earlier than me in a list
G = [[] for i in range(m)]
for i in range(n):
x, y = map(int, input().split())
x -= 1
y -= 1
G[y].append(x)
printed = [False] * m
while printed.count(Fal... |
s436478476 | p00119 | u633068244 | 1396259663 | Python | Python | py | Runtime Error | 0 | 0 | 228 | m = [i+1 for i in range(int(raw_input()))]
n = int(raw_input())
for i in range(n):
x,y = map(int, raw_input().split())
if m.index(x) > m.index(y):
r = m.pop(m.index(x))
m.insert(m.index(y),r)
for i in range(n):
print m[i] |
s059201532 | p00120 | u873482706 | 1435665549 | Python | Python | py | Runtime Error | 0 | 0 | 2152 | import math
def f1():
total = []
for i in range(len(c_l)-1):
x2 = 0
if (i+1) % 2 == 0:
x2 = (c_l[i+1]+c_l[i])**2 - (c_l[i+1]-c_l[i])**2
else:
x2 = (c_l[i]+c_l[i+1])**2 - (c_l[i]-c_l[i+1])**2
x = math.sqrt(x2)
total.append(x)
else:
tota... |
s675152272 | p00120 | u873482706 | 1435665907 | Python | Python | py | Runtime Error | 0 | 0 | 2177 | import math
def f1():
total = []
for i in range(len(c_l)-1):
x2 = 0
if (i+1) % 2 == 0:
x2 = (c_l[i+1]+c_l[i])**2 - (c_l[i+1]-c_l[i])**2
else:
x2 = (c_l[i]+c_l[i+1])**2 - (c_l[i]-c_l[i+1])**2
x = math.sqrt(x2)
total.append(x)
else:
tota... |
s725578392 | p00120 | u260980560 | 1437223871 | Python | Python | py | Runtime Error | 0 | 0 | 647 | import math
while True:
l = 0; r = []
try:
inp = map(int, raw_input().split())
l = inp[0]
r = inp[1:]
except EOFError:
break
n = len(r)
if 2*sum(r) <= l:
print "OK"
else:
r.sort()
s = []
for i in xrange(n/2):
s = [r[i]] ... |
s557473559 | p00120 | u462831976 | 1494881265 | Python | Python3 | py | Runtime Error | 0 | 0 | 1086 | # -*- coding: utf-8 -*-
import sys
import os
import math
def pythagoras(a, b):
return 2 * math.sqrt(a * b)
for s in sys.stdin:
lst = list(map(int, s.split()))
W = lst[0]
R = lst[1:]
R.sort()
n = len(R)
left = []
right = []
left.append(R.pop(0))
right.append(R.pop(0))
l ... |
s910378822 | p00121 | u260980560 | 1436290112 | Python | Python | py | Runtime Error | 0 | 0 | 859 | import sys
memo = {}
sys.setrecursionlimit(40320)
def swap(state, a, b):
state[a], state[b] = state[b], state[a]
def dfs(state, pos, c):
key = "".join(map(str, state))
if memo.has_key(key):
return memo[key]
memo[key] = c
if pos!=0 and pos!=4:
swap(state, pos-1, pos)
dfs(state... |
s934915372 | p00121 | u260980560 | 1436290215 | Python | Python | py | Runtime Error | 0 | 0 | 893 | import sys
memo = {}
sys.setrecursionlimit(40320)
def swap(state, a, b):
state[a], state[b] = state[b], state[a]
def dfs(state, pos, c):
key = "".join(map(str, state))
if memo.has_key(key):
return memo[key]
memo[key] = c
if pos!=0 and pos!=4:
swap(state, pos-1, pos)
dfs(state... |
s255773141 | p00121 | u577311000 | 1494004892 | Python | Python3 | py | Runtime Error | 0 | 0 | 2023 | # -*- coding: utf-8 -*-
#// left rotate
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[... |
s551281681 | p00121 | u577311000 | 1494005017 | Python | Python3 | py | Runtime Error | 0 | 0 | 2023 | # -*- coding: utf-8 -*-
#// left rotate
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[... |
s542515340 | p00121 | u577311000 | 1494005169 | Python | Python3 | py | Runtime Error | 0 | 0 | 2003 | # -*- coding: utf-8 -*-
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[3],seq[7],seq[6]... |
s158550511 | p00121 | u577311000 | 1494005342 | Python | Python3 | py | Runtime Error | 0 | 0 | 2013 | # -*- coding: utf-8 -*-
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[3],seq[7],seq[6]... |
s716070847 | p00121 | u577311000 | 1494005360 | Python | Python3 | py | Runtime Error | 0 | 0 | 2033 | # -*- coding: utf-8 -*-
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[3],seq[7],seq[6]... |
s099253039 | p00121 | u577311000 | 1494005398 | Python | Python3 | py | Runtime Error | 0 | 0 | 2033 | # -*- coding: utf-8 -*-
"""
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[3],seq[7],s... |
s631014569 | p00121 | u577311000 | 1494005411 | Python | Python3 | py | Runtime Error | 0 | 0 | 2033 | # -*- coding: utf-8 -*-
"""
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[3],seq[7],s... |
s398914402 | p00121 | u577311000 | 1494005423 | Python | Python3 | py | Runtime Error | 0 | 0 | 2034 | # -*- coding: utf-8 -*-
"""
def rotate1L(seq):
seq = list(seq)
seq[1],seq[5],seq[4]=seq[5],seq[4],seq[1]
return tuple(seq)
def rotate2L(seq):
seq = list(seq)
seq[1],seq[2],seq[6],seq[5],seq[4]=seq[2],seq[6],seq[5],seq[4],seq[1]
return tuple(seq)
def rotate3L(seq):
seq = list(seq)
seq[1],seq[2],seq[3],seq[7],s... |
s311802555 | p00121 | u577311000 | 1494005514 | Python | Python3 | py | Runtime Error | 0 | 0 | 147 | # -*- coding: utf-8 -*-
def main():
line = input().strip()
while line!='':
print(0)
line = input().strip()
if __name__=='__main__':
main() |
s784461812 | p00121 | u577311000 | 1494005540 | Python | Python3 | py | Runtime Error | 0 | 0 | 126 | # -*- coding: utf-8 -*-
if __name__=='__main__':
line = input().strip()
while line!='':
print(0)
line = input().strip() |
s681620068 | p00121 | u577311000 | 1494005552 | Python | Python3 | py | Runtime Error | 0 | 0 | 97 | # -*- coding: utf-8 -*-
line = input().strip()
while line!='':
print(0)
line = input().strip() |
s241320054 | p00121 | u577311000 | 1494005561 | Python | Python3 | py | Runtime Error | 0 | 0 | 72 | line = input().strip()
while line!='':
print(0)
line = input().strip() |
s068172438 | p00121 | u577311000 | 1494005642 | Python | Python3 | py | Runtime Error | 0 | 0 | 261 | # -*- coding: utf-8 -*-
def main():
line = input().strip()
while line!='':
seq = list(map(int,line.split(' ')))
print(0)
line = input().strip()
if __name__=='__main__':
main()
"""
/*
0 1 2 3 4 5 6 7
1 0 2 3 4 5 6 7
7 6 5 4 3 2 1 0
0
1
28
*/
""" |
s791327717 | p00121 | u577311000 | 1494006016 | Python | Python3 | py | Runtime Error | 0 | 0 | 143 | while True:
line = input().strip()
if len(line)==0:break
print(0)
"""
/*
0 1 2 3 4 5 6 7
1 0 2 3 4 5 6 7
7 6 5 4 3 2 1 0
0
1
28
*/
""" |
s884613295 | p00121 | u577311000 | 1494006058 | Python | Python3 | py | Runtime Error | 0 | 0 | 165 | while 1:
try:
print ans[raw_input().replace(" ","")]
except:
break
"""
/*
0 1 2 3 4 5 6 7
1 0 2 3 4 5 6 7
7 6 5 4 3 2 1 0
0
1
28
*/
""" |
s562651604 | p00121 | u577311000 | 1494006073 | Python | Python3 | py | Runtime Error | 0 | 0 | 182 | try:
while True:
v=raw_input().split()
print(m[''.join(v)][1])
except EOFError:
pass
"""
/*
0 1 2 3 4 5 6 7
1 0 2 3 4 5 6 7
7 6 5 4 3 2 1 0
0
1
28
*/
""" |
s243039174 | p00121 | u577311000 | 1494006082 | Python | Python3 | py | Runtime Error | 0 | 0 | 182 | try:
while True:
v=raw_input().split()
print(m[''.join(v)][1])
except EOFError:
pass
"""
/*
0 1 2 3 4 5 6 7
1 0 2 3 4 5 6 7
7 6 5 4 3 2 1 0
0
1
28
*/
""" |
s542834838 | p00121 | u577311000 | 1494006130 | Python | Python3 | py | Runtime Error | 0 | 0 | 113 | m={}
try:
while True:
v=raw_input().split()
print(m[''.join(v)][1])
except EOFError:
pass |
s360489958 | p00121 | u577311000 | 1494006142 | Python | Python3 | py | Runtime Error | 0 | 0 | 213 | from __future__ import division
import sys
if sys.version_info[0]>=3: raw_input=input
X=4
Y=2
i=0
m={}
try:
while True:
v=raw_input().split()
print(m[''.join(v)][1])
except EOFError:
pass |
s803533227 | p00121 | u577311000 | 1494006160 | Python | Python3 | py | Runtime Error | 0 | 0 | 330 | from __future__ import division
import sys
if sys.version_info[0]>=3: raw_input=input
X=4
Y=2
i=0
m={}
prev={}
v=[]
for i in range(X*Y): v.append(str(i))
m[''.join(v)]=[0,0]
prev[''.join(v)]=[''.join(v),None]
q=[v]
while len(q)>0:
break
try:
while True:
v=raw_input().split()
print(m[''.join(v)][1])
except EOFEr... |
s778998180 | p00121 | u577311000 | 1494006206 | Python | Python3 | py | Runtime Error | 0 | 0 | 330 | from __future__ import division
import sys
if sys.version_info[0]>=3: raw_input=input
X=4
Y=2
i=0
m={}
prev={}
v=[]
for i in range(X*Y): v.append(str(i))
m[''.join(v)]=[0,0]
prev[''.join(v)]=[''.join(v),None]
q=[v]
while len(q)>0:
break
try:
while True:
v=raw_input().split()
print(m[''.join(v)][1])
except EOFEr... |
s789739954 | p00121 | u695154284 | 1505492209 | Python | Python3 | py | Runtime Error | 0 | 0 | 819 | from collections import deque
import copy
swap = [[1, 4], [0, 2, 5], [1, 3, 6], [2, 7], [0, 5], [1, 4, 6], [2, 5, 7], [3, 6]]
def bfs():
ia = list(range(8))
count = {str(ia): 0}
que = deque()
que.append((ia, 0))
while len(que) != 0:
state, cnt = que.popleft()
# pos:0?????????
... |
s147770044 | p00121 | u672443148 | 1515426139 | Python | Python3 | py | Runtime Error | 0 | 0 | 2891 | from __future__ import division
import sys
if sys.version_info[0]>=3: raw_input=input
X=4
Y=2
i=0
m={}
prev={}
v=[]
for i in range(X*Y): v.append(str(i))
m[''.join(v)]=[0,0]
prev[''.join(v)]=[''.join(v),None]
q=[v]
while len(q)>0:
v=q.pop(0)
coor=m[''.join(v)][0]
x=coor%X
y=coor//X
depth=m[''.join... |
s060747182 | p00121 | u104911888 | 1373173027 | Python | Python | py | Runtime Error | 0 | 0 | 1102 | class Puzzle:
def __init__(self,panel,space,cnt):
self.panel=panel
self.space=space
self.cnt=cnt
d=(1,-1,4,-4)
model=map(str,range(8)):
def check(s):
if s==model
return True
return False
def bfs(s):
m=set()
que=[s]
m.add(tuple(s.panel))
while que!=[]:
... |
s297135538 | p00121 | u104911888 | 1373173062 | Python | Python | py | Runtime Error | 0 | 0 | 1101 | class Puzzle:
def __init__(self,panel,space,cnt):
self.panel=panel
self.space=space
self.cnt=cnt
d=(1,-1,4,-4)
model=map(str,range(8))
def check(s):
if s==model
return True
return False
def bfs(s):
m=set()
que=[s]
m.add(tuple(s.panel))
while que!=[]:
... |
s224598966 | p00122 | u939118618 | 1432204759 | Python | Python | py | Runtime Error | 0 | 0 | 743 | def check(here, count):
return ((abs(here[0]-s[count][0]))**2 + (abs(here[1]-s[count][1]))**2 <= 2)
def dfs(here, count):
if count == 10:
result = True
else:
result = False
for dx, dy in delta:
next = (here[0]+dx,here[1]+dy)
if lb[0] <= next[0] <= ub[0] and lb[1] <= next[1] <= ub[1] and check(next, co... |
s863395345 | p00122 | u939118618 | 1432204887 | Python | Python | py | Runtime Error | 0 | 0 | 786 | import sys
def check(here, count):
return ((abs(here[0]-s[count][0]))**2 + (abs(here[1]-s[count][1]))**2 <= 2)
def dfs(here, count):
if count == 10:
result = True
else:
result = False
for dx, dy in delta:
next = (here[0]+dx,here[1]+dy)
if lb[0] <= next[0] <= ub[0] and lb[1] <= next[1] <= ub[1] and che... |
s834458319 | p00122 | u873482706 | 1435327186 | Python | Python | py | Runtime Error | 0 | 0 | 1130 | def phyonkichi(p, n):
yoko = 0
tate = 1
s = dic[n]
p_lis = [(p[yoko]+a[yoko], p[tate]+a[tate]) for a in jump]
s_lis = [(s[yoko]+a[yoko], s[tate]+a[tate]) for a in sprinkler]
c_lis = []
for v in list(set(p_lis) & set(s_lis)):
if 0 <= v[yoko] <= 9 and 0 <= v[tate] <= 9:
c_l... |
s030470316 | p00122 | u873482706 | 1435328001 | Python | Python | py | Runtime Error | 0 | 0 | 1123 | def phyonkichi(p, n):
yoko = 0
tate = 1
s = dic[n]
p_lis = [(p[yoko]+a[yoko], p[tate]+a[tate]) for a in jump]
s_lis = [(s[yoko]+a[yoko], s[tate]+a[tate]) for a in sprinkler]
c_lis = []
for v in list(set(p_lis) & set(s_lis)):
if 0 <= v[yoko] <= 9 and 0 <= v[tate] <= 9:
c_l... |
s526268389 | p00122 | u873482706 | 1435330548 | Python | Python | py | Runtime Error | 0 | 0 | 1309 | def phyonkichi(p, n):
yoko = 0
tate = 1
if n[-1] == '0':
n = 10
else:
n = int(n[-1])
s = dic[n]
p_lis = [(p[yoko]+a[yoko], p[tate]+a[tate]) for a in jump]
s_lis = [(s[yoko]+a[yoko], s[tate]+a[tate]) for a in sprinkler]
c_lis = []
for v in list(set(p_lis) & set(s_lis))... |
s821876806 | p00122 | u672443148 | 1516413266 | Python | Python3 | py | Runtime Error | 0 | 0 | 1621 | import queue
import copy
def makeList(splist,n):
for i in range(n):
springs=[]
springs.append(splist[i*2:i*2+2])
springs.append(i)
yield springs
def isSafe(wfs,safe):
while not wfs.empty():
flog=wfs.get()
flogArea=[]
spn=flog[1]+1
for i in range... |
s981079976 | p00122 | u672443148 | 1516413440 | Python | Python3 | py | Runtime Error | 0 | 0 | 1621 | import queue
import copy
def makeList(splist,n):
for i in range(n):
springs=[]
springs.append(splist[i*2:i*2+2])
springs.append(i)
yield springs
def isSafe(wfs,safe):
while not wfs.empty():
flog=wfs.get()
flogArea=[]
spn=flog[1]+1
for i in range... |
s824186894 | p00122 | u672443148 | 1516413874 | Python | Python3 | py | Runtime Error | 0 | 0 | 19 | import collectoins
|
s534395448 | p00122 | u672443148 | 1516414847 | Python | Python3 | py | Runtime Error | 0 | 0 | 1637 | from collections import deque
import copy
def makeList(splist,n):
for i in range(n):
springs=[]
springs.append(splist[i*2:i*2+2])
springs.append(i)
yield springs
def isSafe(wfs,safe):
while len(wfs)>0:
flog=wfs.popleft()
flogArea=[]
spn=flog[1]+1
... |
s800037865 | p00122 | u672443148 | 1516415013 | Python | Python3 | py | Runtime Error | 0 | 0 | 1637 | from collections import deque
import copy
def makeList(splist,n):
for i in range(n):
springs=[]
springs.append(splist[i*2:i*2+2])
springs.append(i)
yield springs
def isSafe(wfs,safe):
while len(wfs)>0:
flog=wfs.popleft()
flogArea=[]
spn=flog[1]+1
... |
s884599615 | p00122 | u672443148 | 1516415149 | Python | Python3 | py | Runtime Error | 0 | 0 | 1637 | from collections import deque
import copy
def makeList(splist,n):
for i in range(n):
springs=[]
springs.append(splist[i*2:i*2+2])
springs.append(i)
yield springs
def isSafe(wfs,safe):
while len(wfs)>0:
flog=wfs.popleft()
flogArea=[]
spn=flog[1]+1
... |
s332360160 | p00122 | u104911888 | 1373181101 | Python | Python | py | Runtime Error | 0 | 0 | 749 | mv=((2,0),(2,1),(2,-1),(-2,0),(-2,1),(-2,-1),
(0,2),(1,2),(-1,2),(0,-2),(1,-2),(-1,-2))
while True:
x,y=map(int,raw_input().split())
if x==y==0:break
n=input()
pos=map(int,raw_input().split())
pos=[(pos[2*i],pos[2*i+1]) for i in range(n)]
que=[(x,y,0)]
while que!=[]:
X,Y,p=que[... |
s113296130 | p00123 | u440959703 | 1398524437 | Python | Python | py | Runtime Error | 0 | 0 | 415 | # -*- coding: utf-8 -*-
rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]
while True:
try:
t1,t2 = map(float,input().split())
except EOFError:
break
#print(len(rank))
for i in range(len(rank)):
... |
s763861490 | p00123 | u440959703 | 1398524453 | Python | Python | py | Runtime Error | 0 | 0 | 415 | # -*- coding: utf-8 -*-
rank = ["AAA", "AA", "A", "B", "C", "D", "E"]
ref0 = [35.5, 37.5, 40.0, 43.0, 50.0, 55.0, 70.0]
ref1 = [71.0, 77.0, 83.0, 89.0, 105.0, 116.0, 148.0]
while True:
try:
t1,t2 = map(float,input().split())
except EOFError:
break
#print(len(rank))
for i in range(len(rank)):
... |
s205546542 | p00124 | u873482706 | 1435757660 | Python | Python | py | Runtime Error | 0 | 0 | 437 | c = 1
while True:
N = int(raw_input())
if N == 0:
break
elif c != 1:
print ''
dic = {}
for i in range(N):
lis = raw_input().split()
name = lis[0]
lis = map(int, lis[1:])
point = lis[0]*3 + lis[2]
dic[name] = [point, N-i]
for k, v... |
s097618331 | p00124 | u873482706 | 1435758097 | Python | Python | py | Runtime Error | 0 | 0 | 399 | while True:
N = int(raw_input())
if N == 0:
break
dic = {}
for i in range(N):
lis = raw_input().split()
name = lis[0]
lis = map(int, lis[1:])
point = lis[0]*3 + lis[2]
dic[name] = [point, N-i]
for k, v in sorted(dic.items(), key=lambda x: (x... |
s924689744 | p00124 | u873482706 | 1435758811 | Python | Python | py | Runtime Error | 0 | 0 | 439 | c = 0
while True:
N = int(raw_input())
if N == 0:
break
elif c != 0:
print ''
dic = {}
for i in range(N):
lis = raw_input().split()
name = lis[0]
lis = map(int, lis[1:])
point = lis[0]*3 + lis[2]
dic[name] = [point, N-i]
for k... |
s085591673 | p00124 | u873482706 | 1435759102 | Python | Python | py | Runtime Error | 0 | 0 | 437 | c = 0
while True:
N = int(raw_input())
if N == 0:
break
if c != 0:
print ''
dic = {}
for i in range(N):
lis = raw_input().split()
name = lis[0]
lis = map(int, lis[1:])
point = lis[0]*3 + lis[2]
dic[name] = [point, N-i]
for k, ... |
s943926980 | p00124 | u873482706 | 1435759255 | Python | Python | py | Runtime Error | 0 | 0 | 434 | c = 0
while True:
N = int(raw_input())
if N == 0:
break
if c != 0:
print
dic = {}
for i in range(N):
lis = raw_input().split()
name = lis[0]
lis = map(int, lis[1:])
point = lis[0]*3 + lis[2]
dic[name] = [point, N-i]
for k, v i... |
s054335594 | p00124 | u873482706 | 1435759403 | Python | Python | py | Runtime Error | 0 | 0 | 386 | N = input()
while True:
dic = {}
for i in range(N):
lis = raw_input().split()
name = lis[0]
lis = map(int, lis[1:])
point = lis[0]*3 + lis[2]
dic[name] = [point, N-i]
for k, v in sorted(dic.items(), key=lambda x: (x[0][0], x[0][1]), reverse=True):
print '... |
s396016034 | p00124 | u873482706 | 1435760237 | Python | Python | py | Runtime Error | 0 | 0 | 320 | N = input()
while True:
dic = {}
for i in range(N):
lis = raw_input().split()
dic[lis[0]] = [3*int(lis[1])+int(lis[3]), N-i]
for k, v in sorted(dic.items(), key=lambda x: (x[0][0], x[0][1]), reverse=True):
print '%s,%s' % (k, v[0])
N = input()
if N == 0: break
print |
s349716962 | p00124 | u873482706 | 1435760471 | Python | Python | py | Runtime Error | 0 | 0 | 323 | N = input()
while True:
dic = {}
for i in range(N):
lis = raw_input().split()
dic[lis[0]] = [3*int(lis[1])+int(lis[3]), N-i]
for k, v in sorted(dic.items(), key=lambda x: (x[0][0], x[0][1]), reverse=True):
print '%s,%s' % (k, v[0])
N = input()
if N == 0: break
print... |
s265750961 | p00124 | u546285759 | 1488781731 | Python | Python3 | py | Runtime Error | 0 | 0 | 443 | b=False
while True:
n = int(input())
if n==0:break
d=dict()
if b:print()
b=True
for _ in range(n):
line = input().split()
tmp = int(line[1])*3+int(line[3]*1)
if tmp in d:
d[tmp].append(line[0])
else:
d[tmp] = []
d[tmp].append(li... |
s077270210 | p00124 | u633068244 | 1396533786 | Python | Python | py | Runtime Error | 0 | 0 | 232 | n=input()
while 1:
m=[raw_input().split() for i in range(n)]
p={}
for t in m:
p[t[0]] = 3*int(t[1])+1*int(t[3])
for k,v in sorted(p.items(),key=lambda x:x[1])[::-1]:
print "%s,%d"%(k,v)
c+=1
n=input()
if n==0:break
print |
s120149297 | p00125 | u912237403 | 1415428723 | Python | Python | py | Runtime Error | 0 | 0 | 239 | M=[0,1,-1,0,0,1,1,2,3,3,4,4]
def L(y,m):
if m<=2: y-=1
return y/4-y/100+y/400+M[m]
while 1:
x=map(int,raw_input().split(" "))
if any([e<0 for e in x]): break
a,b,c,d,e,f=x
ans=(d-a)*365+(e-b)*30+f-c+L(d,e)-L(a,b)
print ans |
s936687485 | p00125 | u912237403 | 1415429101 | Python | Python | py | Runtime Error | 0 | 0 | 233 | M=[0,1,-1,0,0,1,1,2,3,3,4,4]
def L(y,m):
if m<=2: y-=1
return y/4-y/100+y/400+M[m]
while 1:
a,b,c,d,e,f=x=map(int,raw_input().split(" "))
if any([i<0 for i in x]): break
ans=(d-a)*365+(e-b)*30+f-c+L(d,e)-L(a,b)
print ans |
s081400373 | p00126 | u912237403 | 1415444316 | Python | Python | py | Runtime Error | 0 | 0 | 460 | def f(A): return A.count(a)>1
R=[0,3,6]
N=range(9)
Z=[0]*9
n=input()
while n:
F=[[" " for _ in Z] for _ in Z]
M=[map(int,raw_input().split()) for _ in Z]
M1=[[M[y][x] for y in N] for x in N]
M2=[M[y][x:x+3]+M[y+1][x:x+3]+M[y+2][x:x+3] for y in R for x in R]
for y in N:
p0=y/3*3
for x in N:
a=A[... |
s827081349 | p00126 | u912237403 | 1415444341 | Python | Python | py | Runtime Error | 0 | 0 | 463 | def f(A): return A.count(a)>1
R=[0,3,6]
N=range(9)
Z=[0]*9
n=input()
while n:
F=[[" " for _ in Z] for _ in Z]
M=[map(int,raw_input().split()) for _ in Z]
M1=[[M[y][x] for y in N] for x in N]
M2=[M[y][x:x+3]+M[y+1][x:x+3]+M[y+2][x:x+3] for y in R for x in R]
for y in N:
p0=y/3*3
for x in N:
a=M[... |
s726290308 | p00127 | u873482706 | 1435827541 | Python | Python | py | Runtime Error | 0 | 0 | 477 | import sys
s = 'abcdefghijklmnopqrstuvwxyz.?! '
d = {}
for y in range(1, 7):
for t in range(1, 6):
d[(str(y),str(t))] = s[0]
s = s[1:]
for line in sys.stdin:
line = line.rstrip()
if len(line) % 2 != 0:
print 'NA'
continue
ans = ''
for i in range(0, len(line), 2):
... |
s703987451 | p00127 | u873482706 | 1435827866 | Python | Python | py | Runtime Error | 0 | 0 | 495 | import sys
s = 'abcdefghijklmnopqrstuvwxyz.?! '
d = {}
for y in range(1, 7):
for t in range(1, 6):
d[(str(y),str(t))] = s[0]
s = s[1:]
for line in sys.stdin:
line = line.rstrip()
if len(line) == 0 or len(line) % 2 != 0:
print 'NA'
continue
ans = ''
for i in range(0,... |
s530051613 | p00127 | u873482706 | 1435828216 | Python | Python | py | Runtime Error | 0 | 0 | 566 | s = 'abcdefghijklmnopqrstuvwxyz.?! '
d = {}
for y in range(1, 7):
for t in range(1, 6):
d[(str(y),str(t))] = s[0]
s = s[1:]
while True:
try:
line = raw_input()
if len(line) == 0 or len(line) % 2 != 0:
print 'NA'
continue
ans = ''
for i in ... |
s177263221 | p00127 | u957021183 | 1505454922 | Python | Python3 | py | Runtime Error | 0 | 0 | 549 | # Aizu Problem 00127: Pocket Pager Input
#
import sys, math, os, copy
# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
sys.stdin = open("sample-input.txt", "rt")
code = {1: "afkpuz", 2: "ablqv.", 3: "chmrw?", 4: "dinsx!", 5: "ejoty "}
def pocket_pager(string):
if len(string) % 2 == 1:
... |
s795500515 | p00127 | u808429775 | 1517783278 | Python | Python3 | py | Runtime Error | 0 | 0 | 818 | import sys
convert = {"1": {"1": "a", "2": "b", "3": "c", "4": "d", "5": "e"},
"2": {"1": "f", "2": "g", "3": "h", "4": "i", "5": "j"},
"3": {"1": "k", "2": "l", "3": "m", "4": "n", "5": "o"},
"4": {"1": "p", "2": "q", "3": "r", "4": "s", "5": "t"},
"5": {"1": "u", "2": "v",... |
s007473206 | p00127 | u808429775 | 1517783432 | Python | Python3 | py | Runtime Error | 0 | 0 | 826 | import sys
convert = {"1": {"1": "a", "2": "b", "3": "c", "4": "d", "5": "e"},
"2": {"1": "f", "2": "g", "3": "h", "4": "i", "5": "j"},
"3": {"1": "k", "2": "l", "3": "m", "4": "n", "5": "o"},
"4": {"1": "p", "2": "q", "3": "r", "4": "s", "5": "t"},
"5": {"1": "u", "2": "v",... |
s136565974 | p00127 | u104911888 | 1369405881 | Python | Python | py | Runtime Error | 0 | 0 | 370 | import itertools
dic={"61":"z","62":".","63":"?","64":"!","65":" "}
cnt=ord("a")
for i in itertools.product(range(1,6),repeat=2):
dic["".join(map(str,i))]=chr(cnt)
cnt+=1
while True:
try:
s=raw_input()
except EOFError:
break
if len(s)%2!=0:
print "NA"
else:
print... |
s862565694 | p00127 | u759934006 | 1373680024 | Python | Python | py | Runtime Error | 0 | 0 | 711 | from sys import stdout
cs = {
1: [None] + list("abcde"),
2: [None] + list("fghij"),
3: [None] + list("klmno"),
4: [None] + list("pqrst"),
5: [None] + list("uvwxy"),
6: [None] + list("z.?! "),
}
while True:
try:
it = iter(raw_input().strip())
except ValueError:
break
... |
s722045536 | p00127 | u759934006 | 1373680063 | Python | Python | py | Runtime Error | 0 | 0 | 761 | from sys import stdout
cs = {
1: [None] + list("abcde"),
2: [None] + list("fghij"),
3: [None] + list("klmno"),
4: [None] + list("pqrst"),
5: [None] + list("uvwxy"),
6: [None] + list("z.?! "),
}
while True:
try:
it = iter(raw_input().strip())
except ValueError:
break
... |
s585654578 | p00127 | u647766105 | 1383401789 | Python | Python | py | Runtime Error | 0 | 0 | 409 | decode = ["afkpuz",
"bglqv.",
"chmrw?",
"dinsx!",
"ejoty "]
while True:
try:
line = raw_input()
except EOFError:
break
if len(line)%2 == 1:
print "NA"
continue
try:
print "".join(decode[j-1][i-1]
for i,... |
s702687072 | p00128 | u912237403 | 1415448893 | Python | Python | py | Runtime Error | 0 | 0 | 275 | import sys
d={}
B1=['* =',' *=']
B2=[' ****','* ***','** **','*** *','**** ']
f=0
for i in range(9): d[str(i)]=B1[i/5]+B2[i%5]
for s in sys.stdin:
A=[d[e] for e in ('0'*5+s[:-1])[-5:]]
if f: print
for y in range(8): print "".join([A[x][y] for x in range(len(A))])
f=1 |
s666255224 | p00128 | u759934006 | 1373684846 | Python | Python | py | Runtime Error | 0 | 0 | 569 | from sys import stdout
def upper(n):
if n < 5:
return list("* ")
else:
return list(" *")
def lower(n):
m = n % 5
a = ['*'] * m + [' ']
a = a + ['*'] * (5 - len(a))
return a
def abacus(n):
return upper(n) + ['='] + lower(n)
while True:
try:
ns = map(int, ("... |
s158784048 | p00128 | u759934006 | 1373685023 | Python | Python | py | Runtime Error | 0 | 0 | 569 | from sys import stdout
def upper(n):
if n < 5:
return list("* ")
else:
return list(" *")
def lower(n):
m = n % 5
a = ['*'] * m + [' ']
a = a + ['*'] * (5 - len(a))
return a
def abacus(n):
return upper(n) + ['='] + lower(n)
while True:
try:
ns = map(int, ("... |
s869390157 | p00128 | u759934006 | 1373685128 | Python | Python | py | Runtime Error | 0 | 0 | 560 | from sys import stdout
def upper(n):
if n < 5:
return list("* ")
else:
return list(" *")
def lower(n):
m = n % 5
a = ['*'] * m + [' ']
a = a + ['*'] * (5 - len(a))
return a
def abacus(n):
return upper(n) + ['='] + lower(n)
while True:
try:
ns = map(int, ('... |
s013921449 | p00128 | u260980560 | 1385269073 | Python | Python | py | Runtime Error | 0 | 0 | 288 | import sys
for s in sys.stdin.readlines():
n = s.zfill(5)
for i in xrange(2):
print "".join(["*" if int(n[j])-5*i in range(5) else " " for j in xrange(5)])
print "="*5
for i in xrange(5):
print "".join([" " if (int(n[j])%5)==i else "*" for j in xrange(5)]) |
s181351588 | p00129 | u912237403 | 1415497175 | Python | Python | py | Runtime Error | 0 | 0 | 673 | import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def f(e1):
tx,ty,sx,sy=e1
x=[]
for e2 in WP:
wx,wy,r=e2
wt=[tx-wx,ty-wy]; rwt=R(wt)
sw=[wx-sx,wy-sy]; rsw=R(sw)
st=[tx-sx,ty-sy]; rst=R(st)
F=[rwt<r,rsw<r]
if F==[1,1]: c=... |
s962753345 | p00129 | u912237403 | 1415497925 | Python | Python | py | Runtime Error | 0 | 0 | 696 | import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def f(e1):
tx,ty,sx,sy=e1
x=[]
for e2 in WP:
wx,wy,r=e2
wt=[tx-wx,ty-wy]; rwt=R(wt)
sw=[wx-sx,wy-sy]; rsw=R(sw)
st=[tx-sx,ty-sy]; rst=R(st)
F=[rwt<r,rsw<r]
if rst==0: c=1
... |
s256220677 | p00129 | u912237403 | 1415501206 | Python | Python | py | Runtime Error | 0 | 0 | 718 | import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
tx,ty,sx,sy=e1
x=[]
for e2 in WP:
wx,wy,r=e2
wt=[tx-wx,ty-wy]; rwt=R(wt)
sw=[wx-sx,wy-sy]; rsw=R(sw)
st=[tx-sx,ty-sy]; rst=R(st)... |
s131503937 | p00129 | u912237403 | 1415501303 | Python | Python | py | Runtime Error | 0 | 0 | 728 | import math as M
def R(A): return (A[0]**2+A[1]**2)**.5
def I(i): return [map(int,raw_input().split()) for _ in [0]*i]
def C(a,b): return a>b or abs(a-b)<1e-6
def f(e1):
tx,ty,sx,sy=e1
x=[]
for e2 in WP:
wx,wy,r=e2
wt=[tx-wx,ty-wy]; rwt=R(wt)
sw=[wx-sx,wy-sy]; rsw=R(sw)
st=[tx-sx,ty-sy]; rst=R(st)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.