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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s322646715 | p02289 | u112247126 | 1487833103 | Python | Python3 | py | Runtime Error | 0 | 0 | 1106 | import sys
from numpy import inf
def insert(heap, key):
heap.append(-inf)
heapIncreaseKey(heap, key)
def parent(i):
return (i - 1) // 2
def heapIncreaseKey(heap, key):
heap[len(heap) - 1] = key
i = len(heap) - 1
while i > 0 and heap[parent(i)] < heap[i]:
heap[i], heap[parent(i)] = hea... | Traceback (most recent call last):
File "/tmp/tmpp1r38m5t/tmp5a0kx9dv.py", line 41, in <module>
line = stdin.readline()
^^^^^
NameError: name 'stdin' is not defined
| |
s215176537 | p02289 | u112247126 | 1487833266 | Python | Python3 | py | Runtime Error | 0 | 0 | 1101 | import sys
from numpy import inf
def insert(heap, key):
heap.append(-inf)
heapIncreaseKey(heap, key)
def parent(i):
return (i - 1) // 2
def heapIncreaseKey(heap, key):
heap[len(heap) - 1] = key
i = len(heap) - 1
while i > 0 and heap[parent(i)] < heap[i]:
heap[i], heap[parent(i)] = hea... | Traceback (most recent call last):
File "/tmp/tmp8h58bqtx/tmp8qwysoe9.py", line 41, in <module>
if line[0] == 'i':
~~~~^^^
IndexError: string index out of range
| |
s481653155 | p02289 | u546285759 | 1492335251 | Python | Python3 | py | Runtime Error | 0 | 0 | 335 | import bisect
from collections import deque
maxv = 0
l = deque()
while True:
order = input()
if order == "end":
break
tmp = order.split()
if len(tmp) > 1:
v = int(tmp[1])
bisect.insort(l, v)
maxv = l[-1]
else:
print(maxv)
l.pop()
maxv = l[-1] i... | Traceback (most recent call last):
File "/tmp/tmp04vpvt04/tmp8a7phf40.py", line 6, in <module>
order = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s281568507 | p02289 | u370086573 | 1494575770 | Python | Python3 | py | Runtime Error | 0 | 0 | 1102 | import sys
heap = [0]
NIL = -1
def parent(i):
return i // 2
def left(i):
return 2 * i
def right(i):
return 2 * i + 1
def insert(key):
H = len(heap) - 1
heap.append(NIL)
heapIncreaseKey(H, key)
def heapIncreaseKey(i, key):
if key < heap[i]:
return False
heap[i] = key
... | ||
s397655964 | p02289 | u370086573 | 1494576402 | Python | Python3 | py | Runtime Error | 0 | 0 | 1102 | def parent(i):
return i // 2
def left(i):
return 2 * i
def right(i):
return 2 * i + 1
def insert(key):
heap.append(NIL)
H = len(heap) - 1
heapIncreaseKey(H, key)
def heapIncreaseKey(i, key):
if key < heap[i]:
return False
heap[i] = key
while i > 1 and heap[parent(i)] ... | Traceback (most recent call last):
File "/tmp/tmpeyxtmt9n/tmp5kl9c75q.py", line 57, in <module>
cmd = list(input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s415356911 | p02289 | u990398499 | 1499326550 | Python | Python3 | py | Runtime Error | 0 | 0 | 1407 | # ?§£???2
from math import inf
from math import floor
def maxheapfi(i):
global H
global A
l = 2 * (i + 1) - 1
r = 2 * (i + 1)
if l < H and A[l] > A[i-1] :
largest = l
else:
largest = i
if r < H and A[r] > A[largest] :
largest = r
if largest != i:
... | File "/tmp/tmpu3674hi4/tmp39d0rpg5.py", line 65
For i in range(H):
^
SyntaxError: invalid syntax
| |
s195803451 | p02289 | u990398499 | 1499326711 | Python | Python3 | py | Runtime Error | 0 | 0 | 1404 | # ?§£???2
from math import inf
from math import floor
def maxheapfi(i):
global H
global A
l = 2 * (i + 1) - 1
r = 2 * (i + 1)
if l < H and A[l] > A[i-1] :
largest = l
else:
largest = i
if r < H and A[r] > A[largest] :
largest = r
if largest != i:
... | Traceback (most recent call last):
File "/tmp/tmpv2vudmv0/tmpwjie1o4o.py", line 73, in <module>
main()
File "/tmp/tmpv2vudmv0/tmpwjie1o4o.py", line 64, in main
H = int(input().strip())
^^^^^^^
EOFError: EOF when reading a line
| |
s464530114 | p02289 | u990398499 | 1499328051 | Python | Python3 | py | Runtime Error | 0 | 0 | 1450 | # ?§£???2
from math import inf
from math import floor
def maxheapfi(i):
global H
global A
l = 2 * (i) + 1
r = 2 * (i +1)
if l < H and A[l] > A[i] :
largest = l
else:
largest = i
if r < H and A[r] > A[largest] :
largest = r
#print('largest',largest)
if la... | Traceback (most recent call last):
File "/tmp/tmpu76uhd9a/tmp12zz30na.py", line 79, in <module>
main()
File "/tmp/tmpu76uhd9a/tmp12zz30na.py", line 69, in main
opr = input().strip().split(' ')
^^^^^^^
EOFError: EOF when reading a line
| |
s532818009 | p02289 | u990398499 | 1499328140 | Python | Python3 | py | Runtime Error | 0 | 0 | 1450 | # ?§£???2
from math import inf
from math import floor
def maxheapfi(i):
global H
global A
l = 2 * (i) + 1
r = 2 * (i +1)
if l < H and A[l] > A[i] :
largest = l
else:
largest = i
if r < H and A[r] > A[largest] :
largest = r
#print('largest',largest)
if la... | Traceback (most recent call last):
File "/tmp/tmp_gx3wdbf/tmpuccu7d9a.py", line 79, in <module>
main()
File "/tmp/tmp_gx3wdbf/tmpuccu7d9a.py", line 69, in main
opr = input().strip().split(' ')
^^^^^^^
EOFError: EOF when reading a line
| |
s267641186 | p02289 | u990398499 | 1499328184 | Python | Python3 | py | Runtime Error | 0 | 0 | 1438 | from math import inf
from math import floor
def maxheapfi(i):
global H
global A
l = 2 * (i) + 1
r = 2 * (i +1)
if l < H and A[l] > A[i] :
largest = l
else:
largest = i
if r < H and A[r] > A[largest] :
largest = r
#print('largest',largest)
if largest != i... | Traceback (most recent call last):
File "/tmp/tmprv0x9zhf/tmpm4jtnjtf.py", line 78, in <module>
main()
File "/tmp/tmprv0x9zhf/tmpm4jtnjtf.py", line 68, in main
opr = input().strip().split(' ')
^^^^^^^
EOFError: EOF when reading a line
| |
s929604579 | p02289 | u796784914 | 1500703270 | Python | Python | py | Runtime Error | 0 | 0 | 1037 | from collections import deque
def main():
q =deque()
H = 0
for i in range(int(2e+06)):
cmd = map(str,raw_input().split())
if cmd[0] == "insert":
q.append(int(cmd[1]))
H += 1
increase(q,H)
elif cmd[0] == "extract":
print q.popleft()
... | File "/tmp/tmpwseqbk6n/tmpq6w946xc.py", line 13
print q.popleft()
^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s572494384 | p02289 | u616085665 | 1500707541 | Python | Python | py | Runtime Error | 0 | 0 | 329 | def main():
q = []
while(True):
cmd = map(str,raw_input().split())
if cmd[0] == "insert":
q.append()=int(cmd[1])
elif cmd[0] == "extract":
ret = max(q)
print ret
q.remove(ret)
else:
break
if __name__ == "__main__":
... | File "/tmp/tmp25lbmt7p/tmp2kjvj_fe.py", line 6
q.append()=int(cmd[1])
^^^^^^^^^^
SyntaxError: cannot assign to function call here. Maybe you meant '==' instead of '='?
| |
s107432913 | p02289 | u024715419 | 1510120413 | Python | Python3 | py | Runtime Error | 0 | 0 | 177 | a = []
while True:
inp = input()
if inp[0] == "i":
a.append(int(inp[7:]))
elif inp[0] == "e":
a.sort()
print(a.pop())
else:
break | Traceback (most recent call last):
File "/tmp/tmp8x5_m_kr/tmpzh5ytcys.py", line 3, in <module>
inp = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s003647558 | p02289 | u662418022 | 1517738189 | Python | Python3 | py | Runtime Error | 0 | 0 | 1490 | # -*- coding: utf-8 -*-
def parent(i):
return i // 2
def left(i):
return 2 * i
def right(i):
return 2 * i + 1
class MaxHeap(list):
def __init__(self, H=0):
list.__init__(self)
self.H = H
self[:] = [None] * (H+1)
def insert(self, key):
self.H += 1
self.a... | Traceback (most recent call last):
File "/tmp/tmpaqbfcpat/tmpfo6v1our.py", line 64, in <module>
c = input().split(" ")
^^^^^^^
EOFError: EOF when reading a line
| |
s376060139 | p02289 | u426534722 | 1518447436 | Python | Python3 | py | Runtime Error | 0 | 0 | 781 | def maxHeapify(A, i, n):
l = i * 2 + 1
r = i * 2 + 2
if l < n and A[l] > A[i]:
largest = l
else:
largest = i
if r < n and A[r] > A[largest]:
largest = r
if largest != i:
A[i], A[largest] = A[largest], A[i]
maxHeapify(A, largest)
def insert(S, k):
S.app... | Traceback (most recent call last):
File "/tmp/tmp7hhshokj/tmp8zd24j7z.py", line 29, in <module>
s = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s155263126 | p02289 | u150984829 | 1519622530 | Python | Python3 | py | Runtime Error | 0 | 0 | 408 | def h(i):
l=2*i;r=l+1
if r<H:
if A[i]<A[l]:
if A[l]<A[r]:A[i],A[r]=A[r],A[i];h(r)
else:A[i],A[l]=A[l],A[i];h(l)
elif A[i]<A[r]:A[i],A[r]=A[r],A[i];h(r)
elif l<H and A[i]<A[l]:A[i],A[l]=A[l],A[i];h(l)
H=0
A=[0]
for a in iter(input,'end'):
if a[0]=='i':
H+=1;A+=[int(a[7:])];k=H
while k>1 and A[k//2]<A[k... | Traceback (most recent call last):
File "/tmp/tmpf5gquj94/tmplrsae74i.py", line 11, in <module>
for a in iter(input,'end'):
EOFError: EOF when reading a line
| |
s730710765 | p02289 | u150984829 | 1519625234 | Python | Python3 | py | Runtime Error | 0 | 0 | 149 | import sys
from heapq import *
H,O=[],''
for e in sys.stdin:
if'i'==e[0]:heappush(H,-int(e[7:]))
elif't'==e[2]:O+=f'{-heappop(H)}\n')
print(O[-1])
| File "/tmp/tmp_hah2ta5/tmphxnt4kch.py", line 6
elif't'==e[2]:O+=f'{-heappop(H)}\n')
^
SyntaxError: unmatched ')'
| |
s135724706 | p02289 | u150984829 | 1519625791 | Python | Python3 | py | Runtime Error | 0 | 0 | 161 | import sys
from heapq import *
H,O=[],[]
for e in sys.stdin:
t=e[1]
if'n'==t:heappush(H,-int(e[7:]))
elif'x'==t:O+=[-heappop(H)]
print('\n'.join(map(str,O)))
| ||
s674250930 | p02289 | u150984829 | 1519625848 | Python | Python3 | py | Runtime Error | 0 | 0 | 161 | import sys
from heapq import *
H,O=[],[]
for e in sys.stdin:
c=e[1]
if'n'==c:heappush(H,-int(e[7:]))
elif'x'==c:O+=[-heappop(H)]
print('\n'.join(map(str,O)))
| ||
s138561262 | p02289 | u126478680 | 1525855936 | Python | Python3 | py | Runtime Error | 0 | 0 | 1679 | class PriorityQueue():
def __init__(self):
self.heap = []
self.num_node = 0
def max_heapify(self, i):
l = (i+1)*2-1
r = (i+1)*2
largest = i
if l < self.num_node and self.heap[l] > self.heap[i]:
largest = l
else:
largest = i
... | File "/tmp/tmpwti5o9f9/tmpmgh6m8tm.py", line 40
self.exchange(i)
IndentationError: unexpected indent
| |
s245387382 | p02289 | u126478680 | 1525855995 | Python | Python3 | py | Runtime Error | 0 | 0 | 1679 | class PriorityQueue():
def __init__(self):
self.heap = []
self.num_node = 0
def max_heapify(self, i):
l = (i+1)*2-1
r = (i+1)*2
largest = i
if l < self.num_node and self.heap[l] > self.heap[i]:
largest = l
else:
largest = i
... | File "/tmp/tmpjef0w88i/tmpv0ggveob.py", line 40
self.exchange(i)
IndentationError: unexpected indent
| |
s040756571 | p02289 | u269391636 | 1526898206 | Python | Python3 | py | Runtime Error | 0 | 0 | 170 | a = []
while(True):
x = input().split()
if x[0] == "end":
quit()
elif x[0] == "insert":
a.append(x[1])
a.sort(reversed = True)
else:
print(a[0])
del(a[0])
| Traceback (most recent call last):
File "/tmp/tmpnnoc63i5/tmpdixekchs.py", line 3, in <module>
x = input().split()
^^^^^^^
EOFError: EOF when reading a line
| |
s549721304 | p02289 | u684241248 | 1528521521 | Python | Python3 | py | Runtime Error | 0 | 0 | 1315 | # -*- coding: utf-8 -*-
INF = -10**10
queue = [-1]
def insert(queue, key):
h = len(queue) - 1
queue.append(INF)
heap_increase_key(queue, h + 1, key)
def heap_increase_key(queue, i, key):
if key < queue[i]:
raise ValueError('The new key is smaller than the present key')
queue[i] = key
... | ||
s976379575 | p02289 | u782850731 | 1380230153 | Python | Python | py | Runtime Error | 0 | 0 | 1409 | #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, maxint
from array import array
MININT = -1 - maxint
def max_heapify(a, i, heap_size):
L = 2*i
R = 2*i + 1
if L <= heap_size and a[L] > a[i]:
largest = L
else:
largest = i
if R <= heap_size... | Traceback (most recent call last):
File "/tmp/tmp66saqzsa/tmpinkvhdth.py", line 3, in <module>
from sys import stdin, maxint
ImportError: cannot import name 'maxint' from 'sys' (unknown location)
| |
s967195321 | p02290 | u540744789 | 1426163250 | Python | Python | py | Runtime Error | 20 | 4316 | 772 | x1,y1,x2,y2=map(float,raw_input().split(" "))
if y1==y2 or x1==x2:
if y1==y2:
t0=0
if x1==x2:
t1=0
else:
t0=(y2-y1)/(x2-x1)
b0=y1-t0*x1
t1=-(x2-x1)/(y2-y1)
for i in xrange(int(raw_input())):
px,py=map(float,raw_input().split(" "))
if t0==0 or t1==0:
if t0==0:
... | File "/tmp/tmpylmm8omb/tmpjy7wnnsh.py", line 36
print "{0:.10f} {1:.10f}".format(kouten_x,kouten_y)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s923946035 | p02290 | u988834390 | 1502884545 | Python | Python3 | py | Runtime Error | 0 | 0 | 349 |
points=[]
points=int(input().split())
p1,q1,p2,q2=points[0:3]
def search_x(x,y):
return ((q2-q1)*x+q1*((q2-q1)*(q2-q1))/(p2-p1))/((q2-q1)*(q2-q1)/(p2-p1)+(p2-p1))
n=int(input())
for i in range(n):
point=[]
point=int(input().split())
x=search_x(point[0],point[1])
y=(x-q1)*(q2-q1)/(p2-p1)-q1
pr... | Traceback (most recent call last):
File "/tmp/tmpj0i0c7ao/tmpke670xte.py", line 3, in <module>
points=int(input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s853389965 | p02290 | u988834390 | 1502884622 | Python | Python3 | py | Runtime Error | 0 | 0 | 290 |
points=[]
points=int(input().split())
p1,q1,p2,q2=points[0:3]
n=int(input())
for i in range(n):
point=[]
point=int(input().split())
x=((q2-q1)*x+q1*((q2-q1)*(q2-q1))/(p2-p1))/((q2-q1)*(q2-q1)/(p2-p1)+(p2-p1))
y=(x-q1)*(q2-q1)/(p2-p1)-q1
print('{} {}'.format(x,y))
| Traceback (most recent call last):
File "/tmp/tmpg5qqdi77/tmphx_tial_.py", line 3, in <module>
points=int(input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s290150229 | p02290 | u126478680 | 1526238441 | Python | Python3 | py | Runtime Error | 20 | 5684 | 900 | import math
class Point():
def __init__(self, x=None, y=None):
self.x = x
self.y = y
class Vector():
def __init__(self, x, y):
self.x = x
self.y = y
self.abs = math.sqrt(x*x + y*y)
def constant_multipled(self, c):
return Vector(self.x*c, self.y*c)
def ... | Traceback (most recent call last):
File "/tmp/tmpk72vrxge/tmp9_kpckwl.py", line 20, in <module>
x1, y1, x2, y2 = list(map(int, input().split(' ')))
^^^^^^^
EOFError: EOF when reading a line
| |
s030926130 | p02290 | u572424947 | 1376578382 | Python | Python | py | Runtime Error | 10 | 4296 | 725 | class Point():
def __init__(self, x, y):
self.x = x
self.y = y
output_list = []
init_point = map(float, raw_input().split())
p0 = Point(init_point[0], init_point[1])
p1 = Point(init_point[2], init_point[3])
q = int(raw_input())
datalist = [map(float, raw_input().split()) for i in range(q)]
#p0--p1 : y=ax... | File "/tmp/tmpue3hgqui/tmppj7ypvuo.py", line 45
print "%.10f %.10f" % (x, y)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s355148711 | p02291 | u988834390 | 1502885083 | Python | Python3 | py | Runtime Error | 0 | 0 | 721 | """
p1p2: (y-y1)(x2-x1)=(x-x1)(y2-y1)
p vertical: (y2-y1)(y-py)+(x2-x1)(x-px)=0
y=(x-x1)(y2-y1)/(x2-x1)-y1
(y2-y1)((x-x1)(y2-y1)/(x2-x1)-y1-py)+(x2-x1)(x-px)=0
(x-x1)(y2-y1)^2/(x2-x1)+(y2-y1)(y1+py)+(x2-x1)x-(x2-x1)px=0
x((y2-y1)^2/(x2-x1)+(x2-x1))-x1((y2-y1)^2/(x2-x1)-(x2-x1)px=0
x=((x2-x1)... | Traceback (most recent call last):
File "/tmp/tmp8gk1uxq3/tmp83nmv_v_.py", line 12, in <module>
points=int(input().split())
^^^^^^^
EOFError: EOF when reading a line
| |
s217160128 | p02291 | u548155360 | 1529920481 | Python | Python3 | py | Runtime Error | 0 | 0 | 1078 | # coding=utf-8
import numpy as np
from math import sqrt
def vector_abs(vect):
return sqrt(sum([element**2 for element in vect]))
def direction_unit_vector(p_from, p_to):
d_vector = p_to - p_from
d_u_vector = d_vector/vector_abs(d_vector)
return d_u_vector
def projection(origin, line_from, line_to)... | Traceback (most recent call last):
File "/tmp/tmpjm9ur9ng/tmpnazmfnyw.py", line 31, in <module>
xy_list = np.array(list(map(int, input().split())))
^^^^^^^
EOFError: EOF when reading a line
| |
s243349467 | p02291 | u548155360 | 1529921156 | Python | Python3 | py | Runtime Error | 0 | 0 | 1419 | # coding=utf-8
from math import sqrt, fsum
def inner_product(vect1, vect2):
return math.fsum([(v1_el*v2_el) for v1_el, v2_el in zip(vect1, vect2)])
def vector_abs(vect):
return sqrt(sum([element**2 for element in vect]))
def direction_unit_vector(p_from, p_to):
d_vector = [(xt - xf) for xt, xf in zip(... | Traceback (most recent call last):
File "/tmp/tmpieen2igv/tmpn9g4a1od.py", line 35, in <module>
xy_list = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s683041859 | p02292 | u487861672 | 1551589956 | Python | Python3 | py | Runtime Error | 60 | 7300 | 6212 | #! /usr/bin/env python3
from typing import List, Tuple
from math import sqrt
from enum import Enum
EPS = 1e-10
def float_equal(x: float, y: float) -> bool:
return abs(x - y) < EPS
class PointLocation(Enum):
COUNTER_CLOCKWISE = 1
CLOCKWISE = 2
ONLINE_BACK = 3
ONLINE_FRONT = 4
ON_SEGMENT = 5... | Traceback (most recent call last):
File "/tmp/tmpj8fix9wd/tmpi3m_6u32.py", line 216, in <module>
main()
File "/tmp/tmpj8fix9wd/tmpi3m_6u32.py", line 206, in main
x0, y0, x1, y1 = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s810354808 | p02292 | u487861672 | 1551590028 | Python | Python3 | py | Runtime Error | 60 | 7304 | 6211 | #! /usr/bin/env python3
from typing import List, Tuple
from math import sqrt
from enum import Enum
EPS = 1e-10
def float_equal(x: float, y: float) -> bool:
return abs(x - y) < EPS
class PointLocation(Enum):
COUNTER_CLOCKWISE = 1
CLOCKWISE = 2
ONLINE_BACK = 3
ONLINE_FRONT = 4
ON_SEGMENT = 5... | Traceback (most recent call last):
File "/tmp/tmp293htxvr/tmpdrmj3wa8.py", line 216, in <module>
main()
File "/tmp/tmp293htxvr/tmpdrmj3wa8.py", line 206, in main
x0, y0, x1, y1 = [int(x) for x in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s263924425 | p02292 | u548155360 | 1529922589 | Python | Python3 | py | Runtime Error | 20 | 5616 | 1249 | # coding=utf-8
def cross_product(vect1, vect2):
return vect1[0]*vect2[1] - vect1[1]*vect2[0]
def vector_plus(vect1, vect2):
return [el1 + el2 for el1, el2 in zip(vect1, vect2)]
def vector_minus(vect1, vect2):
return [el1 - el2 for el1, el2 in zip(vect1, vect2)]
def vector_product(vect1, vect2):
... | Traceback (most recent call last):
File "/tmp/tmp17bxr1uc/tmpzvisg8gg.py", line 44, in <module>
xy_list = list(map(int, input().split()))
^^^^^^^
EOFError: EOF when reading a line
| |
s632504868 | p02293 | u711765449 | 1485351517 | Python | Python3 | py | Runtime Error | 0 | 0 | 836 | n = int(input())
for i in range(n):
x0,y0,x1,y1,x2,y2,x3,y3 = map(float,input().split())
if x1 - x0 == 0:
if x3 -x2 == 0:
print('2')
elif y3 - y2 == 0:
print('1')
else:
print('0')
elif x3 - x2 == 0:
if y1 - y0 == 0:
print('1')
... | File "/tmp/tmpct0ejc52/tmpndnd48qs.py", line 24
elif x1 - x0 == 0:
^^^^
SyntaxError: invalid syntax
| |
s378277471 | p02293 | u988834390 | 1502886500 | Python | Python3 | py | Runtime Error | 0 | 0 | 277 |
points=[]
n=int(input())
points=input().split()
p0,q0,p1,q1,p2,q2,p3,q3=points
for i in range(n):
if (q1 - q0) * (p2 - p3) == (q2 - q3) * (p1 - p0):
print(2)
elif (q1 - q0) * (q2 - q3) + (p1 - p0) * (p2 - p3) == 1:
print(1)
else:
print(0) | Traceback (most recent call last):
File "/tmp/tmpqqs_f8rl/tmpukudp8eh.py", line 3, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s688728991 | p02294 | u279605379 | 1503550641 | Python | Python3 | py | Runtime Error | 0 | 0 | 1054 | class Line:
def __init__(self,p1,p2):
if p1[1] < p2[1]:self.s=p2;self.e=p1
elif p1[1] > p2[1]:self.s=p1;self.e=p2
else:
if p1[0] < p2[0]:self.s=p1;self.e=p2
else:self.s=p2;self.e=p1
def dot(a,b):return a[0]*b[0] + a[1]*b[1]
def cross(a,b):return a[0]*b[1] - a[1]*b[0]
... | Traceback (most recent call last):
File "/tmp/tmpohvzgcox/tmp4hovycyq.py", line 20, in <module>
q = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s558557702 | p02294 | u126478680 | 1527475610 | Python | Python3 | py | Runtime Error | 20 | 5672 | 1351 | import math
class Point():
def __init__(self, x, y):
self.x = x
self.y = y
class Segment():
def __init__(self, x1, y1, x2, y2):
self.p1 = Point(x1, y1)
self.p2 = Point(x2, y2)
self.slope = None
self.intersept = None
if self.p1.x == self.p2.x:
... | Traceback (most recent call last):
File "/tmp/tmptzf37tl7/tmp2rlts2wz.py", line 37, in <module>
q = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s443355786 | p02296 | u022407960 | 1480593150 | Python | Python3 | py | Runtime Error | 0 | 0 | 1421 | # !/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
4 5 1
0 1 2
0 2 3
1 2 -5
1 3 1
2 3 2
output:
INF
0
-5
-3
OR
input:
4 6 0
0 1 2
0 2 3
1 2 -5
1 3 1
2 3 2
3 1 0
output:
NEGATIVE CYCLE
"""
import sys
from math import isinf
def generate_adj_table(_v_info):
for each in _v_info:
source, target, co... | Traceback (most recent call last):
File "/tmp/tmpklinmrc1/tmplpbstd6r.py", line 64, in <module>
vertices, edges, root = map(int, _input[0].split())
~~~~~~^^^
IndexError: list index out of range
| |
s497723373 | p02296 | u279605379 | 1503627679 | Python | Python3 | py | Runtime Error | 0 | 0 | 2163 | class Line:
def __init__(self,p1,p2):
if p1[1] < p2[1]:self.s=p2;self.e=p1
elif p1[1] > p2[1]:self.s=p1;self.e=p2
else:
if p1[0] < p2[0]:self.s=p1;self.e=p2
else:self.s=p2;self.e=p1
def cross(a,b):return a[0]*b[1] - a[1]*b[0]
def dot(a,b):return a[0]*b[0]+a[1]*b[1]
d... | Traceback (most recent call last):
File "/tmp/tmpxzfik1pa/tmpyywdjsxk.py", line 40, in <module>
q = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s734971644 | p02297 | u279605379 | 1503643390 | Python | Python3 | py | Runtime Error | 0 | 0 | 222 | n = int(input())
P =[]
s = 0
for i in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for i in range(n):
a = P[i][0] ; b = P[i][1]; c = P[i+1][0] ; P[i+1][1]
s += a * d - b * c
print(abs(s)*0.5) | Traceback (most recent call last):
File "/tmp/tmp560cnt27/tmp1skca_u7.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s906876742 | p02297 | u279605379 | 1503643720 | Python | Python3 | py | Runtime Error | 0 | 0 | 245 | n = int(input())
P =[]
s = 0
x0,y0 = [int(i) for i in input().split()]
for i in range(n):
x,y = [int(i) for i in input().split()]
P.append([x-x0,y-y0])
for i in range(n-2):
s += P[i][0]*P[i+1][1] - P[i][1]*P[i+1][0]
print(abs(s)*0.5) | Traceback (most recent call last):
File "/tmp/tmpv9s6e2j_/tmp48v47py6.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s096938662 | p02297 | u279605379 | 1503644545 | Python | Python3 | py | Runtime Error | 0 | 0 | 186 | n = int(input())
P =[]
s = 0
x,y =
for _ in range(n):P.append([int(i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5) | File "/tmp/tmpjjqkkwpe/tmpupiwa8uc.py", line 4
x,y =
^
SyntaxError: invalid syntax
| |
s239468209 | p02297 | u279605379 | 1503646038 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | n = int(input())
P =[]
s = 0
for _ in range(n):P.append([int(-i) for i in input().split()])
P.append(P[0])
for j in range(n):s += P[j][1]*P[j+1][0] - P[j][0] * P[j+1][1]
print(s*0.5) | Traceback (most recent call last):
File "/tmp/tmpkzgto_am/tmp0gxf6lkx.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s608355396 | p02297 | u279605379 | 1503646346 | Python | Python3 | py | Runtime Error | 0 | 0 | 166 | n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P += [int(i) for i in input().split()]
P+=P[0]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5) | Traceback (most recent call last):
File "/tmp/tmpn3hu61oi/tmpmtjd8t5f.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s469875526 | p02297 | u279605379 | 1503646429 | Python | Python3 | py | Runtime Error | 0 | 0 | 168 | n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=P[0]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5) | Traceback (most recent call last):
File "/tmp/tmpj6ft9_33/tmpzmtliem1.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s063086391 | p02297 | u279605379 | 1503646481 | Python | Python3 | py | Runtime Error | 0 | 0 | 171 | n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P.append([int(i) for i in input().split()])
P+=P[0]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5) | Traceback (most recent call last):
File "/tmp/tmpn1fl3c8_/tmp13snj927.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s841716791 | p02297 | u279605379 | 1503646597 | Python | Python3 | py | Runtime Error | 0 | 0 | 168 | n = int(input())
x = range(n)
P =[]
s = 0
for _ in x:P += [[int(i) for i in input().split()]]
P+=P[0]
for j in x:s += P[j][0]*P[j+1][1] - P[j][1]*P[j+1][0]
print(s*0.5) | Traceback (most recent call last):
File "/tmp/tmpgal92wzi/tmpq6edxmhs.py", line 1, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s199495014 | p02297 | u279605379 | 1503648021 | Python | Python3 | py | Runtime Error | 0 | 0 | 153 | x=range(int(input()))
P=[]
_=0
for _ in x:P+=[[int(i) for i in input().split()]]
P+=[P[0]]
for j in x:s+=P[j][0]*P[j+1][1]-P[j][1]*P[j+1][0]
print(s*0.5) | Traceback (most recent call last):
File "/tmp/tmpwnmd4r9_/tmpq_5ybagx.py", line 1, in <module>
x=range(int(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s421786670 | p02297 | u279605379 | 1503649688 | Python | Python3 | py | Runtime Error | 0 | 0 | 186 | x=range(int(input()))
f=lambda a,b,c,d : a*d - b*c
P=[]
for _ in x:P+=[[int(i) for i in input().split()]]
_=0
P+=[P[0]]
for j in x:_+=f(P[j][0],P[j][1],,P[j+1][0]P[j+1][1])
print(_*0.5) | File "/tmp/tmpkqv9wfnw/tmp3ddkgwbu.py", line 7
for j in x:_+=f(P[j][0],P[j][1],,P[j+1][0]P[j+1][1])
^
SyntaxError: invalid syntax
| |
s369091115 | p02298 | u279605379 | 1503973949 | Python | Python3 | py | Runtime Error | 0 | 0 | 273 | def cross(a,b):return a[0]*b[1] - a[1]*b[0]
def dif(a,b):return [x-y for x,y in zip(a,b)]
x = range(int(input()))
t = 1
P,Q = [],[]
for _ in x:P+=[[int(i) for i in input().split()]]
for i in x:Q+=[dif(P[i],P[i-1])]
for i in x:if cross(Q[i-1],Q[i]) < 0: t *= False
print(t) | File "/tmp/tmp_547p8y_/tmphuirh39a.py", line 9
for i in x:if cross(Q[i-1],Q[i]) < 0: t *= False
^^
SyntaxError: invalid syntax
| |
s066412379 | p02300 | u022407960 | 1480734769 | Python | Python3 | py | Runtime Error | 0 | 0 | 2007 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
input:
7
2 1
0 0
1 2
2 2
4 2
1 3
3 3
output:
5
0 0
2 1
4 2
3 3
1 3
"""
import sys
from operator import attrgetter
EPS = 1e-9
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def check_ccw... | Traceback (most recent call last):
File "/tmp/tmpftdv02ny/tmplnxylnkm.py", line 92, in <module>
points = int(_input[0])
~~~~~~^^^
IndexError: list index out of range
| |
s699744478 | p02300 | u279605379 | 1504489964 | Python | Python3 | py | Runtime Error | 0 | 0 | 1125 | from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
... | Traceback (most recent call last):
File "/tmp/tmpkavuzh8f/tmpejejlwd7.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s204205963 | p02300 | u279605379 | 1504490065 | Python | Python3 | py | Runtime Error | 0 | 0 | 1125 | #CGL_4-A Convex Polygon - Convex Hull
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],... | Traceback (most recent call last):
File "/tmp/tmp4w8c0_hq/tmp54nqqqa9.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s994966776 | p02300 | u279605379 | 1504490231 | Python | Python3 | py | Runtime Error | 0 | 0 | 1130 | from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
... | Traceback (most recent call last):
File "/tmp/tmpt6o894df/tmpcto1go9u.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s131088327 | p02300 | u279605379 | 1504490493 | Python | Python3 | py | Runtime Error | 0 | 0 | 1105 | from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
phU = [P[0],P[1]]
for p in P[2:]:... | Traceback (most recent call last):
File "/tmp/tmpa2tkl74j/tmpkjdeohn4.py", line 36, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s002084068 | p02300 | u279605379 | 1504490671 | Python | Python3 | py | Runtime Error | 0 | 0 | 1101 | import heapq
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
for p in P[2:]... | Traceback (most recent call last):
File "/tmp/tmpilsll0m5/tmpx_gvzq38.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s286781274 | p02300 | u279605379 | 1504490895 | Python | Python3 | py | Runtime Error | 0 | 0 | 1137 | from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = deque([P[0],P... | Traceback (most recent call last):
File "/tmp/tmpxzq1tq1r/tmpkimdsfu_.py", line 37, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s766811066 | p02300 | u279605379 | 1504490998 | Python | Python3 | py | Runtime Error | 0 | 0 | 1167 | from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = deque(P[0],P[... | Traceback (most recent call last):
File "/tmp/tmpkjavqve3/tmpf958gfun.py", line 39, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s516087077 | p02300 | u279605379 | 1504491892 | Python | Python3 | py | Runtime Error | 0 | 0 | 1197 | from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
P = sorted(P)
phU = deque([])
... | Traceback (most recent call last):
File "/tmp/tmpd_zkf8ey/tmpcof3ucoe.py", line 43, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s516750710 | p02300 | u279605379 | 1504491970 | Python | Python3 | py | Runtime Error | 0 | 0 | 1235 | #CGL_4-A Convex Polygon - Convex Hull
from collections import deque
def isCLKWISE(ph):
a = [ph[-1][0]-ph[-3][0],ph[-1][1]-ph[-3][1]]
b = [ph[-2][0]-ph[-3][0],ph[-2][1]-ph[-3][1]]
crs = a[0]*b[1] - a[1]*b[0]
if crs < 0 :
return False
else :
return True
def ConvexHullScan(P):
... | Traceback (most recent call last):
File "/tmp/tmpdmuvqb3v/tmprgirm_9j.py", line 44, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s042271882 | p02300 | u279605379 | 1504493544 | Python | Python3 | py | Runtime Error | 0 | 0 | 956 | import sys
def isCLKWISE(ph):
if (ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0 : return False
else : return True
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
for p in P[2:]:
phU.append(p)
while(True):
... | Traceback (most recent call last):
File "/tmp/tmpxv7gmsbh/tmpk2bxbjl7.py", line 29, in <module>
n = int(input[0])
~~~~~^^^
IndexError: list index out of range
| |
s840246335 | p02300 | u279605379 | 1504493687 | Python | Python3 | py | Runtime Error | 0 | 0 | 958 | import sys
def isCLKWISE(ph):
if (ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0 : return False
else : return True
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
for p in P[2:]:
phU.append(p)
while(True):
... | Traceback (most recent call last):
File "/tmp/tmpijzw__9r/tmprzl0bocn.py", line 29, in <module>
n = int(_input[0])
~~~~~~^^^
IndexError: list index out of range
| |
s014657536 | p02300 | u279605379 | 1504498077 | Python | Python3 | py | Runtime Error | 0 | 0 | 913 | def isCLKWISE(ph):
return ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) >= 0
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
for p in P[2:]:
phU.append(p)
while(True):
if isCLKWISE(phU) : break
... | File "/tmp/tmpk6ihnycb/tmp8n91231g.py", line 2
return ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) >= 0
^
SyntaxError: unmatched ')'
| |
s114454075 | p02300 | u279605379 | 1504498377 | Python | Python3 | py | Runtime Error | 0 | 0 | 912 | def isCLKWISE(ph):
return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
def ConvexHullScan(P):
P.sort()
phU = [P[0],P[1]]
for p in P[2:]:
phU.append(p)
while(True):
if isCLKWISE(phU) : break
... | Traceback (most recent call last):
File "/tmp/tmp5_6yt86y/tmpc2ft05k6.py", line 25, in <module>
n = range(int(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s078657193 | p02300 | u279605379 | 1504498733 | Python | Python3 | py | Runtime Error | 0 | 0 | 943 | from collections import deque
def isCLKWISE(ph):
return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
for p in P[2:]:
phU.append(p)
while(True):
i... | Traceback (most recent call last):
File "/tmp/tmpi3j_p42j/tmp1kbo_c8f.py", line 27, in <module>
n = range(int(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s043546654 | p02300 | u279605379 | 1504498778 | Python | Python3 | py | Runtime Error | 0 | 0 | 939 | from collections import deque
def isCLKWISE(ph):
return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
def ConvexHullScan(P):
P = sorted(P)
phU = [P[0],P[1]]
for p in P[2:]:
phU.append(p)
while(True):
i... | Traceback (most recent call last):
File "/tmp/tmpw01bsy3e/tmpvfhw7rkx.py", line 27, in <module>
n = range(int(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s420149968 | p02300 | u279605379 | 1504501572 | Python | Python3 | py | Runtime Error | 0 | 0 | 891 | def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
def ConvexHullScan(P) :
P = sorted(P)
phU = []
phU.append(P[0])
phU.append(P[1])
for p in P[2:] :
phU.append(p)
if isCLKWISE(phU) : continue
while(True):
del p... | Traceback (most recent call last):
File "/tmp/tmpfrwn3ai6/tmpk33zm93p.py", line 32, in <module>
n = range(int(input()))
^^^^^^^
EOFError: EOF when reading a line
| |
s940070028 | p02300 | u279605379 | 1504501752 | Python | Python3 | py | Runtime Error | 0 | 0 | 899 | def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
def ConvexHullScan(P) :
P = sorted(P)
phU = []
phU.append(P[0])
phU.append(P[1])
for p in P[2:] :
phU.append(p)
if isCLKWISE(phU) : continue
while(True)???:
de... | File "/tmp/tmpt1hfvr2e/tmpxh97r9q2.py", line 11
while(True)???:
^
SyntaxError: invalid syntax
| |
s966678289 | p02300 | u279605379 | 1504501778 | Python | Python3 | py | Runtime Error | 0 | 0 | 938 | #sort ??§??????????????????????????????
def isCLKWISE(ph) : return not ((ph[-1][0] - ph[-3][0])*(- ph[-3][1] + ph[-2][1]) - (ph[-2][0] - ph[-3][0])*(- ph[-3][1] + ph[-1][1] ) < 0)
def ConvexHullScan(P) :
P = sorted(P)
phU = []
phU.append(P[0])
phU.append(P[1])
for p in P[2:] :
phU.append(p)
if isCLKWISE... | File "/tmp/tmpiik9f6f6/tmpkcpo39a5.py", line 14
try???:
^
SyntaxError: expected ':'
| |
s828181379 | p02300 | u559070407 | 1515975366 | Python | Python3 | py | Runtime Error | 0 | 0 | 1315 | # O(NlgN) time
# build lower hull and upper hull in clockwise, concatenate them get convex hull
def convexHull(points):
assert len(points) > 0
points = sorted(set(points))
# build lower hull
lower = []
for p in points:
# cross(o, a, b) <= 0 not clockwise
while len(lower) >= 2 and cross(lower[-2], ... | Traceback (most recent call last):
File "/tmp/tmp6s66gxw8/tmpsimswinl.py", line 42, in <module>
_input = sys.stdin.readlines()
^^^
NameError: name 'sys' is not defined
| |
s268940821 | p02301 | u072053884 | 1492579255 | Python | Python3 | py | Runtime Error | 40 | 8188 | 1102 | # Cross product
def cross(p1, p2, q1, q2):
p = p2 - p1
q = q2 - q1
return p.real * q.imag - p.imag * q.real
# Rotating calipers
def convex_diameter(points, n):
points.append(points[0])
p0 = points[0]
p1 = points[1]
for i, (q1, q2) in enumerate(zip(points[1:], points[2:]), start=1):
... | Traceback (most recent call last):
File "/tmp/tmpy90kt1_v/tmpjv3hzk_h.py", line 42, in <module>
n = int(file_input.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s083174513 | p02301 | u072053884 | 1492580173 | Python | Python3 | py | Runtime Error | 60 | 8276 | 1101 | # Cross product
def cross(p1, p2, q1, q2):
p = p2 - p1
q = q2 - q1
return p.real * q.imag - p.imag * q.real
# Rotating calipers
def convex_diameter(points, n):
points.append(points[0])
p0 = points[0]
p1 = points[1]
for i, (q1, q2) in enumerate(zip(points[1:], points[2:]), start=1):
... | Traceback (most recent call last):
File "/tmp/tmpk9uvhm1f/tmpzc12ecel.py", line 42, in <module>
n = int(file_input.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s114305041 | p02301 | u260980560 | 1499962573 | Python | Python3 | py | Runtime Error | 0 | 0 | 1578 | from math import sqrt
# ??????
def cross(P0, P1, P2):
x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
x1 -= x0; x2 -= x0
y1 -= y0; y2 -= y0
return x1*y2 - x2*y1
# ??????
def dot(P0, P1, P2):
x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
x1 -= x0; x2 -= x0
y1 -= y0; y2 -= y0
return x1*x2 + y1*y2
# 2????... | Traceback (most recent call last):
File "/tmp/tmp735t3vod/tmpbhm3l3fg.py", line 65, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s054255167 | p02301 | u260980560 | 1499962788 | Python | Python3 | py | Runtime Error | 0 | 0 | 1469 | from math import sqrt
def cross(P0, P1, P2):
x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
x1 -= x0; x2 -= x0
y1 -= y0; y2 -= y0
return x1*y2 - x2*y1
def dot(P0, P1, P2):
x0, y0 = P0; x1, y1 = P1; x2, y2 = P2
x1 -= x0; x2 -= x0
y1 -= y0; y2 -= y0
return x1*x2 + y1*y2
def dist2(P0, P1):
x0... | Traceback (most recent call last):
File "/tmp/tmptngc282d/tmpwm78y5cv.py", line 59, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s814248362 | p02302 | u567380442 | 1428742800 | Python | Python3 | py | Runtime Error | 0 | 0 | 1727 | from sys import stdin
readline = stdin.readline
from enum import Enum
direction = Enum('direction', 'CCW CW CAB ABC ACB')
class vector:
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def ccw(a, b, c):
b -= a
... | Traceback (most recent call last):
File "/tmp/tmpcbgae94t/tmpps6va8th.py", line 64, in <module>
main()
File "/tmp/tmpcbgae94t/tmpps6va8th.py", line 43, in main
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s673194337 | p02302 | u567380442 | 1428743094 | Python | Python3 | py | Runtime Error | 0 | 0 | 1748 | from sys import stdin
readline = stdin.readline
from enum import Enum
direction = Enum('direction', 'CCW CW CAB ABC ACB')
class vector:
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def ccw(a, b, c):
b -= a
... | Traceback (most recent call last):
File "/tmp/tmpzk8c3gid/tmp52880awd.py", line 64, in <module>
main()
File "/tmp/tmpzk8c3gid/tmp52880awd.py", line 43, in main
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s912846154 | p02302 | u567380442 | 1428749083 | Python | Python3 | py | Runtime Error | 0 | 0 | 1792 | from sys import stdin
readline = stdin.readline
from enum import Enum
direction = Enum('direction', 'CCW CW CAB ABC ACB')
class vector:
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def ccw(a, b, c):
b -= a
... | Traceback (most recent call last):
File "/tmp/tmpzkq_2gqe/tmpnip3m6ce.py", line 66, in <module>
main()
File "/tmp/tmpzkq_2gqe/tmpnip3m6ce.py", line 45, in main
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s520636952 | p02302 | u567380442 | 1428749547 | Python | Python3 | py | Runtime Error | 0 | 0 | 1785 | from sys import stdin
readline = stdin.readline
from enum import Enum
direction = Enum('direction', 'CCW CW CAB ABC ACB')
class vector:
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def ccw(a, b, c):
b -= a
... | Traceback (most recent call last):
File "/tmp/tmpf7003sd6/tmp3jsues7i.py", line 66, in <module>
main()
File "/tmp/tmpf7003sd6/tmp3jsues7i.py", line 45, in main
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s851294381 | p02302 | u567380442 | 1428749931 | Python | Python3 | py | Runtime Error | 0 | 0 | 1831 | from sys import stdin
readline = stdin.readline
from enum import Enum
direction = Enum('direction', 'CCW CW CAB ABC ACB')
class vector:
def cross(a, b):
return a.real * b.imag - a.imag * b.real
def dot(a, b):
return a.real * b.real + a.imag * b.imag
def ccw(a, b, c):
b -= a
... | Traceback (most recent call last):
File "/tmp/tmp9bddokmp/tmpogokf7hi.py", line 68, in <module>
main()
File "/tmp/tmp9bddokmp/tmpogokf7hi.py", line 47, in main
n = int(readline())
^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s081566786 | p02302 | u260980560 | 1467437882 | Python | Python | py | Runtime Error | 10 | 6484 | 1041 | n = input()
ps = [map(int, raw_input().split()) for i in xrange(n)]
def intersection(p1, p2, q1, q2):
dx0 = p2[0] - p1[0]
dy0 = p2[1] - p1[1]
dx1 = q2[0] - q1[0]
dy1 = q2[1] - q1[1]
a = dy0*dx1; b = dy1*dx0; c = dx0*dx1; d = dy0*dy1
if a == b: return None
x = (a*p1[0] - b*q1[0] + c*(q1[1] - ... | File "/tmp/tmpzy2sdh2e/tmpd_v30aa8.py", line 29
print "%.09f" % calc_area(vs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s907422917 | p02302 | u797673668 | 1473068673 | Python | Python3 | py | Runtime Error | 20 | 7832 | 1017 | def cross(a, b):
return a.real * b.imag - a.imag * b.real
def cross_point(c, d):
l = d - c
v1 = cross(lv, l)
v2 = cross(lv, lt - c)
return c + v2 / v1 * l
n = int(input())
points = [complex(*map(int, input().split())) for _ in range(n)]
point0 = points.pop(0)
points.append(point0)
q = int(input... | Traceback (most recent call last):
File "/tmp/tmpgq0d5_bo/tmpnqginh4l.py", line 12, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s440759152 | p02302 | u072053884 | 1493205490 | Python | Python3 | py | Runtime Error | 30 | 7776 | 1963 | # cross point
def cross(c1, c2):
return c1.real * c2.imag - c1.imag * c2.real
def cross_point(p1, p2, p3, p4):
# p1 and p2 are points on a segment.
# p3 and p4 are points on the other segment.
base = p4 - p3
hypo1 = p1 - p3
hypo2 = p2 - p3
d1 = cross(base, hypo1) / abs(base)
d2 = cross... | Traceback (most recent call last):
File "/tmp/tmpoh9903ra/tmp_47eahxb.py", line 53, in <module>
n = int(file_input.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s393985228 | p02303 | u567380442 | 1428802533 | Python | Python3 | py | Runtime Error | 0 | 0 | 818 | from sys import stdin
readline = stdin.readline
import operator
def norm(self):
return abs(self)
def closest_pair(p):
m = 0
p.sort(key=operator.attrgetter('real'))
d = float('inf')
for i in range(1, len(p)):
for j in reversed(range(m, i)):
tmp = abs(p[j] - p[i])
i... | Traceback (most recent call last):
File "/tmp/tmpydaao27i/tmpheykmqsc.py", line 30, in <module>
@profile
^^^^^^^
NameError: name 'profile' is not defined
| |
s877197473 | p02303 | u567380442 | 1428803134 | Python | Python3 | py | Runtime Error | 0 | 0 | 839 | from sys import stdin
import operator
readline = stdin.readline
def norm(self):
return abs(self)
def closest_pair(p):
m = 0
p.sort(key=operator.attrgetter('real'))
d = float('inf')
for i in range(1, len(p)):
for j in reversed(range(m, i)):
tmp = p[i] - p[j]
if d <... | Traceback (most recent call last):
File "/tmp/tmpjvjtfyyd/tmpv4p0b60d.py", line 33, in <module>
@profile
^^^^^^^
NameError: name 'profile' is not defined
| |
s095914161 | p02303 | u657035709 | 1435966997 | Python | Python | py | Runtime Error | 20 | 4604 | 3665 | # #### CLOSEST PAIR O(N LOG N) ALGORITHM #### #
# points should be unique, otherwise the closest pair would be the repeated points
# also this will only find 1 pair with the smallest distance, in case there are multiple pairs with this same minimum distance
#import time
#start = time.time()
def halve(coord): # spli... | File "/tmp/tmp8u55yb1l/tmpcvbt2w0n.py", line 110
print dist(res[0][0], res[0][1]) ** 0.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s705593661 | p02303 | u657035709 | 1435967283 | Python | Python | py | Runtime Error | 30 | 4604 | 3743 | # #### CLOSEST PAIR O(N LOG N) ALGORITHM #### #
# points should be unique, otherwise the closest pair would be the repeated points
# also this will only find 1 pair with the smallest distance, in case there are multiple pairs with this same minimum distance
#import time
#start = time.time()
def halve(coord): # spli... | File "/tmp/tmpikfy_dds/tmpj9jm005i.py", line 110
print dist(res[0][0], res[0][1]) ** 0.5
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s953797478 | p02303 | u072053884 | 1492011599 | Python | Python3 | py | Runtime Error | 30 | 7664 | 2201 | import itertools
def _get_min_distance(points):
min_d = 400
for p1, p2 in itertools.combinations(points, 2):
min_d = min(min_d, abs(p1 - p2))
return min_d
# Search based on x axis
def closest_pair_distance_x(points):
n = len(points)
if n <= 3:
return _get_min_distance(points)
e... | Traceback (most recent call last):
File "/tmp/tmpuv4b0cmq/tmp8eef86r6.py", line 64, in <module>
n = int(file_input.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: ''
| |
s128007785 | p02303 | u797673668 | 1492589378 | Python | Python3 | py | Runtime Error | 20 | 7816 | 882 | from operator import attrgetter
from itertools import combinations
keys = [attrgetter('real'), attrgetter('imag')]
def solve(points, axis):
l = len(points)
if l < 20:
return min(abs(p2 - p1) for p1, p2 in combinations(points, 2))
m = n // 2
pl, pr = points[:m], points[m:]
key, rkey = keys... | Traceback (most recent call last):
File "/tmp/tmpou_kdcsq/tmpr5zutv1h.py", line 29, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s401015495 | p02303 | u797673668 | 1492589429 | Python | Python3 | py | Runtime Error | 30 | 7756 | 924 | import sys
sys.setrecursionlimit(10000)
from operator import attrgetter
from itertools import combinations
keys = [attrgetter('real'), attrgetter('imag')]
def solve(points, axis):
l = len(points)
if l < 20:
return min(abs(p2 - p1) for p1, p2 in combinations(points, 2))
m = n // 2
pl, pr = p... | Traceback (most recent call last):
File "/tmp/tmpdwcnuslv/tmp3008ltvm.py", line 33, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s586227548 | p02303 | u928329738 | 1512309233 | Python | Python3 | py | Runtime Error | 0 | 0 | 310 | import numpy as np
n = int(input())
p = []
for i in range(n):
p.append(tuple(map(float,input().split())))
d = []
min = 999999999999
for i in range(n-1):
for j in range(i+1,n):
a = ((p[j][0]-p[i][0])**2+(p[j][1]-p[i][1])**2)
if a < min:
min = a
print(round(np.sqrt(min),11)) | Traceback (most recent call last):
File "/tmp/tmpsjjwsa2b/tmpc9hu524d.py", line 2, in <module>
n = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s365542492 | p02304 | u629780968 | 1546487871 | Python | Python3 | py | Runtime Error | 40 | 6348 | 3367 | from enum import IntEnum
class Action(IntEnum):
ADD = 1
SEARCH = 2
REMOVE = 3
class Color(IntEnum):
BLACK=0
RED=1
@staticmethod
def flip(c):
return [Color.RED,Color.BLACK][c.value]
class Node:
__slots__ = ('value','left','right','color','valid')
def __init__(self,value):
self.value=value
... | Traceback (most recent call last):
File "/tmp/tmpg896kvhl/tmpks_0oual.py", line 150, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s438916365 | p02304 | u011621222 | 1526486091 | Python | Python3 | py | Runtime Error | 0 | 0 | 3155 | lass AvlTree(BinarySearchTree):
'''An extension t the BinarySearchTree data structure which
strives to keep itself balanced '''
def _put(self,key,val,currentNode):
if key < currentNode.key:
if current.Node.hasLeftChild():
self._put(key,val,currentNode.leftChild)
... | File "/tmp/tmpxvp7fwhv/tmpzbvhux0v.py", line 1
lass AvlTree(BinarySearchTree):
^^^^^^^
SyntaxError: invalid syntax
| |
s373101074 | p02305 | u265136581 | 1523264165 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 |
cx1, cy1, r1 = map(float, raw_input().split())
cx2, cy2, r2 = map(float, raw_input().split())
import math
distance = math.sqrt( math.pow(cx1-cx2, 2) + math.pow(cy1-cy2, 2) )
rsum = r1 + r2
rmax = math.max(r1, r2)
rmin = math.min(r1, r2)
import sys
if distance > rsum:
print(4)
elif abs(distance - rsum) < sys.float_... | Traceback (most recent call last):
File "/tmp/tmp_fnpi9d3/tmpiltmbjbq.py", line 2, in <module>
cx1, cy1, r1 = map(float, raw_input().split())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s216292788 | p02305 | u825008385 | 1523809516 | Python | Python3 | py | Runtime Error | 0 | 0 | 3819 | # Single Source Shortest Path
class node():
def __init__(self, v, cost):
self.v = v
self.cost = cost
infty = 999999999
dict_c = {}
[vertex, edge, r] = list(map(int, input("").split()))
root_c = [node(r, 0)]
final_c = [infty for i in range(vertex)]
final_c[r] = 0
for i in range(edge):
[e1, e2, ... | Traceback (most recent call last):
File "/tmp/tmpoehahfch/tmprpm9g7di.py", line 9, in <module>
[vertex, edge, r] = list(map(int, input("").split()))
^^^^^^^^^
EOFError: EOF when reading a line
| |
s888419766 | p02305 | u893844544 | 1523843446 | Python | Python3 | py | Runtime Error | 0 | 0 | 290 | c1x,c1y,c1r = [int(i) for i in input().split()]
c2x,c2y,c2r = [int(i) for i in input().split()]
d = math.sqrt(pow(c1x-c2x, 2) + pow(c1y-c2y, 2))
s = c1r + c2r
if d > s:
print 4
else if d == c:
print 3
else if d > 2*s:
print 2
else if d == 2*s:
print 1
else:
print 0
| File "/tmp/tmpt2wn5k48/tmpili22orh.py", line 9
print 4
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s208727312 | p02305 | u893844544 | 1523843610 | Python | Python3 | py | Runtime Error | 0 | 0 | 295 | c1x,c1y,c1r = [int(i) for i in input().split()]
c2x,c2y,c2r = [int(i) for i in input().split()]
d = math.sqrt(pow(c1x-c2x, 2) + pow(c1y-c2y, 2))
s = c1r + c2r
if d > s:
print(4)
else if d == c:
print(3)
else if d > 2*s:
print(2)
else if d == 2*s:
print(1)
else:
print(0)
| File "/tmp/tmp99oo27oa/tmpvehiw6d8.py", line 10
else if d == c:
^^
SyntaxError: expected ':'
| |
s570427412 | p02305 | u893844544 | 1523843659 | Python | Python3 | py | Runtime Error | 0 | 0 | 286 | c1x,c1y,c1r = [int(i) for i in input().split()]
c2x,c2y,c2r = [int(i) for i in input().split()]
d = math.sqrt(pow(c1x-c2x, 2) + pow(c1y-c2y, 2))
s = c1r + c2r
if d > s:
print(4)
elif d == c:
print(3)
elif d > 2*s:
print(2)
elif d == 2*s:
print(1)
else:
print(0)
| Traceback (most recent call last):
File "/tmp/tmpypmfzl5x/tmpj3ne68bz.py", line 1, in <module>
c1x,c1y,c1r = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
| |
s004096707 | p02305 | u893844544 | 1523843751 | Python | Python3 | py | Runtime Error | 20 | 5668 | 299 | import math
c1x,c1y,c1r = [int(i) for i in input().split()]
c2x,c2y,c2r = [int(i) for i in input().split()]
d = math.sqrt(pow(c1x-c2x, 2) + pow(c1y-c2y, 2))
s = c1r + c2r
if d > s:
print(4)
elif d == c:
print(3)
elif d > 2*s:
print(2)
elif d == 2*s:
print(1)
else:
print(0)
| Traceback (most recent call last):
File "/tmp/tmp6hf07r_f/tmpn8kvyx5y.py", line 3, in <module>
c1x,c1y,c1r = [int(i) for i in input().split()]
^^^^^^^
EOFError: EOF when reading a line
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.