s_id
string
p_id
string
u_id
string
date
string
language
string
original_language
string
filename_ext
string
status
string
cpu_time
string
memory
string
code_size
string
code
string
error
string
stdout
string
s824183237
p00508
u324811972
1531905238
Python
Python3
py
Runtime Error
0
0
494
n = input() i = 0 pointList = [] while(i<n): point0 = input() point0 = point0.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 dist = 0 print(dist,'\n') minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!=j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if(x_diff+y_diff<minX_diff+minY_diff): dist = x_diff*x_diff + y_diff*y_diff print(dist,'\n')
Traceback (most recent call last): File "/tmp/tmp_tj0p7io/tmpcx59skg0.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s622949155
p00508
u324811972
1531905304
Python
Python3
py
Runtime Error
0
0
186
n = input() i = 0 pointList = [] while(i<n): point0 = input() point0 = point0.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 dist = 0 print(dist,'\n')
Traceback (most recent call last): File "/tmp/tmpflrmxjk0/tmpnv7wbk7w.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s966942055
p00508
u324811972
1531905461
Python
Python3
py
Runtime Error
0
0
512
n = input() i = 0 pointList = [] while(i<n): pointStr = input() point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 dist = 0 print(dist,'\n') #""" """ minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!=j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if(x_diff+y_diff<minX_diff+minY_diff): dist = x_diff*x_diff + y_diff*y_diff print(dist,'\n') #"""
Traceback (most recent call last): File "/tmp/tmp9quvhgae/tmpbwe8qm3l.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s843431652
p00508
u324811972
1531905510
Python
Python3
py
Runtime Error
0
0
513
n = input() i = 0 pointList = [] while(i<=n): pointStr = input() point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 dist = 0 print(dist,'\n') #""" """ minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!=j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if(x_diff+y_diff<minX_diff+minY_diff): dist = x_diff*x_diff + y_diff*y_diff print(dist,'\n') #"""
Traceback (most recent call last): File "/tmp/tmp480uyfsb/tmpx8yt0b_5.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s835430199
p00508
u324811972
1531905544
Python
Python3
py
Runtime Error
0
0
532
n = input() i = 0 pointList = [] while(True): pointStr = input() point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 if(i==n): break dist = 0 print(dist,'\n') #""" """ minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!=j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if(x_diff+y_diff<minX_diff+minY_diff): dist = x_diff*x_diff + y_diff*y_diff print(dist,'\n') #"""
Traceback (most recent call last): File "/tmp/tmphucr5y_d/tmp__9jkpjd.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s022163117
p00508
u324811972
1531905589
Python
Python3
py
Runtime Error
0
0
531
n = input() i = 0 pointList = [] while True: pointStr = input() point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 if(i==n): break dist = 0 print(dist,'\n') #""" """ minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!=j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if(x_diff+y_diff<minX_diff+minY_diff): dist = x_diff*x_diff + y_diff*y_diff print(dist,'\n') #"""
Traceback (most recent call last): File "/tmp/tmpj3g0q6t_/tmpyd8mrdx8.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s026709579
p00508
u324811972
1531905709
Python
Python3
py
Runtime Error
0
0
532
n = input() i = 0 pointList = [] while True: pointStr = input() point0 = pointStr.split() #point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 if(i==n): break dist = 0 print(dist,'\n') #""" """ minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!=j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if(x_diff+y_diff<minX_diff+minY_diff): dist = x_diff*x_diff + y_diff*y_diff print(dist,'\n') #"""
Traceback (most recent call last): File "/tmp/tmpleirmb2s/tmp_6z9e9gp.py", line 1, in <module> n = input() ^^^^^^^ EOFError: EOF when reading a line
s204637694
p00508
u324811972
1531906404
Python
Python3
py
Runtime Error
0
0
574
n = int(input()) i = 0 pointList = [] while True: pointStr = input() #pointStr = "0 0" point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 if(i==n): break dist = 0 minX_diff = 2000000 minY_diff = 20000000 for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList): if(i!<j): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if((x_diff+y_diff)<(minX_diff+minY_diff)): minX_diff = x_diff minY_diff = y_diff dist = x_diff*x_diff + y_diff*y_diff print(str(dist))
File "/tmp/tmpiyzw2ymc/tmp47_2p4bj.py", line 18 if(i!<j): ^ SyntaxError: invalid syntax
s441560636
p00508
u324811972
1531906578
Python
Python3
py
Runtime Error
0
0
583
n = int(input()) i = 0 pointList = [] while True: pointStr = input() point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 if(i==n): break dist = 0 minX_diff = 2000000 minY_diff = 20000000 pointList2 = pointList for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList2): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if((x_diff+y_diff)<(minX_diff+minY_diff)): minX_diff = x_diff minY_diff = y_diff dist = x_diff*x_diff + y_diff*y_diff pointList2.remove(0) print(str(dist))
Traceback (most recent call last): File "/tmp/tmphmrgkp7i/tmpcuel_26v.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s493769377
p00508
u324811972
1531906668
Python
Python3
py
Runtime Error
0
0
583
n = int(input()) i = 0 pointList = [] while True: pointStr = input() point0 = pointStr.split() point = [int(point0[0]),int(point0[1])] pointList.append(point) i+=1 if(i==n): break dist = 0 minX_diff = 2000000 minY_diff = 20000000 pointList2 = pointList for i,point1 in enumerate(pointList): for j,point2 in enumerate(pointList2): x_diff = abs(point1[0] - point2[0]) y_diff = abs(point1[1] - point2[1]) if((x_diff+y_diff)<(minX_diff+minY_diff)): minX_diff = x_diff minY_diff = y_diff dist = x_diff*x_diff + y_diff*y_diff pointList2.remove(0) print(str(dist))
Traceback (most recent call last): File "/tmp/tmpe6gkxynh/tmpbv7geep2.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s000116859
p00508
u621997536
1415364676
Python
Python3
py
Runtime Error
19910
86500
280
N = int(input()) P = sorted([tuple(map(int, input().split())) for i in range(N)]) d = 1000000000 for i, p1 in enumerate(P): for p2 in P[i + 1:]: if pow(p1[0] - p2[0], 2) > d: break d = min(pow(p1[0] - p2[0], 2) + pow(p1[1] - p2[1], 2), d) print(d)
Traceback (most recent call last): File "/tmp/tmpmcutj8xt/tmpshinrywn.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s969261964
p00508
u621997536
1415365245
Python
Python3
py
Runtime Error
19930
86260
315
N = int(input()) P = sorted([tuple(map(int, input().split())) for i in range(N)]) d = 1000000000 for i in range(len(P)): for j in range(i + 1, len(P)): p1, p2 = P[i], P[j] if pow(p1[0] - p2[0], 2) > d: break d = min(pow(p1[0] - p2[0], 2) + pow(p1[1] - p2[1], 2), d) print(d)
Traceback (most recent call last): File "/tmp/tmph34gr5ix/tmp4wc7u49w.py", line 1, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s194021546
p00508
u811733736
1509549044
Python
Python3
py
Runtime Error
40000
18640
1033
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585 """ import sys from sys import stdin from math import sqrt input = stdin.readline def closest_part(points, n): # ?????¬???lp324??? if n <= 1: return float('inf') m = n // 2 x = points[m][0] d = min(closest_part(points, m), closest_part(points[m:], n-m)) points.sort(key=lambda x:x[1]) b = [] for i in range(n): if abs(points[i][0] - x) >= d: continue for j in range(len(b)): dx = points[i][0] - b[-j-1][0] dy = points[i][1] - b[-j-1][1] if dy >= d: break d = min(d, (dx**2 + dy**2)) b.append(points[i]) return d def main(args): n = int(input()) points = [tuple(map(int, input().split())) for _ in range(n)] points.sort() # x????????§?????????????????? result = closest_part(points, n) print(result) if __name__ == '__main__': main(sys.argv[1:])
Traceback (most recent call last): File "/tmp/tmpknz2fzuz/tmp1d37jv8g.py", line 45, in <module> main(sys.argv[1:]) File "/tmp/tmpknz2fzuz/tmp1d37jv8g.py", line 36, in main n = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s574764938
p00508
u811733736
1509550211
Python
Python3
py
Runtime Error
40000
78916
1036
# -*- coding: utf-8 -*- """ http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0585 """ import sys from sys import stdin from math import sqrt input = stdin.readline def closest_part(points, n): # ?????¬???p324??? if n <= 1: return float('inf') m = n // 2 x = points[m][0] d = min(closest_part(points[:m], m), closest_part(points[m:], n-m)) points.sort(key=lambda x:x[1]) b = [] for i in range(n): if abs(points[i][0] - x) >= d: continue for j in range(len(b)): dx = points[i][0] - b[-j-1][0] dy = points[i][1] - b[-j-1][1] if dy >= d: break d = min(d, (dx**2 + dy**2)) b.append(points[i]) return d def main(args): n = int(input()) points = [tuple(map(int, input().split())) for _ in range(n)] points.sort() # x????????§?????????????????? result = closest_part(points, n) print(result) if __name__ == '__main__': main(sys.argv[1:])
Traceback (most recent call last): File "/tmp/tmpnidx1bnc/tmpkbjgcjnm.py", line 45, in <module> main(sys.argv[1:]) File "/tmp/tmpnidx1bnc/tmpkbjgcjnm.py", line 36, in main n = int(input()) ^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: ''
s514519819
p00508
u859637829
1519320649
Python
Python3
py
Runtime Error
20
5668
595
def get_n(): return int(input()) def get_ns(): return [int(a) for a in input().split()] import math def main(): n = get_n() ns = [get_ns() for _ in range(n)] # ns = sorted(ns,key=lambda a:a[0]) mind = 99999999 res=9999999 for i,a in enumerate(ns): x1,y1 = a for x2,y2 in ns[:i]: xd =abs(x1-x2) yd = abs(y1-y2) if xd>mind or yd>mind : continue d = xd*xd+yd*yd res = min(res,d) mind = math.sqrt(res) print(res) if __name__ == '__main__': main()
Traceback (most recent call last): File "/tmp/tmphp8i7epq/tmp8fkl6gtk.py", line 31, in <module> main() File "/tmp/tmphp8i7epq/tmp8fkl6gtk.py", line 7, in main n = get_n() ^^^^^^^ File "/tmp/tmphp8i7epq/tmp8fkl6gtk.py", line 2, in get_n return int(input()) ^^^^^^^ EOFError: EOF when reading a line
s735742047
p00508
u179070318
1523852283
Python
Python3
py
Runtime Error
30
5908
360
n = int(input()) points = [] distants = [] for _ in range(n): point = [int(_) for _ in input().split()] points.append(point) for i in range(n): for j in range(n): if i != j: dis = (points[i][0]-points[j][0])**2+(points[i][1]-points[j][1])**2 distants.append(dis) else: pass print(min(distants))
Traceback (most recent call last): File "/tmp/tmpom4zpkiw/tmprm3jzd2m.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s136818354
p00508
u150984829
1524912689
Python
Python3
py
Runtime Error
30
5620
172
n=int(input()) d=[list(map(int,input().split()))for _ in[0]*n] m=1e9 for i in range(n-1): for b in d[i+1:]: x,y=d[i] s,t=b l=(x-s)**2+(y-t)**2 if l<m:m=l print(m)
Traceback (most recent call last): File "/tmp/tmpj5pos2t9/tmpd4zvlm5u.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s905272699
p00508
u150984829
1524912782
Python
Python3
py
Runtime Error
20
5612
172
n=int(input()) d=[list(map(int,input().split()))for _ in[0]*n] m=1e9 for i in range(n-1): for b in d[i+1:]: x,y=d[i] s,t=b l=(x-s)**2+(y-t)**2 if l<m:m=l print(m)
Traceback (most recent call last): File "/tmp/tmp2u6yi6v1/tmp6c8p12qf.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s274109714
p00508
u150984829
1524913588
Python
Python3
py
Runtime Error
0
0
170
n=int(input()) d=[list(map(int,input().split()))for _ in[0]*n] m=1e9 l=[] for i in range(n-1): for b in d[i+1:]: x,y=d[i] s,t=b l+=(x-s)**2+(y-t)**2 print(min(l))
Traceback (most recent call last): File "/tmp/tmpwl640e5k/tmpyd4nr4up.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s794760703
p00508
u150984829
1524913747
Python
Python3
py
Runtime Error
0
0
166
n=int(input()) d=[list(map(int,input().split()))for _ in[0]*n] m=1e9 for i in range(n-1): for b in d[i+1:]: x,y=d[i] s,t=b if m<l:m=(x-s)**2+(y-t)**2 print(m)
Traceback (most recent call last): File "/tmp/tmpzhtiurbi/tmpp9eb1csb.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s593502211
p00508
u150984829
1524913787
Python
Python3
py
Runtime Error
20
5620
172
n=int(input()) d=[list(map(int,input().split()))for _ in[0]*n] m=1e9 for i in range(n-1): for b in d[i+1:]: x,y=d[i] s,t=b l=(x-s)**2+(y-t)**2 if m>l:m=l print(m)
Traceback (most recent call last): File "/tmp/tmpwxfu3ncx/tmpl6wz1zoy.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s297819142
p00508
u150984829
1524927930
Python
Python3
py
Runtime Error
30
5616
204
n=int(input()) a=sorted([list(map(int,input().split()))for _ in[0]*n],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i]: if x-s<=m: d=(x-s)**2+(y-t)**2 if d<m:m=d print(m)
Traceback (most recent call last): File "/tmp/tmpsg2n6u69/tmpyrh7smw9.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s495947535
p00508
u150984829
1524928273
Python
Python3
py
Runtime Error
30
5620
212
n=int(input()) a=sorted([list(map(int,input().split()))for _ in[0]*n],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if x-s>m:break d=(x-s)**2+(y-t)**2 if d<m:m=d print(m)
Traceback (most recent call last): File "/tmp/tmpnvncxojp/tmpwz5k5mqj.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s291135849
p00508
u150984829
1524928506
Python
Python3
py
Runtime Error
20
5624
206
n=int(input()) a=sorted([list(map(int,input().split()))for _ in[0]*n],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if x-s>m:break m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmpxchyzg4w/tmp94o7v287.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s272776914
p00508
u150984829
1524928823
Python
Python3
py
Runtime Error
30
5628
216
import sys n=int(input()) a=sorted([list(map(int,e.split()))for e in sys.stdin],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if x-s>m:break m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmpuad38zg_/tmpq_8m9fad.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s905465236
p00508
u150984829
1524928887
Python
Python3
py
Runtime Error
17370
15444
206
n=int(input()) a=sorted([list(map(int,input().split()))for _ in[0]*n],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if s-x>m:break m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmpqok4e6dm/tmpcsd9qsbz.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s652755362
p00508
u150984829
1524929026
Python
Python3
py
Runtime Error
20
5628
216
import sys n=int(input()) a=sorted([list(map(int,e.split()))for e in sys.stdin],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if s-x>m:break m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmpz53rp8oo/tmp5bma2x11.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s277030659
p00508
u150984829
1524929110
Python
Python3
py
Runtime Error
19100
15452
220
n=int(input()) a=sorted([list(map(int,input().split()))for _ in[0]*n],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if s-x>m:break if abs(t-y)<m:m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmp7vzlqkfe/tmp5k66ntw_.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s488978303
p00508
u150984829
1524929252
Python
Python3
py
Runtime Error
30
5628
242
import sys n=int(input()) a=sorted([list(map(int,e.split()))for e in sys.stdin.readlines()],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if s-x>m:break if abs(t-y)<m:m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmpy5zaz9t_/tmprym5mc6w.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s161517369
p00508
u150984829
1524930640
Python
Python3
py
Runtime Error
16810
15448
206
n=int(input()) a=sorted([list(map(int,input().split()))for _ in[0]*n],key=lambda x:x[0]) m=1e9 for i in range(1,n): s,t=a[i] for x,y in a[:i][::-1]: if s-x>m:break m=min(m,(x-s)**2+(y-t)**2) print(m)
Traceback (most recent call last): File "/tmp/tmpxwcuf44x/tmpb_tfr4ot.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s890574430
p00508
u150984829
1525439052
Python
Python3
py
Runtime Error
13890
9940
220
n=int(input()) a=sorted([complex(*map(int,input().split()))for _ in[0]*n],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break m=min(m,abs(w-z)**2) print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmpd_pwwv79/tmpm1bh8zcf.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s514946777
p00508
u150984829
1525439162
Python
Python3
py
Runtime Error
20
5628
165
n=int(input()) a=[complex(*map(int,input().split()))for _ in[0]*n] m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: m=min(m,abs(w-z)**2) print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmps0ry73vz/tmpmggehd7x.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s166512013
p00508
u150984829
1525439298
Python
Python3
py
Runtime Error
13590
9940
226
n=int(input()) a=sorted([complex(*map(int,input().split()))for _ in[0]*n],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmpb_qs3gqo/tmpbk9tcabd.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s103130458
p00508
u150984829
1525439350
Python
Python3
py
Runtime Error
13930
9936
220
n=int(input()) a=sorted([complex(*map(int,input().split()))for _ in[0]*n],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break m=min(m,abs(w-z)**2) print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmp4aa3wip0/tmp85qf_ten.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s946716091
p00508
u150984829
1525439393
Python
Python3
py
Runtime Error
13550
9940
226
n=int(input()) a=sorted([complex(*map(int,input().split()))for _ in[0]*n],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmpgbv_6pq2/tmp3ui4tt9o.py", line 1, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s662820009
p00508
u150984829
1525439635
Python
Python3
py
Runtime Error
0
0
229
import sys input() a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmpazu2g2bt/tmpan6vy574.py", line 2, in <module> input() EOFError: EOF when reading a line
s622154582
p00508
u150984829
1525439651
Python
Python3
py
Runtime Error
13430
10052
236
import sys n=int(input()) a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1))
Traceback (most recent call last): File "/tmp/tmpng0qwpg4/tmpz69ej8ym.py", line 2, in <module> n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s461509036
p00508
u150984829
1525439732
Python
Python3
py
Runtime Error
13110
10056
282
import sys def s(): n=int(input()) a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1)) if'__main__'==__name__:s()
Traceback (most recent call last): File "/tmp/tmpl4eacvvc/tmpen9rw0vt.py", line 13, in <module> if'__main__'==__name__:s() ^^^ File "/tmp/tmpl4eacvvc/tmpen9rw0vt.py", line 3, in s n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s555161056
p00508
u150984829
1525440531
Python
Python3
py
Runtime Error
13170
10064
279
import sys def s(n): a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1)) if'__main__'==__name__:s(int(input()))
Traceback (most recent call last): File "/tmp/tmppvmegczk/tmp5smbblm_.py", line 12, in <module> if'__main__'==__name__:s(int(input())) ^^^^^^^ EOFError: EOF when reading a line
s969178874
p00508
u150984829
1525440574
Python
Python3
py
Runtime Error
13160
10068
279
import sys def s(n): a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1)) if'__main__'==__name__:s(int(input()))
Traceback (most recent call last): File "/tmp/tmpp36zawvt/tmpyhaw_xtz.py", line 12, in <module> if'__main__'==__name__:s(int(input())) ^^^^^^^ EOFError: EOF when reading a line
s437303336
p00508
u150984829
1525440657
Python
Python3
py
Runtime Error
13140
10068
284
import sys def s(n): t=[complex(*map(int,e.split()))for e in sys.stdin] a=sorted(t,key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if z.real-w.real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1)) if'__main__'==__name__:s(int(input()))
Traceback (most recent call last): File "/tmp/tmpf4c4uf4o/tmpdc1opfu4.py", line 13, in <module> if'__main__'==__name__:s(int(input())) ^^^^^^^ EOFError: EOF when reading a line
s947727237
p00508
u150984829
1525441025
Python
Python3
py
Runtime Error
13080
10064
279
import sys def s(): n=int(input()) a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if (z-w).real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1)) if'__main__'==__name__:s()
Traceback (most recent call last): File "/tmp/tmpwmskhmyk/tmpzjj17uwl.py", line 13, in <module> if'__main__'==__name__:s() ^^^ File "/tmp/tmpwmskhmyk/tmpzjj17uwl.py", line 3, in s n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s730276158
p00508
u150984829
1525441103
Python
Python3
py
Runtime Error
0
0
281
import sys def s(): n=int(input()) a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] t=z-w for w in a[:i][::-1]: if t.real>m:break d=abs(t)**2 if d<m:m=d print(int(m+.1)) if'__main__'==__name__:s()
Traceback (most recent call last): File "/tmp/tmps_rj1cfu/tmp6yk5q216.py", line 14, in <module> if'__main__'==__name__:s() ^^^ File "/tmp/tmps_rj1cfu/tmp6yk5q216.py", line 3, in s n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s625992327
p00508
u150984829
1525441137
Python
Python3
py
Runtime Error
13080
10060
279
import sys def s(): n=int(input()) a=sorted([complex(*map(int,e.split()))for e in sys.stdin],key=lambda x:x.real) m=1e9 for i in range(1,n): z=a[i] for w in a[:i][::-1]: if (z-w).real>m:break t=abs(w-z)**2 if t<m:m=t print(int(m+.1)) if'__main__'==__name__:s()
Traceback (most recent call last): File "/tmp/tmpyh5ssaa0/tmpo0czenm7.py", line 13, in <module> if'__main__'==__name__:s() ^^^ File "/tmp/tmpyh5ssaa0/tmpo0czenm7.py", line 3, in s n=int(input()) ^^^^^^^ EOFError: EOF when reading a line
s015230824
p00508
u724548524
1525473804
Python
Python3
py
Runtime Error
800
13136
537
import sys import bisect import math n = int(input()) p = [] def dist(i, j): global p return (p[j][0] - p[i][0]) ** 2 + (p[j][1] - p[i][1]) ** 2 for d in sys.stdin: p.append(tuple(list(map(int, d.split())))) p.sort(key = lambda x:x[1]) p.sort(key = lambda x:x[0]) mind = dist(0, 1) minl = math.sqrt(mind) for i in range(n): imax = bisect.bisect_right(p, (p[i][0] + minl , 0)) for j in range(i + 1, imax): d = dist(i, j) if d < mind: mind = d minl = math.sqrt(mind) print(mind)
Traceback (most recent call last): File "/tmp/tmplllxm9nw/tmphtn3s4e8.py", line 4, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s105140435
p00508
u724548524
1525475631
Python
Python3
py
Runtime Error
830
12484
486
import sys import bisect import math n = int(input()) p = [] def dist(i, j): global p return (p[j][0] - p[i][0]) ** 2 + (p[j][1] - p[i][1]) ** 2 for d in sys.stdin: p.append(tuple(list(map(int, d.split())))) p.sort() mind = dist(0, 1) minl = math.sqrt(mind) for i in range(n): for j in range(i + 1, n): if p[j][0] - p[i][0] > minl: break d = dist(i, j) if d < mind: mind = d minl = math.sqrt(mind) print(mind)
Traceback (most recent call last): File "/tmp/tmpafv9nesp/tmpvm3ua2bt.py", line 4, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s959957209
p00508
u724548524
1525522821
Python
Python3
py
Runtime Error
920
12624
491
import sys import bisect import math n = int(input()) p = [] def dist(i, j): global p return (p[j][0] - p[i][0]) ** 2 + (p[j][1] - p[i][1]) ** 2 for i in range(n): p.append(tuple(list(map(int, input().split())))) p.sort() mind = dist(0, 1) minl = math.sqrt(mind) for i in range(n): for j in range(i + 1, n): if p[j][0] - p[i][0] > minl: break d = dist(i, j) if d < mind: mind = d minl = math.sqrt(mind) print(mind)
Traceback (most recent call last): File "/tmp/tmpaog1zs06/tmpgty8bnsw.py", line 4, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s512786118
p00508
u724548524
1525529806
Python
Python3
py
Runtime Error
0
0
601
import sys import bisect import math n = int(input()) p = [] def dist(i, j): global p return (p[j][0] - p[i][0]) ** 2 + (p[j][1] - p[i][1]) ** 2 def minimundist(p): global n, mind, minl for i in range(n): for j in range(i + 1, n): if p[j][0] - p[i][0] > minl: break d = dist(i, j) if d < mind: mind = d minl = math.sqrt(mind) return mind for i in range(n): p.append(tuple(list(map(int, input().split())))) p.sort() mind = dist(0, 1) minl = math.sqrt(mind) print(minumundist(p))
Traceback (most recent call last): File "/tmp/tmplmfasb_a/tmpdb1rl682.py", line 4, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s549392620
p00508
u724548524
1525530032
Python
Python3
py
Runtime Error
710
12456
576
import sys import math n = int(input()) p = [] def dist(i, j): global p return (p[j][0] - p[i][0]) ** 2 + (p[j][1] - p[i][1]) ** 2 def minimumdist(p): global n, mind, minl for i in range(n): for j in range(i + 1, n): if p[j][0] - p[i][0] > minl: break d = dist(i, j) if d < mind: mind = d minl = math.sqrt(mind) return mind for i in sys.stdin: p.append(tuple(map(int, i.split()))) p.sort() mind = dist(0, 1) minl = math.sqrt(mind) print(minimumdist(p))
Traceback (most recent call last): File "/tmp/tmpavm1zdi_/tmpg4dzny2j.py", line 3, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s921280380
p00508
u975539923
1526201049
Python
Python3
py
Runtime Error
0
0
19
import numpy as np
s255901848
p00508
u777277984
1528107986
Python
Python3
py
Runtime Error
30
5780
294
import math n = int(input()) a = [] for i in range(n): x, y = map(int, input().split()) a.append((x, y)) b = [] for i in range(n-1): for j in range(i+1, n): p1 = a[i]; p2 = a[j] b.append(math.sqrt((p2[0] - p1[0])**2 + (p2[1] - p1[1])**2)) print(round(min(b)**2))
Traceback (most recent call last): File "/tmp/tmpm_pc4z_e/tmpevj6b26s.py", line 2, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s198037907
p00508
u197615397
1528521145
Python
Python3
py
Runtime Error
1250
15936
1156
import sys from operator import itemgetter from itertools import permutations def solve(a: list): length = len(a) if length <= 3: return min((p1[0]-p2[0])**2+(p1[1]-p2[1])**2 for p1, p2 in permutations(a, 2)) x_set_len = len(set(x for (x, _) in a)) axis = 0 if x_set_len > length/2 else 1 a.sort(key=itemgetter(axis)) mid_index = length//2 left, right = a[:mid_index], a[mid_index:] delta = min(solve(left), solve(right)) median = a[mid_index][axis] m_a = [] append = m_a.append for p in left[::-1]: if p[axis] < median-delta: break append(p) for p in right: if p[axis] > median+delta: break append(p) m_a.sort(key=itemgetter(not axis)) for i, p1 in enumerate(m_a): ub = p1[not axis] + delta for j, p2 in enumerate(m_a[i+1:]): if p2[not axis] > ub: break delta = min(delta, (p1[0]-p2[0])**2+(p1[1]-p2[1])**2) return delta if __name__ == "__main__": N = int(input()) a = [tuple(map(int, l.split())) for l in sys.stdin.readlines()] print(solve(a))
Traceback (most recent call last): File "/tmp/tmpedyxg5tv/tmpa8xmgj95.py", line 40, in <module> N = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s288013759
p00508
u841567836
1530263664
Python
Python3
py
Runtime Error
30
5604
425
def run(): n = int(input()) P = [] for _ in range(n): P.append([int(i) for i in input().split()]) d_min = 0 for i in P: for j in P: if i == j: continue else: d = (i[0] - j[0]) ** 2 + (i[1] - j[1]) ** 2 if d_min == 0 or d < d_min: d_min = d print(d_min) if __name__ == '__main__': run()
Traceback (most recent call last): File "/tmp/tmp3wkaous4/tmph162d5j6.py", line 20, in <module> run() File "/tmp/tmp3wkaous4/tmph162d5j6.py", line 2, in run n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s068074533
p00508
u351182591
1381327619
Python
Python
py
Runtime Error
20000
15292
388
n , p , d = input() , [] , "empty" for x in range(n): p += [map(int,raw_input().split())] for x in range(n): for y in range(n): dx = p[x][0] - p[y][0] dy = p[x][1] - p[y][1] if x < y and d == "empty": d = dx**2+dy**2 elif x < y: d = min(d,dx**2+dy**2) print(d)
Traceback (most recent call last): File "/tmp/tmpoa3eaddi/tmpqud_h0jl.py", line 1, in <module> n , p , d = input() , [] , "empty" ^^^^^^^ EOFError: EOF when reading a line
s023426982
p00508
u104911888
1386224708
Python
Python
py
Runtime Error
39870
99904
367
n = input() a = [map(int,raw_input().split()) for i in range(n)] a.sort() L = 10e20 for i in range(1, n-1): L = min(L, pow(a[i][0]-a[i-1][0],2)+pow(a[i][1]-a[i-1][1],2)) for j in reversed(range(i)): if abs(a[j][0]-a[i+1][0])>=L: break L = min(L, pow(a[j][0]-a[i+1][0],2)+pow(a[j][1]-a[i+1][1],2)) print L
File "/tmp/tmp0bui_qao/tmp_u6mbqr9.py", line 11 print L ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s780760284
p00508
u104911888
1386226221
Python
Python
py
Runtime Error
39870
99868
355
n = input() a = [map(int,raw_input().split()) for i in range(n)] a.sort() dist = lambda a,b:pow(a[0]-b[0],2)+pow(a[1]-b[1],2) L = 10**10 for i in range(1, n-1): L = min(L, dist(a[i], a[i-1])) for j in reversed(range(i)): if (a[i+1][0]-a[j][0])>=L: break L = min(L, dist(a[j], a[i+1])) print L
File "/tmp/tmp86vlz7um/tmph9gj8mz_.py", line 12 print L ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s434819808
p00509
u150984829
1524921275
Python
Python3
py
Runtime Error
0
0
440
def f(): n,c=map(int,input().split()) for h in'9731': if n>1: for m in range(int(10**(n-1)),0,-1): if((int(h)+m-1)*2+(c>=0)*c)%3: t=h+str(m-1).zfill(n-1) a=int(t+str(c)*(c>=0)+t[::-1]) for i in range(3,int(x**.5+1),2): if x%i==0:break else:return a else: a=int(h+str(c)*(c>=0)+h) for i in range(3,int(x**.5+1),2): if x%i==0:break else:return a return'9'*n+str(c)*(c>=0)+'9'*n print(f())
Traceback (most recent call last): File "/tmp/tmpi10hjeph/tmp7aj7_o4p.py", line 18, in <module> print(f()) ^^^ File "/tmp/tmpi10hjeph/tmp7aj7_o4p.py", line 2, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s583918988
p00509
u150984829
1524921299
Python
Python3
py
Runtime Error
20
5660
440
def f(): n,c=map(int,input().split()) for h in'9731': if n>1: for m in range(int(10**(n-1)),0,-1): if((int(h)+m-1)*2+(c>=0)*c)%3: t=h+str(m-1).zfill(n-1) a=int(t+str(c)*(c>=0)+t[::-1]) for i in range(3,int(a**.5+1),2): if a%i==0:break else:return a else: a=int(h+str(c)*(c>=0)+h) for i in range(3,int(a**.5+1),2): if a%i==0:break else:return a return'9'*n+str(c)*(c>=0)+'9'*n print(f())
Traceback (most recent call last): File "/tmp/tmpdm79vn26/tmp_v5y4p04.py", line 18, in <module> print(f()) ^^^ File "/tmp/tmpdm79vn26/tmp_v5y4p04.py", line 2, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s961470546
p00509
u150984829
1524921395
Python
Python3
py
Runtime Error
0
0
500
def f(): n,c=map(int,input().split()) for h in'9731': if n>1: for m in range(int(10**(n-1)),0,-1): if((int(h)+m-1)*2+(c>=0)*c)%3: t=h+str(m-1).zfill(n-1) a=int(t+str(c)*(c>=0)+t[::-1]) if 2 in[x,pow(2,x,x)]: for i in range(3,int(a**.5+1),2): if a%i==0:break else:return a else: a=int(h+str(c)*(c>=0)+h) if 2 in[x,pow(2,x,x)]: for i in range(3,int(a**.5+1),2): if a%i==0:break else:return a return'9'*n+str(c)*(c>=0)+'9'*n print(f())
Traceback (most recent call last): File "/tmp/tmpfcdf2aj4/tmpo9loebzz.py", line 20, in <module> print(f()) ^^^ File "/tmp/tmpfcdf2aj4/tmpo9loebzz.py", line 2, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s421794097
p00509
u150984829
1524921421
Python
Python3
py
Runtime Error
20
5648
500
def f(): n,c=map(int,input().split()) for h in'9731': if n>1: for m in range(int(10**(n-1)),0,-1): if((int(h)+m-1)*2+(c>=0)*c)%3: t=h+str(m-1).zfill(n-1) a=int(t+str(c)*(c>=0)+t[::-1]) if 2 in[a,pow(2,a,a)]: for i in range(3,int(a**.5+1),2): if a%i==0:break else:return a else: a=int(h+str(c)*(c>=0)+h) if 2 in[a,pow(2,a,a)]: for i in range(3,int(a**.5+1),2): if a%i==0:break else:return a return'9'*n+str(c)*(c>=0)+'9'*n print(f())
Traceback (most recent call last): File "/tmp/tmpx4p1bkwa/tmp1j40fbn2.py", line 20, in <module> print(f()) ^^^ File "/tmp/tmpx4p1bkwa/tmp1j40fbn2.py", line 2, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s776505924
p00509
u150984829
1524931071
Python
Python3
py
Runtime Error
0
0
417
def p(x): if 2 in[a,pow(2,a,a)]: for i in range(3,int(a**.5+1),2): if a%i==0:return 0 else:return 1 def f(): n,c=map(int,input().split()) b=str(c)*(c>=0) for h in'9731': if n>1: for m in range(int(10**(n-1)),0,-1): if((int(h)+m-1)*2+(c>=0)*c)%3: t=h+str(m-1).zfill(n-1) a=int(t+b+t[::-1]) if p(a):return a else: a=int(h+b+h) if p(a):return a return'9'*n+b+'9'*n print(f())
Traceback (most recent call last): File "/tmp/tmp3pv6lrux/tmps__awo0l.py", line 20, in <module> print(f()) ^^^ File "/tmp/tmp3pv6lrux/tmps__awo0l.py", line 7, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s892160329
p00509
u150984829
1524931091
Python
Python3
py
Runtime Error
20
5636
417
def p(x): if 2 in[x,pow(2,x,x)]: for i in range(3,int(x**.5+1),2): if x%i==0:return 0 else:return 1 def f(): n,c=map(int,input().split()) b=str(c)*(c>=0) for h in'9731': if n>1: for m in range(int(10**(n-1)),0,-1): if((int(h)+m-1)*2+(c>=0)*c)%3: t=h+str(m-1).zfill(n-1) a=int(t+b+t[::-1]) if p(a):return a else: a=int(h+b+h) if p(a):return a return'9'*n+b+'9'*n print(f())
Traceback (most recent call last): File "/tmp/tmp8z0ookrn/tmp96pomin6.py", line 20, in <module> print(f()) ^^^ File "/tmp/tmp8z0ookrn/tmp96pomin6.py", line 7, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s610264013
p00509
u150984829
1524962712
Python
Python3
py
Runtime Error
0
0
404
def p(x): for i in range(7,int(x**.5+1),2): if x%i==0:return 0 else:return 1 def f(): n,c=map(int,input().split()) s='9'*n if c<0:return(11,s+s)[n>1] c=str(c) for h in'9731': if n-1: for m in range(int(10**~-n),0,-1): if((int(h)+m-1)*2+c)%3: t=h+str(m-1).zfill(n-1) a=int(t+c+t[::-1]) if p(a):return a else: a=int(h+c+h) if p(a):return a return s+b+s print(f())
Traceback (most recent call last): File "/tmp/tmpu7rvuoyn/tmpa94k3i8k.py", line 21, in <module> print(f()) ^^^ File "/tmp/tmpu7rvuoyn/tmpa94k3i8k.py", line 6, in f n,c=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s749968898
p00509
u724548524
1525531294
Python
Python3
py
Runtime Error
20
5608
425
n , c = map(int, input().split()) def prime(a): if a == 1: return 1 i = 3 while i <= a / i: if a % i == 0: return 0 i += 2 return 1 if c < 0: c = [] else: c = [str(c)] for i in range(10**(n-1),10**n)[::-1]: num = int("".join(list(str(i)) + c + list(str(i))[::-1])) if prime(num): print(num) break else: print("".join(["9"] * n + c + ["9"] * n))
Traceback (most recent call last): File "/tmp/tmppwmcanj_/tmp0r07d0rl.py", line 1, in <module> n , c = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s363685816
p00509
u547057305
1381065192
Python
Python
py
Runtime Error
0
0
864
def Sosu(a): if a != 2 and a % 2 == 0: return 2 y = 0 for x in range(int(a**0.5)+1): if (a/(x+1.0))%1 == 0: y += 1 if y == 1: return 0 else: return 1 Inp = list(map(int,input().split())) From = int("9"*Inp[0]) To = int("1"+"0"*(Inp[0]-1))-1 for x in range(From,To,-1): if Inp[1] < 0: a = int(str(x)+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: a = int(str(x)+str(Inp[1])+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: if Inp[1] < 0: print("9"*Inp[0]*2) else: print("9"*Inp[0]+str(Inp[1])+"9"*Inp[0])
Traceback (most recent call last): File "/tmp/tmpxh62ubs_/tmpoyu0euof.py", line 13, in <module> Inp = list(map(int,input().split())) ^^^^^^^ EOFError: EOF when reading a line
s064712745
p00509
u547057305
1381065448
Python
Python
py
Runtime Error
100
5588
863
def Sosu(a): if a != 2 and a % 2 == 0: return 2 y = 0 for x in range(int(a**0.5)+1): if (a/(x+1.0))%1 == 0: y += 1 if y == 1: return 0 else: return 1 Inp = map(int,raw_input().split()) From = int("9"*Inp[0]) To = int("1"+"0"*(Inp[0]-1))-1 for x in range(From,To,-1): if Inp[1] < 0: a = int(str(x)+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: a = int(str(x)+str(Inp[1])+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: if Inp[1] < 0: print("9"*Inp[0]*2) else: print("9"*Inp[0]+str(Inp[1])+"9"*Inp[0])
Traceback (most recent call last): File "/tmp/tmpo6bnhk_0/tmpff_5abfc.py", line 13, in <module> Inp = map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s574805890
p00509
u547057305
1381066788
Python
Python
py
Runtime Error
20000
4360
866
def Sosu(a): if a != 2 and a % 2 == 0: return 2 y = 0 for x in xrange(int(a**0.5)+1): if (a/(x+1.0))%1 == 0: y += 1 if y == 1: return 0 else: return 1 Inp = map(int,raw_input().split()) From = int("9"*Inp[0]) To = int("1"+"0"*(Inp[0]-1))-1 for x in xrange(From,To,-1): if Inp[1] < 0: a = int(str(x)+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: a = int(str(x)+str(Inp[1])+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: if Inp[1] < 0: print("9"*Inp[0]*2) else: print("9"*Inp[0]+str(Inp[1])+"9"*Inp[0])
Traceback (most recent call last): File "/tmp/tmpubxz51eb/tmp8sfotigk.py", line 13, in <module> Inp = map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s567992684
p00509
u547057305
1381075073
Python
Python
py
Runtime Error
20000
4428
873
def Sosu(a): if a != 2 and a % 2 == 0: return 2 if a != 3 and a % 3 == 0: return 3 y = 0 for x in xrange(4,int(a**0.5)+1): if a%x == 0: return 1 else: return 0 Inp = map(int,raw_input().split()) From = int("9"*Inp[0]) To = int("1"+"0"*(Inp[0]-1))-1 for x in xrange(From,To,-1): if Inp[1] < 0: a = int(str(x)+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: a = int(str(x)+str(Inp[1])+str(x)[::-1]) if Sosu(a) == 0: print(a) break else: if Inp[1] < 0: print("9"*Inp[0]*2) else: print("9"*Inp[0]+str(Inp[1])+"9"*Inp[0])
Traceback (most recent call last): File "/tmp/tmp55v092jt/tmppk13iaxy.py", line 13, in <module> Inp = map(int,raw_input().split()) ^^^^^^^^^ NameError: name 'raw_input' is not defined
s014486991
p00510
u814658648
1439905514
Python
Python
py
Runtime Error
0
0
202
n = int(input()) s = m = int(input()) for i in range(n): in_car, out_car = map(int, input().split()) m += in_car - out_car if m < 0: s = 0 break else: s = max(s, m) print(s)
Traceback (most recent call last): File "/tmp/tmpvfx655fk/tmpix8ie5g7.py", line 1, in <module> n = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s478020949
p00511
u847467233
1530348190
Python
Python3
py
Runtime Error
20
5588
254
# AOJ 0588: Simple Calculator # Python3 2018.6.30 bal4u a = int(input()) while True: op = input().strip() if op == '=': break b = int(input()) if op == '+': a += b elif s == '-': a -= b elif s == '*': a *= b else: a //= b print(a)
Traceback (most recent call last): File "/tmp/tmp964hymb_/tmp9pc_g4wx.py", line 4, in <module> a = int(input()) ^^^^^^^ EOFError: EOF when reading a line
s456832991
p00511
u609255173
1361700597
Python
Python
py
Runtime Error
10
4208
154
a = 0 o = "" while True: s = raw_input() if s == "=": break if s in ["+", "-", "*", "/"]: o = s else: a = eval(str(a) + o + s) print a
File "/tmp/tmp2e5f6rp4/tmpz76dlmzw.py", line 11 print a ^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
s781867719
p00513
u858885710
1408827453
Python
Python3
py
Runtime Error
0
0
155
def fact(a): return a and a*fact(a-1) or 1 n,m,r = map(int,input().split()) r-=n*m if r < 0: print(0) else: print(fact(r+n-1)//fact(n-1)//fact(r))
Traceback (most recent call last): File "/tmp/tmpr755tngv/tmpgmqbqppn.py", line 3, in <module> n,m,r = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s591736731
p00513
u150984829
1524970893
Python
Python3
py
Runtime Error
20
5632
164
a=[int(input())for _ in[0]*int(input())] m=a[-1]+1 b=[1]*-~m x=1 while 2*x*-~x<m: y=x while 2*x*y+x+y<m: b[2*x*y+x+y]=0 y+=1 x+=1 print(sum(b[e]for e in a))
Traceback (most recent call last): File "/tmp/tmpflv4xgnu/tmp24zfx43_.py", line 1, in <module> a=[int(input())for _ in[0]*int(input())] ^^^^^^^ EOFError: EOF when reading a line
s463173993
p00513
u150984829
1524972722
Python
Python3
py
Runtime Error
0
0
138
b=[1]*2**31 for i in range(3,46341,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
s065627133
p00513
u150984829
1524973739
Python
Python3
py
Runtime Error
0
0
136
b=[1]*2**31 for i in range(3,100,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
s395724306
p00513
u150984829
1524973770
Python
Python3
py
Runtime Error
0
0
138
b=[1]*(2**31) for i in range(3,100,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
s189933759
p00513
u150984829
1524973794
Python
Python3
py
Runtime Error
20
5712
136
b=[1]*10000 for i in range(3,100,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
Traceback (most recent call last): File "/tmp/tmpw2t689y3/tmpl6p7elna.py", line 4, in <module> print(sum(b[int(input())]for _ in[0]*int(input()))) ^^^^^^^ EOFError: EOF when reading a line
s972948493
p00513
u150984829
1524974370
Python
Python3
py
Runtime Error
20
5712
136
b=[1]*10000 for i in range(3,100,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
Traceback (most recent call last): File "/tmp/tmpgw1hq2b3/tmpb04tkjb8.py", line 4, in <module> print(sum(b[int(input())]for _ in[0]*int(input()))) ^^^^^^^ EOFError: EOF when reading a line
s252332772
p00513
u150984829
1524974394
Python
Python3
py
Runtime Error
70
18344
139
b=[1]*1000000 for i in range(3,1000,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
Traceback (most recent call last): File "/tmp/tmprtwwvgv8/tmpnivhqqp3.py", line 4, in <module> print(sum(b[int(input())]for _ in[0]*int(input()))) ^^^^^^^ EOFError: EOF when reading a line
s788980723
p00513
u150984829
1524975935
Python
Python3
py
Runtime Error
20
6292
137
b=[1]*2**16 for i in range(3,2**8,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
Traceback (most recent call last): File "/tmp/tmp2f4mwci3/tmpjkpw2nrx.py", line 4, in <module> print(sum(b[int(input())]for _ in[0]*int(input()))) ^^^^^^^ EOFError: EOF when reading a line
s378850211
p00513
u150984829
1524975970
Python
Python3
py
Runtime Error
0
0
138
b=[1]*2**32 for i in range(3,2**16,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) print(sum(b[int(input())]for _ in[0]*int(input())))
s733852889
p00513
u150984829
1524978209
Python
Python3
py
Runtime Error
50
11808
244
b=[1]*500000 for i in range(3,999,2): if b[i//2]:b[i*i//2::i]=[0]*len(b[i*i//2::i]) def p(x): if x<1e6:return b[x] x=2*x+1 for i in range(3,int(x**.5+1),2): if x%i==0:return 0 return 1 print(sum(p(int(input()))for _ in[0]*int(input())))
Traceback (most recent call last): File "/tmp/tmpqh6a3nne/tmpvcwdnlj2.py", line 10, in <module> print(sum(p(int(input()))for _ in[0]*int(input()))) ^^^^^^^ EOFError: EOF when reading a line
s922803446
p00514
u868447400
1531974883
Python
Python3
py
Runtime Error
0
0
151
n,m,r=map(int,input().split()); a=n+r-n*m-1,b=r-n*m; s=1; if a<b||a<0||b<0:s=0; else: if b>a-b:b=a-b; for i in range(b):s=s*(a-i)/(i+1); print(s)
File "/tmp/tmplps8ilme/tmpcyrr63di.py", line 2 a=n+r-n*m-1,b=r-n*m; ^^^^^^^^^^^ SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
s713443512
p00514
u868447400
1531974891
Python
Python3
py
Runtime Error
0
0
151
n,m,r=map(int,input().split()); a=n+r-n*m-1;b=r-n*m; s=1; if a<b||a<0||b<0:s=0; else: if b>a-b:b=a-b; for i in range(b):s=s*(a-i)/(i+1); print(s)
File "/tmp/tmp7nyozef8/tmpup8_vfr9.py", line 4 if a<b||a<0||b<0:s=0; ^ SyntaxError: invalid syntax
s930853131
p00514
u868447400
1531974923
Python
Python3
py
Runtime Error
0
0
155
n,m,r=map(int,input().split()); a=n+r-n*m-1;b=r-n*m; s=1; if a<b or a<0 or b<0:s=0; else: if b>a-b:b=a-b; for i in range(b):s=s*(a-i)/(i+1); print(s)
File "/tmp/tmp3e0epf0v/tmpllxing_h.py", line 7 for i in range(b):s=s*(a-i)/(i+1); TabError: inconsistent use of tabs and spaces in indentation
s265334331
p00514
u858885710
1408827478
Python
Python3
py
Runtime Error
30
6724
155
def fact(a): return a and a*fact(a-1) or 1 n,m,r = map(int,input().split()) r-=n*m if r < 0: print(0) else: print(fact(r+n-1)//fact(n-1)//fact(r))
Traceback (most recent call last): File "/tmp/tmpot7eaptf/tmpgpqz2myt.py", line 3, in <module> n,m,r = map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s641882138
p00514
u095377734
1470468490
Python
Python3
py
Runtime Error
20
7768
232
import math def combination(p, q): if q < 0 or p < q: return 0 return math.factorial(p) / math.factorial(q) / math.factorial(p - q) a, b, c = map(int, input().split()) c -= a * b print(int(combination(c + a - 1, c)))
Traceback (most recent call last): File "/tmp/tmp0vmx15mg/tmpc24pnsab.py", line 6, in <module> a, b, c = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s167087213
p00514
u220324665
1486639408
Python
Python3
py
Runtime Error
20
7604
138
n,m,r=map(int,input().split()) r-=n*m if r<0:print(0);exit(0); from math import * print(int(factorial(n+r-1)/factorial(r)/factorial(n-1)))
Traceback (most recent call last): File "/tmp/tmpe6i5knc8/tmpo874icq5.py", line 1, in <module> n,m,r=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s310779274
p00514
u150984829
1524980649
Python
Python3
py
Runtime Error
20
5600
166
n,m,r=map(int,input().split()) a,b=sorted([n-1,r-m*n]) A=1 for i in range(a):A*=i+1 B=A for i in range(a,b):B*=i+1 C=B for i in range(b,a+b):C*=i+1 print(int(C/B/A))
Traceback (most recent call last): File "/tmp/tmpejqr26b9/tmpk5skiuzk.py", line 1, in <module> n,m,r=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s096030968
p00514
u150984829
1524980762
Python
Python3
py
Runtime Error
20
5596
175
n,m,r=map(int,input().split()) a,b=sorted([n-1,r-m*n]) A=1 for i in range(a):A*=i+1 B=A for i in range(a,b):B*=i+1 C=B for i in range(b,a+b):C*=i+1 print([int(C/B/A),0][a<1])
Traceback (most recent call last): File "/tmp/tmpxfph4og2/tmp_e_uzot4.py", line 1, in <module> n,m,r=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s158390107
p00514
u150984829
1524980830
Python
Python3
py
Runtime Error
20
5604
180
n,m,r=map(int,input().split()) a,b=sorted([n-1,r-m*n]) A=1 for i in range(a):A*=i+1 B=A for i in range(a,b):B*=i+1 C=B for i in range(b,a+b):C*=i+1 print(0 if a<1 else int(C/B/A))
Traceback (most recent call last): File "/tmp/tmpf7ofo953/tmpjrqf8xos.py", line 1, in <module> n,m,r=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s752315856
p00514
u150984829
1524982064
Python
Python3
py
Runtime Error
0
0
110
n,m,r=map(int,input().split()) r-=m*n if r<0:print(0) else: a=1 for i in range(r):a*=i+n/~-i print(int(a))
Traceback (most recent call last): File "/tmp/tmpb_kd4j87/tmpvb06nzjj.py", line 1, in <module> n,m,r=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s546468675
p00514
u150984829
1524982373
Python
Python3
py
Runtime Error
20
5608
115
n,m,r=map(int,input().split()) r-=m*n if r<0:print(0) else: a=1 for i in range(r):a*=(i+n)/-~i print(int(a+.1))
Traceback (most recent call last): File "/tmp/tmpd1o9prgp/tmpp132adiw.py", line 1, in <module> n,m,r=map(int,input().split()) ^^^^^^^ EOFError: EOF when reading a line
s568105901
p00514
u724548524
1525528423
Python
Python3
py
Runtime Error
0
0
146
from scipy.misc import comb n, m, r = map(int, input().split()) a = r - n * m if a < 0: print(0) else: print(int(comb(a + n - 1, n - 1)))
Traceback (most recent call last): File "/tmp/tmp584_jm1s/tmpy6qyghn1.py", line 1, in <module> from scipy.misc import comb ImportError: cannot import name 'comb' from 'scipy.misc' (/root/miniconda3/envs/sandbox-runtime/lib/python3.11/site-packages/scipy/misc/__init__.py)
s418493098
p00514
u724548524
1525528590
Python
Python3
py
Runtime Error
20
5656
177
import math n, m, r = map(int, input().split()) a = r - n * m if a < 0: print(0) else: print(int(math.factorial(a + n - 1) / math.factorial(n - 1) / math.factorial(a)))
Traceback (most recent call last): File "/tmp/tmpwjt5zny5/tmpvhsy465g.py", line 2, in <module> n, m, r = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s754230536
p00514
u724548524
1525529272
Python
Python3
py
Runtime Error
20
5652
369
import math n, m, r = map(int, input().split()) a = r - n * m if a < 0: print(0) else: b = 1 if n - 1 > a: for i in range(a): b *= a + n - 1 - i for i in range(1, a + 1): b /= i else: for i in range(n - 1): b *= a + n - 1 - i for i in range(1, n): b /= i print(int(b))
Traceback (most recent call last): File "/tmp/tmpyd9v_5vb/tmpbe0zx825.py", line 2, in <module> n, m, r = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s018202122
p00514
u724548524
1525529330
Python
Python3
py
Runtime Error
0
0
386
import math n, m, r = map(int, input().split()) a = r - n * m if a < 0: print(0) else: b = 1 if n - 1 > a: for i in range(a): b *= a + n - 1 - i for i in range(1, a + 1): b = int(b / i) else: for i in range(n - 1): b *= a + n - 1 - i for i in range(1, n): b /= int(b / i) print(int(b))
Traceback (most recent call last): File "/tmp/tmp861ch3l4/tmptezwh7c8.py", line 2, in <module> n, m, r = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s799785831
p00514
u724548524
1525529339
Python
Python3
py
Runtime Error
30
5648
385
import math n, m, r = map(int, input().split()) a = r - n * m if a < 0: print(0) else: b = 1 if n - 1 > a: for i in range(a): b *= a + n - 1 - i for i in range(1, a + 1): b = int(b / i) else: for i in range(n - 1): b *= a + n - 1 - i for i in range(1, n): b = int(b / i) print(int(b))
Traceback (most recent call last): File "/tmp/tmp6dawi2pt/tmpilv8ayqa.py", line 2, in <module> n, m, r = map(int, input().split()) ^^^^^^^ EOFError: EOF when reading a line
s707792912
p00514
u611853667
1374438547
Python
Python
py
Runtime Error
0
0
207
def comb(a, b): if(a < b or b < 0):return 0 if(b > a - b)return comb(a, a - b) return comb(a, b - 1) * (a - b + 1) / b a, b, c = map(int, raw_input().split()) c -= a * b print comb(c + a - 1, c)
File "/tmp/tmpym4rigoz/tmpb275xhje.py", line 3 if(b > a - b)return comb(a, a - b) ^^^^^^ SyntaxError: invalid syntax
s677291657
p00514
u611853667
1374438594
Python
Python
py
Runtime Error
0
0
208
def comb(a, b): if(a < b or b < 0):return 0 if(b > a - b):return comb(a, a - b) return comb(a, b - 1) * (a - b + 1) / b a, b, c = map(int, raw_input().split()) c -= a * b print comb(c + a - 1, c)
File "/tmp/tmpl6op6fzz/tmp4dtot4tt.py", line 8 print comb(c + a - 1, c) ^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?