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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s676750762 | p00010 | u069727578 | 1520044246 | Python | Python3 | py | Runtime Error | 0 | 0 | 368 | from math import sqrt
n=input()
for i in range(n):
x1,y1,x2,y2,x3,y3=map(float,raw_input().split())
A1=2*(x2-x1)
B1=2*(y2-y1)
C1=x2**2+y2**2-x1**2-y1**2
A2=2*(x3-x2)
B2=2*(y3-y2)
C2=x3**2+y3**2-x2**2-y2**2
x=(C1*B2-C2*B1)/(A1*B2-A2*B1)
y=(A1*C2-A2*C1)/(A1*B2-A2*B1)
R=sqrt((x1-x)**2+(y1-y)**2)
print"%.3f %.3f %.3f"%(x,y,R)
| File "/tmp/tmpuvacxbr3/tmp1qnzxqab.py", line 14
print"%.3f %.3f %.3f"%(x,y,R)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s041780846 | p00010 | u646461156 | 1521024719 | Python | Python3 | py | Runtime Error | 0 | 0 | 404 | from math import sqrt
n=int(input())
for i in range(n):
x1,y1,x2,y2,x3,y3=map(int,input().split())
x4=((y1-y3)*(y1**2-y2**2+x1**2-x2**2)-(y1-y2)*(y1**2-y3**2+x1**2-x3**2))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3))
y4=((x1-x3)*(x1**2-x2**2+y1**2-x1**2)-(x1-x2)*(x1**2-x3**2+y1**2-y3**2))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3))
r=sqrt((x1-x4)**2+(y1-y4)**2);
print("{:.3f} {:.3f} {:.3f}".format(x4,y4,r))
| Traceback (most recent call last):
File "/tmp/tmpdnwyl8o3/tmpsls_qnwm.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s439207147 | p00010 | u646461156 | 1521024791 | Python | Python3 | py | Runtime Error | 0 | 0 | 395 | from math import hypot
n=int(input())
for i in range(n):
x1,y1,x2,y2,x3,y3=map(int,input().split())
x4=((y1-y3)*(y1**2-y2**2+x1**2-x2**2)-(y1-y2)*(y1**2-y3**2+x1**2-x3**2))/(2*(y1-y3)*(x1-x2)-2*(y1-y2)*(x1-x3))
y4=((x1-x3)*(x1**2-x2**2+y1**2-x1**2)-(x1-x2)*(x1**2-x3**2+y1**2-y3**2))/(2*(x1-x3)*(y1-y2)-2*(x1-x2)*(y1-y3))
r=hypot(x1-x4,y1-y4)
print("{:.3f} {:.3f} {:.3f}".format(x4,y4,r))
| Traceback (most recent call last):
File "/tmp/tmpmovp2equ/tmpk76opmf9.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s787344628 | p00010 | u166871988 | 1523697248 | Python | Python3 | py | Runtime Error | 0 | 0 | 226 | import math
while True:
t=input()
if t == "":break
l=t.split()
px=sum(l[0::2])/3
py=sum(l[1::2])/3
r=math.sqrt((l[0]-px)**2+(l[1]-py)**2)
print("{0} {1} {2}".format([round(i,3) for i in[px,py,r]]))
| Traceback (most recent call last):
File "/tmp/tmpyuleqmas/tmptqspmy0v.py", line 3, in <module>
t=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s390865087 | p00010 | u166871988 | 1523697468 | Python | Python3 | py | Runtime Error | 0 | 0 | 254 | import math
input()
while True:
t=input()
if t == "":break
l=[float(i) for i in t.split()]
px=sum(l[0::2])/3
py=sum(l[1::2])/3
r=math.sqrt((l[0]-px)**2+(l[1]-py)**2)
print("{0} {1} {2}".format([round(i,3) for i in[px,py,r]]))
| Traceback (most recent call last):
File "/tmp/tmpgvp7pd_3/tmprloqmc3x.py", line 2, in <module>
input()
EOFError: EOF when reading a line
| |
s085524056 | p00010 | u166871988 | 1523703669 | Python | Python3 | py | Runtime Error | 0 | 0 | 383 | import math
n=int(input())
for i in range(n):
x1,y1,x2,y2,x3,y3=[float(i) for i in input().split()]
t1=x1*(x2+x3-x1)+y1*(y2+y3-y1)
t2=x2*(x1+x3-x2)+y2*(y1+y3-y2)
t3=x3*(x1+x2-x3)+y3*(y1+y2-y3)
px=(t1*x1+t2*x2+t3*x3)/(t1+t2+t3)
py=(t1*y1+t2*y2+t3*y3)/(t1+t2+t3)
r=math.hypot(px-x1,py-y1)
print("{0} {1} {2}".format(round(px,3),round(py,3),round(r,3)))
| Traceback (most recent call last):
File "/tmp/tmpt_ru46fp/tmpfk3i19tj.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s435174264 | p00010 | u166871988 | 1523703758 | Python | Python3 | py | Runtime Error | 0 | 0 | 391 | import math
n=int(raw_input())
for i in range(n):
x1,y1,x2,y2,x3,y3=[float(i) for i in raw_input().split()]
t1=x1*(x2+x3-x1)+y1*(y2+y3-y1)
t2=x2*(x1+x3-x2)+y2*(y1+y3-y2)
t3=x3*(x1+x2-x3)+y3*(y1+y2-y3)
px=(t1*x1+t2*x2+t3*x3)/(t1+t2+t3)
py=(t1*y1+t2*y2+t3*y3)/(t1+t2+t3)
r=math.hypot(px-x1,py-y1)
print("{0} {1} {2}".format(round(px,3),round(py,3),round(r,3)))
| Traceback (most recent call last):
File "/tmp/tmps57i166_/tmpz3qws1h2.py", line 2, in <module>
n=int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s027469812 | p00010 | u166871988 | 1523703878 | Python | Python3 | py | Runtime Error | 0 | 0 | 374 | import math
n=int(input())
for i in range(n):
x1,y1,x2,y2,x3,y3=[float(i) for i in input().split()]
t1=x1*(x2+x3-x1)+y1*(y2+y3-y1)
t2=x2*(x1+x3-x2)+y2*(y1+y3-y2)
t3=x3*(x1+x2-x3)+y3*(y1+y2-y3)
px=(t1*x1+t2*x2+t3*x3)/(t1+t2+t3)
py=(t1*y1+t2*y2+t3*y3)/(t1+t2+t3)
r=math.hypot(px-x1,py-y1)
print("%f %f %f"%(round(px,3),round(py,3),round(r,3)))
| Traceback (most recent call last):
File "/tmp/tmpo85gw2f_/tmpa8fuhw_6.py", line 2, in <module>
n=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s989146239 | p00010 | u150984829 | 1525319468 | Python | Python3 | py | Runtime Error | 0 | 0 | 267 | for _ in[0]*int(input()):
a,b,c,d,e,f=map(float,input().split())
s,t,u=a*a+b*b,c*c+d*d,e*e+f*f
x=(s*(d-f)+t*(f-b)+u*(b-d))/2/(a*(d-f)+c*(f-b)+e*(b-d))
y=(s*(c-e)+t*(e-a)+u*(a-c))/2/(b*(c-e)+d*(e-a)+f*(a-c))
print(f'{x:.3f} {y:.3f} {((x-a)**2+(y-b)**2)**.5.3f}')
| File "/tmp/tmpqpilrd_o/tmpqs16_vdw.py", line 6
(((x-a)**2+(y-b)**2)**.5.3f)
^
SyntaxError: invalid decimal literal
| |
s665551975 | p00010 | u223900719 | 1526217576 | Python | Python | py | Runtime Error | 0 | 0 | 312 | from numpy import *
from numpy.linalg import solve
N=input()
a1,b1,a2,b2,a3,b3=map(float, raw_input().split())
a=array([[ 2*(a2-a1),2*(b2-b1) ],[ 2*(a3-a1),2*(b3-b1) ]])
b=array([a2**2+b2**2-a1**2-b1**2,a3**2+b3**2-a1**2-b1**2])
x=solve(a, b)
print x[0],x[1], round( ( (a1-x[0])**2+(b1-x[1])**2 )**0.5 , 3)
| File "/tmp/tmphq8him0t/tmpki8v2erv.py", line 12
print x[0],x[1], round( ( (a1-x[0])**2+(b1-x[1])**2 )**0.5 , 3)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s631077055 | p00010 | u326929999 | 1527141117 | Python | Python3 | py | Runtime Error | 0 | 0 | 672 | # -*- coding: utf-8 -*-
from math import sqrt
import numpy as np
# n = int(input())
# tmp = input().split(' ')
tmp = '0.0 0.0 2.0 0.0 2.0 2.0'.split(' ')
# tmp = '0.0 3.0 -1.0 0.0 -3.0 4.0'.split(' ')
a, b, c = [(float(tmp[i]), float(tmp[i+1])) for i in range(0, len(tmp), 2)]
A = np.array(((a[0], a[1], 1),
(b[0], b[1], 1),
(c[0], c[1], 1)))
B = np.array((((-(a[0]**2 + a[1]**2))),
((-(b[0]**2 + b[1]**2))),
((-(c[0]**2 + c[1]**2)))))
tmp = np.dot(np.linalg.inv(A), B)
#tmp = [-6, 10, 18]
x = -tmp[0]/2
y = -tmp[1]/2
r = sqrt((tmp[0]**2 + tmp[1]**2 - 4*tmp[2])/4)
print('{:.3} {:.3} {:.3}'.format(x, y, r))
| 1.0 1.0 1.41
| |
s101671470 | p00010 | u282635979 | 1363937819 | Python | Python | py | Runtime Error | 0 | 0 | 518 | import math
for val in xrange(0,input()):
x = map(float,raw_input().split(' '))
a = 2*(x[0]-x[2])
b = 2*(x[1]-x[3])
c = (x[1]**2-x[2]**2)-(x[1]**2-x[3]**2)
d = 2*(x[0]-x[4])
e = 2*(x[1]-x[5])
f = (x[1]**2-x[4]**2)-(x[1]**2-x[5]**2)
p = round((c*e-b*f)/(a*e-b*d),4)
q = round((a*f-c*d)/(a*e-b*d),4)
X = '%.3f' % p
Y = '%.3f' % q
if str(x) == '-0.000': X = '%.3f' % 0.000
if str(y) == '-0.000': Y = '%.3f' % 0.000
r = (x[0]-X)**2+(x[1]-Y)**2
r = math.sqrt(r)
r = math.fabs(r)
print X,Y,r | File "/tmp/tmpp6v3g67h/tmp4attazrw.py", line 4
a = 2*(x[0]-x[2])
IndentationError: unexpected indent
| |
s255340438 | p00010 | u282635979 | 1363937963 | Python | Python | py | Runtime Error | 0 | 0 | 502 | import math
for val in xrange(0,input()):
x = map(float,raw_input().split(' '))
a = 2*(x[0]-x[2])
b = 2*(x[1]-x[3])
c = (x[1]**2-x[2]**2)-(x[1]**2-x[3]**2)
d = 2*(x[0]-x[4])
e = 2*(x[1]-x[5])
f = (x[1]**2-x[4]**2)-(x[1]**2-x[5]**2)
p = round((c*e-b*f)/(a*e-b*d),4)
q = round((a*f-c*d)/(a*e-b*d),4)
X = '%.3f' % p
Y = '%.3f' % q
if str(x) == '-0.000': X = '%.3f' % 0.000
if str(y) == '-0.000': Y = '%.3f' % 0.000
r = (x[0]-X)**2+(x[1]-Y)**2
r = math.sqrt(r)
r = math.fabs(r)
print X,Y,r | File "/tmp/tmp40nwm575/tmpk6rg6sxa.py", line 19
print X,Y,r
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s395566522 | p00010 | u282635979 | 1363937996 | Python | Python | py | Runtime Error | 0 | 0 | 502 | import math
for val in xrange(0,input()):
x = map(float,raw_input().split(' '))
a = 2*(x[0]-x[2])
b = 2*(x[1]-x[3])
c = (x[1]**2-x[2]**2)-(x[1]**2-x[3]**2)
d = 2*(x[0]-x[4])
e = 2*(x[1]-x[5])
f = (x[1]**2-x[4]**2)-(x[1]**2-x[5]**2)
p = round((c*e-b*f)/(a*e-b*d),4)
q = round((a*f-c*d)/(a*e-b*d),4)
X = '%.3f' % p
Y = '%.3f' % q
if str(X) == '-0.000': X = '%.3f' % 0.000
if str(Y) == '-0.000': Y = '%.3f' % 0.000
r = (x[0]-X)**2+(x[1]-Y)**2
r = math.sqrt(r)
r = math.fabs(r)
print X,Y,r | File "/tmp/tmp7ja02u20/tmpo35o12zd.py", line 19
print X,Y,r
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s999806676 | p00010 | u912573907 | 1375173636 | Python | Python | py | Runtime Error | 0 | 0 | 1234 | import math
class Triangle:
def __init__(self, x1, y1, x2, y2, x3, y3):
self.x1 = x1
self.x2 = x2
self.x3 = x3
self.y1 = y1
self.y2 = y2
self.y3 = y3
self.c = math.hypot(x1 - x2, y1 - y2)
self.a = math.hypot(x2 - x3, y2 - y3)
self.b = math.hypot(x3 - x1, y3 - y1)
print self.a
print self.b
print self.c
self.degreeA = math.acos((self.b ** 2 + self.c ** 2 - self.a ** 2) / (2 * self.b * self.c))
self.degreeB = math.acos((self.c ** 2 + self.a ** 2 - self.b ** 2) / (2 * self.c * self.a))
self.degreeC = math.acos((self.a ** 2 + self.b ** 2 - self.c ** 2) / (2 * self.a * self.b))
def circumscribedCircleRadius(self):
return self.a / math.sin(self.degreeA) / 2.0
def circumscribedCircleX(self):
A = math.sin(2.0 * self.degreeA)
B = math.sin(2.0 * self.degreeB)
C = math.sin(2.0 * self.degreeC)
return (self.x1 * A + self.x2 * B + self.x3 * C) / (A + B + C)
n = input()
for t in range(n):
data = map(float, raw_input().split())
t = Triangle(data)
print "%.3f %.3f" % (round(t.circumscribedCircleRadius(),4), round(t.circumscribedCircleRadius(), 4)) | File "/tmp/tmpziifnsiu/tmplpvw2eqx.py", line 15
print self.a
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s546845271 | p00010 | u454358619 | 1377381109 | Python | Python | py | Runtime Error | 0 | 0 | 404 | import math
a = int(raw_input())
while a > 0:
x1,y1,x2,y2,x3,y3 = map(float,raw_input().split())
a1 = 2*(x2-x1)
b1 = 2*(y2-y1)
c1 = x1*x1-x2*x2+y1*y1-y2*y2
a2 = 2*(x3-x1)
b2 = 2*(y3-y1)
c2 = x1*x1-x3*x3+y1*y1-y3*y3
X = (b1*c2-b2*c1)/(a1*b2-a2*b1)
Y = (c1*a2-c2*a1)/(a1*b2-a2*b1)
R = math.sqrt((X-x1)*(X-x1)+(Y-y1)*(Y-y1))
print "%.3f %.3f %.3f" % (X,Y,R) | File "/tmp/tmpdjibaez2/tmpkybu14xk.py", line 20
print "%.3f %.3f %.3f" % (X,Y,R)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s123411670 | p00010 | u912237403 | 1377390475 | Python | Python | py | Runtime Error | 0 | 0 | 771 | import math
def equation(A):
n = len(A)
for i in range(n):
j=i
while A[j][i]==0:
j+= 1
A[i], A[j] = A[j], A[i]
A[i] = [e / A[i][i] for e in A[i]]
for j in range(n):
if j==i: continue
tmp = A[j][i]
for k in range(n+1):
A[j][k] -= tmp * A[i][k]
return
def f003():
n=input()
A=[]
for i in range(n):
seq = map(float, raw_input().split())
for j in range(3):
x = seq.pop(0)
y = seq.pop(0)
A.append([x, y, 1, -(x**2+y**2)])
equation(A)
x0, y0 = -A[0][3]/2, -A[1][3]/2
r =((x-x0)**2 + (y-y0)**2)**.5
return x0,y0,r
x0,y0,r = f003()
print "%.3f %.3f %.3f" %(x0, y0, r) | File "/tmp/tmpqaqwv8uo/tmptyyr4t14.py", line 34
print "%.3f %.3f %.3f" %(x0, y0, r)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s902788836 | p00010 | u633068244 | 1393356223 | Python | Python | py | Runtime Error | 0 | 0 | 531 | import math
n = int(raw_input())
for i in range(n)
x1, y1, x2, y2, x3, y3 = map(float, raw_input().split())
a = math.sqrt((x1-x2)**2+(y1-y2)**2)
b = math.sqrt((x1-x3)**2+(y1-y3)**2)
c = math.sqrt((x2-x3)**2+(y2-y3)**2)
s = (a+b+c)/2
ss = math.sqrt(s*(s-a)*(s-b)*(s-c))
sina = 2*ss/b/c
r = a/sina/2
a = a*a
b = b*b
c = c*c
px = (a*(b+c-a)*x3 + b*(a+c-b)*x2+c*(a+b-c)*x1)/16/ss**2
py =(a*(b+c-a)*y3 + b*(a+c-b)*y2+c*(a+b-c)*y1)/16/ss**2
print "%.3f %.3f %.3f" % (px, py, r) | File "/tmp/tmp7xddnls1/tmpw7g_cjmt.py", line 3
for i in range(n)
^
SyntaxError: expected ':'
| |
s764393994 | p00010 | u633068244 | 1397323045 | Python | Python | py | Runtime Error | 0 | 0 | 606 | #include <stdio.h>
#include <math.h>
int main(void){
int n;
double x1,y1,x2,y2,x3,y3,a,b,c,s,ss,sina,r,px,py;
scanf("%d",&n);
while (n--){
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
a = sqrt(pow(x1-x2,2)+pow(y1-y2,2));
b = sqrt(pow(x1-x3,2)+pow(y1-y3,2));
c = sqrt(pow(x2-x3,2)+pow(y2-y3,2));
s = (a+b+c)/2;
ss = sqrt(s*(s-a)*(s-b)*(s-c));
sina = 2*ss/b/c;
r = a/sina/2;
a = a*a; b = b*b; c = c*c;
px = (a*(b+c-a)*x3 + b*(a+c-b)*x2+c*(a+b-c)*x1)/16/pow(ss,2);
py = (a*(b+c-a)*y3 + b*(a+c-b)*y2+c*(a+b-c)*y1)/16/pow(ss,2);
printf("%.3f %.3f %.3f",px, py, r);
}
} | File "/tmp/tmpa8_dzk0i/tmpc97jwbgd.py", line 4
int main(void){
^^^^
SyntaxError: invalid syntax
| |
s961372471 | p00010 | u633068244 | 1397323078 | Python | Python | py | Runtime Error | 0 | 0 | 608 | #include <stdio.h>
#include <math.h>
int main(void){
int n;
double x1,y1,x2,y2,x3,y3,a,b,c,s,ss,sina,r,px,py;
scanf("%d",&n);
while (n--){
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
a = sqrt(pow(x1-x2,2)+pow(y1-y2,2));
b = sqrt(pow(x1-x3,2)+pow(y1-y3,2));
c = sqrt(pow(x2-x3,2)+pow(y2-y3,2));
s = (a+b+c)/2;
ss = sqrt(s*(s-a)*(s-b)*(s-c));
sina = 2*ss/b/c;
r = a/sina/2;
a = a*a; b = b*b; c = c*c;
px = (a*(b+c-a)*x3 + b*(a+c-b)*x2+c*(a+b-c)*x1)/16/pow(ss,2);
py = (a*(b+c-a)*y3 + b*(a+c-b)*y2+c*(a+b-c)*y1)/16/pow(ss,2);
printf("%.3f %.3f %.3f\n",px, py, r);
}
} | File "/tmp/tmp9634kifu/tmp9tploiri.py", line 4
int main(void){
^^^^
SyntaxError: invalid syntax
| |
s917058945 | p00010 | u633068244 | 1397323381 | Python | Python | py | Runtime Error | 0 | 0 | 620 | #include <stdio.h>
#include <math.h>
int main(void){
int n;
double x1,y1,x2,y2,x3,y3,a,b,c,s,ss,sina,r,px,py;
scanf("%d",&n);
while (n--){
scanf("%lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3);
a = sqrt(pow(x1-x2,2)+pow(y1-y2,2));
b = sqrt(pow(x1-x3,2)+pow(y1-y3,2));
c = sqrt(pow(x2-x3,2)+pow(y2-y3,2));
s = (a+b+c)/2;
ss = sqrt(s*(s-a)*(s-b)*(s-c));
sina = 2*ss/b/c;
r = a/sina/2;
a = a*a; b = b*b; c = c*c;
px = (a*(b+c-a)*x3 + b*(a+c-b)*x2+c*(a+b-c)*x1)/16/pow(ss,2);
py = (a*(b+c-a)*y3 + b*(a+c-b)*y2+c*(a+b-c)*y1)/16/pow(ss,2);
printf("%.3f %.3f %.3f\n", px, py, r);
}
return 0;
} | File "/tmp/tmpctuggf2j/tmptt1l35ro.py", line 4
int main(void){
^^^^
SyntaxError: invalid syntax
| |
s135555369 | p00011 | u879226672 | 1423675496 | Python | Python | py | Runtime Error | 0 | 0 | 267 | while True:
w = int(raw_input())
n = int(raw_input())
ans = []
ans = [j for j in range(1,w+1)]
for k in range(n):
a,b = map(int,(raw_input().split(",")))
ans[a-1],ans[b-1] = ans[b-1],ans[a-1]
for item in ans:
print item | File "/tmp/tmpfz0a709p/tmp3fylnv3m.py", line 10
print item
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s287934673 | p00011 | u067299340 | 1432874742 | Python | Python | py | Runtime Error | 0 | 0 | 136 | l=xrange(1,input()+1)
for a,b in[map(int,raw_input().split(","))for i in xrange(input())]:l[a-1],l[b-1]=l[b-1],l[a-1]
for i in l:print i | File "/tmp/tmp8b3zekg2/tmpj_ojzdkn.py", line 3
for i in l:print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s955476104 | p00011 | u873482706 | 1434331043 | Python | Python | py | Runtime Error | 0 | 0 | 991 | def play():
result_dic = {}
for i in range(tate):
depart = i+1
arrival = drawing_lots[depart][0]
arrival = aaa(depart, arrival)
result_dic[arrival] = depart
for k in sorted(result_dic):
print(result_dic[k])
def aaa(depart, arrival):
offset = 0
for point in drawing_lots[arrival]:
if point == depart:
break
offset += 1
if offset+1 <= len(drawing_lots[arrival])-1:
depart = arrival
arrival = drawing_lots[arrival][offset+1]
return aaa(depart, arrival)
else:
return arrival
tate = int(raw_input())
yoko = int(raw_input())
drawing_lots = {}
for num in range(tate):
drawing_lots[num+1] = []
for i in range(yoko):
horizontal_line = raw_input().split(',')
left_num = int(horizontal_line[0])
right_num = int(horizontal_line[1])
drawing_lots[left_num].append(right_num)
drawing_lots[right_num].append(left_num)
play() | Traceback (most recent call last):
File "/tmp/tmphaqsc9nb/tmp6e29grom.py", line 26, in <module>
tate = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s502936114 | p00011 | u534550471 | 1434619719 | Python | Python | py | Runtime Error | 0 | 0 | 343 | import sys
import math
from collections import Counter
ww = raw_input()
nn = raw_input()
n = int(nn)
w = int(ww)
kuji = []
for i in range(w):
kuji.append(i+1)
for i in range(n):
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = kuji[a-1]
kuji[a-1] = kuji[b-1]
kuji[b-1] = temp
for i in range(w):
print kuji[i] | File "/tmp/tmpglofy4lt/tmpklk13tsy.py", line 20
print kuji[i]
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s271457283 | p00011 | u534550471 | 1434619855 | Python | Python | py | Runtime Error | 0 | 0 | 349 | import sys
import math
from collections import Counter
ww = raw_input()
nn = raw_input()
n = int(nn)
w = int(ww)
kuji = []
for i in range(w):
kuji.append(i+1)
while n > 0:
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = kuji[a-1]
kuji[a-1] = kuji[b-1]
kuji[b-1] = temp
n -= 1
for i in range(w):
print kuji[i] | File "/tmp/tmp_bcghu3o/tmpnysk22f6.py", line 22
print kuji[i]
^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s340065514 | p00011 | u534550471 | 1434642434 | Python | Python | py | Runtime Error | 0 | 0 | 354 |
import sys
import math
from collections import Counter
ww = raw_input()
nn = raw_input()
n = int(nn)
w = int(ww)
k = []
for i in range(w):
k.append(i+1)
while 1:
if n == 0:
break
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = k[a-1]
k[a-1] = k[b-1]
k[b-1] = temp
n -= 1
for i in range(w):
print k[i] | File "/tmp/tmp4i_uxs9u/tmpt4qvpb1z.py", line 25
print k[i]
^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s130751996 | p00011 | u534550471 | 1434642839 | Python | Python | py | Runtime Error | 0 | 0 | 283 | import sys
import math
from collections import Counter
w = input()
n = input()
k = []
for i in range(w+1):
k.append(i)
for i in range(n):
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = k[a]
k[a] = k[b]
k[b] = temp
for i in range(w):
print k[i+1] | File "/tmp/tmpu1lwp8iv/tmpdcwu1pee.py", line 19
print k[i+1]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s573022084 | p00011 | u534550471 | 1434642904 | Python | Python | py | Runtime Error | 0 | 0 | 252 |
import sys
import math
w = input()
n = input()
k = []
for i in range(w+1):
k.append(i)
for i in range(n):
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = k[a]
k[a] = k[b]
k[b] = temp
for i in range(w):
print k[i+1] | File "/tmp/tmpffhppx1t/tmp3lpcud1v.py", line 19
print k[i+1]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s004072541 | p00011 | u534550471 | 1434643181 | Python | Python | py | Runtime Error | 0 | 0 | 239 |
w = int(input())
n = int(input())
k = []
for i in range(w+1):
k.append(i)
for j in range(n):
l = raw_input()
a = int(l[0])
b = int(l[2])
temp = k[a]
k[a] = k[b]
k[b] = temp
for l in range(w):
print k[l+1] | File "/tmp/tmpdoa1_v73/tmpw4nigll_.py", line 17
print k[l+1]
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s173097052 | p00011 | u873482706 | 1437289783 | Python | Python | py | Runtime Error | 0 | 0 | 654 | def f1(x, y):
if not x in data:
data[x] = [y]
else:
data[x].append(y)
def f2():
for i in range(1, w+1):
f3(data[i][0], i, i)
else:
for a in ans:
print a
def f3(a, b, c):
for i, num in enumerate(data[a]):
if num == b:
if i+1 < len(data[a]):
return f3(data[a][i+1], a, c)
else:
ans[a-1] = c
break
w = int(raw_input())
n = int(raw_input())
ans = [0 for i in range(1, w+1)]
data = {}
for i in range(n):
a, b = map(int, raw_input().split(','))
f1(a, b)
f1(b, a)
else:
f2() | File "/tmp/tmpg5be1wit/tmp7ylemw72.py", line 12
print a
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s327219179 | p00011 | u873482706 | 1437289976 | Python | Python | py | Runtime Error | 0 | 0 | 649 | def f1(x, y):
if not x in data:
data[x] = [y]
else:
data[x].append(y)
def f2():
for i in range(1, w+1):
f3(data[i][0], i, i)
else:
for a in ans:
print a
def f3(a, b, c):
for i, num in enumerate(data[a]):
if num == b:
if i+1 < len(data[a]):
return f3(data[a][i+1], a, c)
else:
ans[a-1] = c
break
w = int(raw_input())
n = int(raw_input())
ans = [0 for i in range(w)]
data = {}
for i in range(n):
a, b = map(int, raw_input().split(','))
f1(a, b)
f1(b, a)
else:
f2() | File "/tmp/tmp6g8eyazv/tmp5akhne0i.py", line 12
print a
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s788301171 | p00011 | u873482706 | 1437290207 | Python | Python | py | Runtime Error | 0 | 0 | 990 | def play():
result_dic = {}
for i in range(tate):
depart = i+1
arrival = drawing_lots[depart][0]
arrival = aaa(depart, arrival)
result_dic[arrival] = depart
for k in sorted(result_dic):
print(result_dic[k])
def aaa(depart, arrival):
offset = 0
for offset, point in enumerate(drawing_lots[arrival]):
if point == depart:
break
if offset+1 <= len(drawing_lots[arrival])-1:
depart = arrival
arrival = drawing_lots[arrival][offset+1]
return aaa(depart, arrival)
else:
return arrival
tate = int(raw_input())
yoko = int(raw_input())
drawing_lots = {}
for num in range(tate):
drawing_lots[num+1] = []
for i in range(yoko):
horizontal_line = raw_input().split(',')
left_num = int(horizontal_line[0])
right_num = int(horizontal_line[1])
drawing_lots[left_num].append(right_num)
drawing_lots[right_num].append(left_num)
play() | Traceback (most recent call last):
File "/tmp/tmp5ysqe37r/tmppjddxh39.py", line 25, in <module>
tate = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s646828689 | p00011 | u775586391 | 1448030398 | Python | Python3 | py | Runtime Error | 0 | 0 | 188 | w = int(raw_input())
n = int(raw_input())
l = [i for i in range(1,w+1)]
while n > 0:
a,b = map(int,raw_input().split(','))
l[a-1],l[b-1] = l[b-1],l[a-1]
n -= 1
for i in l:
print(i) | Traceback (most recent call last):
File "/tmp/tmpjt970u51/tmpekqo5eoo.py", line 1, in <module>
w = int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s465747216 | p00011 | u994049982 | 1458691574 | Python | Python | py | Runtime Error | 0 | 0 | 146 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d,e=map(int,raw_input().split())
c[d],c[e]=c[e],c[d]
[print(i) for i in c] | Traceback (most recent call last):
File "/tmp/tmpjrcyno88/tmprusjt1tz.py", line 1, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s324265076 | p00011 | u994049982 | 1458691595 | Python | Python | py | Runtime Error | 0 | 0 | 144 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d,e=map(int,raw_input().split())
c[d],c[e]=c[e],c[d]
for i in c:print(i) | Traceback (most recent call last):
File "/tmp/tmpci0nbqv7/tmp88p9taoj.py", line 1, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s555567128 | p00011 | u994049982 | 1458691701 | Python | Python | py | Runtime Error | 0 | 0 | 156 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d=map(int,raw_input().split())
c[d[0]],c[d[-1]]=c[d[-1]],c[d[0]]
for i in c:print(i) | Traceback (most recent call last):
File "/tmp/tmpjybg88nz/tmpm0p6cuu8.py", line 1, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s501089072 | p00011 | u994049982 | 1458691789 | Python | Python | py | Runtime Error | 0 | 0 | 172 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d=str(raw_input())
c[int(d[0]-1)],c[int(d[-1]-1)]=c[int(d[-1]-1)],c[int(d[0]-1)]
for i in c:print(i) | Traceback (most recent call last):
File "/tmp/tmpfmcbaere/tmp2niiii2p.py", line 1, in <module>
a=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s510196485 | p00011 | u994049982 | 1458691909 | Python | Python | py | Runtime Error | 0 | 0 | 162 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d=str(raw_input())
d,e=int(d[0]-1),int(d[2]-1)
c[d],c[e]=c[e],c[d)
for i in c:print(i) | File "/tmp/tmpw8d2dd8b/tmpwgmyg63q.py", line 7
c[d],c[e]=c[e],c[d)
^
SyntaxError: closing parenthesis ')' does not match opening parenthesis '['
| |
s950262392 | p00011 | u994049982 | 1458692090 | Python | Python | py | Runtime Error | 0 | 0 | 163 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d=str(raw_input())
d,e=int(d[0]-1),int(d[2]-1)
c[d],c[e]=c[e],c[d])
for i in c:print(i) | File "/tmp/tmp8fxz2t30/tmp6mo1aibr.py", line 7
c[d],c[e]=c[e],c[d])
^
SyntaxError: unmatched ')'
| |
s140300850 | p00011 | u994049982 | 1458692145 | Python | Python | py | Runtime Error | 0 | 0 | 145 | a=int(input())
b=int(input())
c=range(1,b+1)
for i in range(a):
d,e=map(int,raw_input().split())
c[d],c[e]=c[e],c[d])
for i in c:print(i) | File "/tmp/tmp4vby5gyz/tmpeut93uro.py", line 6
c[d],c[e]=c[e],c[d])
^
SyntaxError: unmatched ')'
| |
s000688486 | p00011 | u300946041 | 1468032349 | Python | Python3 | py | Runtime Error | 0 | 0 | 287 | # -*- coding: utf-8 -*-
def solve(w, n):
l = [i for i in range(1, w+1)]
for _ in range(n):
a, b = map(int, input().split(','))
l[a], l[b] = l[b], l[a]
print(*l, sep='\n')
if __name__ == '__main__':
w = int(input())
n = int(input())
solve(w, n) | Traceback (most recent call last):
File "/tmp/tmppwhwft9z/tmpihqxglrk.py", line 13, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s383171804 | p00011 | u300946041 | 1468032443 | Python | Python3 | py | Runtime Error | 0 | 0 | 248 | # -*- coding: utf-8 -*-
def solve():
w = int(input())
n = int(input())
l = [i for i in range(1, w+1)]
for _ in range(n):
a, b = map(int, input().split(','))
l[a], l[b] = l[b], l[a]
print(*l, sep='\n')
solve() | Traceback (most recent call last):
File "/tmp/tmpkl04x14b/tmp__s1k_pv.py", line 14, in <module>
solve()
File "/tmp/tmpkl04x14b/tmp__s1k_pv.py", line 4, in solve
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s611347983 | p00011 | u607831289 | 1473127506 | Python | Python | py | Runtime Error | 0 | 0 | 339 | def swap(a, b, x):
if x <> a and x <> b:
return x
elif x == a:
return b
elif x == b:
return a
w = raw_input()
n = raw_input()
result = range(1, w+1)
for i in range(n):
a, b = map(lambda x: int(x), raw_input().split(',')
result = [ swap(a, b, x) for x in result ]
for x in result:
print x | File "/tmp/tmpan6023c0/tmpxpxi0xj0.py", line 2
if x <> a and x <> b:
^^
SyntaxError: invalid syntax
| |
s729794414 | p00011 | u711765449 | 1483899844 | Python | Python3 | py | Runtime Error | 0 | 0 | 542 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
count = 0
for i in sys.stdin:
array.append(i)
count += 1
if count == n:
break
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[2]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmp1m35g_kd/tmppuajxo04.py", line 5, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s263122738 | p00011 | u711765449 | 1483899898 | Python | Python3 | py | Runtime Error | 0 | 0 | 542 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
count = 0
for i in sys.stdin:
array.append(i)
count += 1
if count == n:
break
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[2]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmpfwgdaduw/tmpbqce1bjv.py", line 5, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s025446108 | p00011 | u711765449 | 1483899969 | Python | Python3 | py | Runtime Error | 0 | 0 | 542 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
count = 0
for i in sys.stdin:
array.append(i)
count += 1
if count == n:
break
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[2]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmpdolluobg/tmprm9vvn54.py", line 5, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s924826169 | p00011 | u711765449 | 1483900084 | Python | Python3 | py | Runtime Error | 0 | 0 | 541 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
count = 0
for i in sys.stdin:
array.append(i)
count += 1
if count == n:
break
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[2]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmp76bfu6rn/tmpmxgjod19.py", line 4, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s318539514 | p00011 | u711765449 | 1483900466 | Python | Python | py | Runtime Error | 0 | 0 | 541 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
count = 0
for i in sys.stdin:
array.append(i)
count += 1
if count == n:
break
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[2]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmpfq598ael/tmpt_tp3qf0.py", line 4, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s425834142 | p00011 | u711765449 | 1483901279 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
for i in range(n):
array.append(input())
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[1]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmpilqkpppw/tmpb9fp4lat.py", line 4, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s908973868 | p00011 | u711765449 | 1483901380 | Python | Python3 | py | Runtime Error | 0 | 0 | 488 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = [0]*n
for i in range(n):
array[i] = input()
a, b = [0]*n, [0]*n
for i in range(n):
s = array[i]
a[i], b[i] = s[0], s[1]
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmpnl7iuvu_/tmpsz_c_nb6.py", line 4, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s140888798 | p00011 | u711765449 | 1483901491 | Python | Python3 | py | Runtime Error | 0 | 0 | 492 | # -*- coding:utf-8 -*-
import sys
w = int(input())
n = int(input())
array = []
for i in range(n):
array.append(input())
a, b = [], []
for i in range(n):
s = array[i]
a.append(s[0])
b.append(s[1])
a[i], b[i] = int(a[i]), int(b[i])
lines = []
k = 0
for i in range(w):
lines.append(k)
k += 1
for i in range(n):
tmp1 = lines[a[i]-1]
tmp2 = lines[b[i]-1]
lines[a[i]-1] = tmp2
lines[b[i]-1] = tmp1
for i in range(len(lines)):
print(lines[i]+1) | Traceback (most recent call last):
File "/tmp/tmpfh3_eqch/tmp4yqqcosg.py", line 4, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s476539102 | p00011 | u354053070 | 1501912439 | Python | Python3 | py | Runtime Error | 0 | 0 | 216 | w = int(input())
n = int(input())
nums = list(range(w + 1))
for i in range(n):
s = list(map(int, input().split(", ")))
nums[s[0]], nums[s[1]] = nums[s[1]], nums[s[0]]
for j in range(w):
print(nums[j + 1]) | Traceback (most recent call last):
File "/tmp/tmpat2b92hn/tmpjxfzy7y6.py", line 1, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s714849117 | p00011 | u354053070 | 1501913136 | Python | Python3 | py | Runtime Error | 0 | 0 | 201 | w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
a, b = list(map(int, input().split(", ")))
nums[a], nums[b] = nums[b], nums[a]
for i in range(w):
print(nums[i + 1]) | Traceback (most recent call last):
File "/tmp/tmp3zle4h9n/tmp2um3x21d.py", line 1, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s945165706 | p00011 | u354053070 | 1501914281 | Python | Python3 | py | Runtime Error | 0 | 0 | 185 | w = int(input())
nums = list(range(w + 1))
for _ in range(int(input())):
a, b = map(int, input().split(", "))
nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
print(x) | Traceback (most recent call last):
File "/tmp/tmpbmbve80u/tmpl7aljd48.py", line 1, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s035673685 | p00011 | u354053070 | 1501914394 | Python | Python3 | py | Runtime Error | 0 | 0 | 191 | w = int(input())
n = int(input())
nums = list(range(w + 1))
for _ in range(n):
a, b = map(int, input().split(", "))
nums[a], nums[b] = nums[b], nums[a]
for x in nums[1:]:
print(x) | Traceback (most recent call last):
File "/tmp/tmp530bp8x2/tmpuuin9eoe.py", line 1, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s183424483 | p00011 | u273843182 | 1514982572 | Python | Python3 | py | Runtime Error | 0 | 0 | 175 | w = int(input())
n = int(input())
l = list(range(1,w+1))
for i in range(n):
a,b = map(int,input().split(','))
a -= 1
b - = 1
l[a],l[b] = l[b],l[a]
for x in l:
print(x)
| File "/tmp/tmp_2dqy7t3/tmpzx66edil.py", line 7
b - = 1
^
SyntaxError: invalid syntax
| |
s675933018 | p00011 | u150984829 | 1516784004 | Python | Python3 | py | Runtime Error | 0 | 0 | 139 | a=[i+1 for i in range(int(input()))]
for _ in[0]*int(input()):
s,t=map(int,input().split(','))
a[s],a[t]=a[t],a[s]
for s in a:print(s+1)
| Traceback (most recent call last):
File "/tmp/tmpmgko_esa/tmpiwfb51gv.py", line 1, in <module>
a=[i+1 for i in range(int(input()))]
^^^^^^^
EOFError: EOF when reading a line
| |
s484030890 | p00011 | u150984829 | 1517404969 | Python | Python3 | py | Runtime Error | 0 | 0 | 129 | a=list(range(int(input())+1))
for _ in[0]*int(input()):s,t=map(int,input().split(','));a[s],a[t]=a[t],a[s]
for s in a:s*print(s)
| Traceback (most recent call last):
File "/tmp/tmp5pm7yvlz/tmpd6kylpes.py", line 1, in <module>
a=list(range(int(input())+1))
^^^^^^^
EOFError: EOF when reading a line
| |
s420396297 | p00011 | u069727578 | 1520046761 | Python | Python | py | Runtime Error | 0 | 0 | 264 | import math
tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split()
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmpeksih2ai/tmpehn53gn5.py", line 2, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s994044889 | p00011 | u069727578 | 1520046769 | Python | Python3 | py | Runtime Error | 0 | 0 | 264 | import math
tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split()
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmphffagyei/tmp_oxra0d3.py", line 2, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s460084583 | p00011 | u069727578 | 1520046818 | Python | Python3 | py | Runtime Error | 0 | 0 | 251 | tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split()
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmpr2ab8ads/tmpgsl_huef.py", line 1, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s681172769 | p00011 | u069727578 | 1520046926 | Python | Python | py | Runtime Error | 0 | 0 | 251 | tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split()
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmpogg5e_yi/tmpvqmrs0r8.py", line 1, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s202557140 | p00011 | u069727578 | 1520046987 | Python | Python3 | py | Runtime Error | 0 | 0 | 253 | tate =int(input());
yoko=int(input());
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split()
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmpx2rhu0cv/tmps7q8idcu.py", line 1, in <module>
tate =int(input());
^^^^^^^
EOFError: EOF when reading a line
| |
s115734457 | p00011 | u069727578 | 1520047002 | Python | Python3 | py | Runtime Error | 0 | 0 | 254 | tate =int(input());
yoko=int(input());
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmpqxf6b23n/tmptg0xmusi.py", line 1, in <module>
tate =int(input());
^^^^^^^
EOFError: EOF when reading a line
| |
s067957806 | p00011 | u069727578 | 1520047057 | Python | Python3 | py | Runtime Error | 0 | 0 | 238 | tate =int(input());
yoko=int(input());
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmplrb8u7hj/tmp0i7ftzcu.py", line 1, in <module>
tate =int(input());
^^^^^^^
EOFError: EOF when reading a line
| |
s696794372 | p00011 | u069727578 | 1520047212 | Python | Python3 | py | Runtime Error | 0 | 0 | 264 | tate =int(raw_input())
yoko=int(raw_input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=raw_input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmp6xiee2uk/tmpfyp7g91s.py", line 1, in <module>
tate =int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s952492713 | p00011 | u069727578 | 1520047217 | Python | Python | py | Runtime Error | 0 | 0 | 264 | tate =int(raw_input())
yoko=int(raw_input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=raw_input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmp19mi4vv7/tmpv1y5r2uh.py", line 1, in <module>
tate =int(raw_input())
^^^^^^^^^
NameError: name 'raw_input' is not defined
| |
s395143450 | p00011 | u069727578 | 1520047382 | Python | Python3 | py | Runtime Error | 0 | 0 | 264 | import math
tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmptjqwc_om/tmp5_yffo6f.py", line 2, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s894833126 | p00011 | u069727578 | 1520047391 | Python | Python | py | Runtime Error | 0 | 0 | 264 | import math
tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k])
| Traceback (most recent call last):
File "/tmp/tmpya3ww8jy/tmp31uxw2iv.py", line 2, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s177066699 | p00011 | u069727578 | 1520047555 | Python | Python3 | py | Runtime Error | 0 | 0 | 265 | import math
tate =int(input())
yoko=int(input())
arr = [i+1 for i in range(tate)]
for j in range(yoko):
rep1,rep2=input().split();
rep1=int(rep1)-1
rep2=int(rep2)-1
arr[rep1],arr[rep2] = arr[rep2],arr[rep1]
for k in range(tate):
print(arr[k] )
| Traceback (most recent call last):
File "/tmp/tmpwbd730uq/tmpraxmwyek.py", line 2, in <module>
tate =int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s605281104 | p00011 | u401720175 | 1522051242 | Python | Python | py | Runtime Error | 0 | 0 | 257 | # coding: utf-8
w = int(input())
ans = [i + 1 for i in range(w)]
loop = int(input())
# swap
for _ in range(loop):
left, right = map(int, input().split(","))
ans[left-1], ans[right-1] = ans[right-1], ans[left-1]
# result
for i in ans:
print(i)
| Traceback (most recent call last):
File "/tmp/tmpu_1i0glr/tmp7c8c4rvq.py", line 2, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s410185900 | p00011 | u166871988 | 1523705972 | Python | Python3 | py | Runtime Error | 0 | 0 | 173 | w=input()
l=[i+1 for i in range(w)]
n=input()
for _ in range(n):
a,b=[int(i)-1 for i in input().split(",")]
t=l[a]
l[a]=l[b]
l[b]=t
for i in w:
print(i)
| Traceback (most recent call last):
File "/tmp/tmpyd47quxe/tmpm5z16o2c.py", line 1, in <module>
w=input()
^^^^^^^
EOFError: EOF when reading a line
| |
s439164576 | p00011 | u166871988 | 1523706001 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | w=int(input())
l=[i+1 for i in range(w)]
n=int(input())
for _ in range(n):
a,b=[int(i)-1 for i in input().split(",")]
t=l[a]
l[a]=l[b]
l[b]=t
for i in w:
print(i)
| Traceback (most recent call last):
File "/tmp/tmpw6vkvb6y/tmpw6ay31cs.py", line 1, in <module>
w=int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s000924005 | p00011 | u306037418 | 1526548780 | Python | Python3 | py | Runtime Error | 0 | 0 | 200 | w = int(input())
n = int(input())
nums = [1, 2, 3, 4, 5]
ab = []
for i in range(n):
a, b = map(int, input().split(','))
nums[a-1], nums[b-1] = nums[b-1], nums[a-1]
for i in nums:
print(i)
| Traceback (most recent call last):
File "/tmp/tmpdwnv0kqv/tmp5t5ygska.py", line 1, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s641885342 | p00011 | u138224929 | 1526548878 | Python | Python3 | py | Runtime Error | 0 | 0 | 276 | w = int(input())
n = int(input())
amida = []
for i in range(0,w+1):
amida.append(i)
for i in range(n):
ai,bi = map(int,input().split())
aa = amida[ai]
bb = amida[bi]
amida[ai] = bb
amida[bi] = aa
for i in range(1,w+1):
print(w[i])
| Traceback (most recent call last):
File "/tmp/tmpcc7kn12k/tmp57e11r76.py", line 1, in <module>
w = int(input())
^^^^^^^
EOFError: EOF when reading a line
| |
s277533855 | p00011 | u585414111 | 1365756621 | Python | Python | py | Runtime Error | 0 | 0 | 180 | import sys
re = range(input())
for li in sys.stdin:
[a,b] = [int(x) for x in li.split(",")]
tmp = re[a-1]
re[a-1] = re[b-1]
re[b-1] = tmp
for i in re:
print i+1 | File "/tmp/tmpc84dnf7l/tmp8hjhm3jb.py", line 9
print i+1
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s924138953 | p00011 | u585414111 | 1365756663 | Python | Python | py | Runtime Error | 0 | 0 | 189 | import sys
re = range(int(raw_input()))
for li in sys.stdin:
[a,b] = [int(x) for x in li.split(",")]
tmp = re[a-1]
re[a-1] = re[b-1]
re[b-1] = tmp
for i in re:
print i+1 | File "/tmp/tmp0bfswct_/tmpex08gax6.py", line 9
print i+1
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s001568972 | p00011 | u511257811 | 1382165173 | Python | Python | py | Runtime Error | 0 | 0 | 400 | import sys
swapDirections = []
for lincnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = range(1, n+1)
for direction in swapDirections:
ai, bi = direction
result[ai], result[bi] = result[bi] , result[ai]
print '\n'.join(map(str, result)) | File "/tmp/tmp4wgad11a/tmpd3g8gshn.py", line 18
print '\n'.join(map(str, result))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s631510794 | p00011 | u511257811 | 1382165256 | Python | Python | py | Runtime Error | 0 | 0 | 401 | import sys
swapDirections = []
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = range(1, n+1)
for direction in swapDirections:
ai, bi = direction
result[ai], result[bi] = result[bi] , result[ai]
print '\n'.join(map(str, result)) | File "/tmp/tmpljfpv3ap/tmpk9zfr50y.py", line 18
print '\n'.join(map(str, result))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s595264426 | p00011 | u511257811 | 1382165426 | Python | Python | py | Runtime Error | 0 | 0 | 407 | import sys
swapDirections = []
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = range(1, n+1)
for direction in swapDirections:
ai, bi = tuple(direction)
result[ai], result[bi] = result[bi] , result[ai]
print '\n'.join(map(str, result)) | File "/tmp/tmpzrda1msn/tmp32m6_809.py", line 18
print '\n'.join(map(str, result))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s442120279 | p00011 | u511257811 | 1382165644 | Python | Python | py | Runtime Error | 0 | 0 | 416 | import sys
swapDirections = []
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = map(str, range(1, n+1))
for direction in swapDirections:
ai, bi = direction[0], direction[1]
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result) | File "/tmp/tmpnub7ud6f/tmp3z9aywlk.py", line 18
print '\n'.join(result)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s013918096 | p00011 | u511257811 | 1382168435 | Python | Python | py | Runtime Error | 0 | 0 | 560 | import sys
def entory(fobj=sys.stdin):
swapDirections = []
for lineCnt, line in enumerate(fobj):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = map(str, range(1, n+1))
for direction in swapDirections:
ai, bi = direction[0], direction[1]
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result)
if __name__ == '__main__':
entory() | File "/tmp/tmpwc6wprtd/tmp7xm473te.py", line 19
print '\n'.join(result)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s029357736 | p00011 | u511257811 | 1382168493 | Python | Python | py | Runtime Error | 0 | 0 | 529 | import sys
def entory(fobj=sys.stdin):
swapDirections = []
for lineCnt, line in enumerate(fobj):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = map(str, range(1, n+1))
for direction in swapDirections:
ai, bi = direction[0], direction[1]
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result)
entory() | File "/tmp/tmpg9rxet4e/tmpl9kt4vnn.py", line 19
print '\n'.join(result)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s876740951 | p00011 | u511257811 | 1382168599 | Python | Python | py | Runtime Error | 0 | 0 | 530 | import sys
def entory(fobj=sys.stdin):
swapDirections = []
for lineCnt, line in enumerate(fobj):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = map(str, range(1, n+1))
for direction in swapDirections:
ai, bi = direction[0], direction[1]
result[ai], result[bi] = result[bi], result[ai]
for n in result: print n
entory() | File "/tmp/tmph57rs_us/tmptb7j34x_.py", line 19
for n in result: print n
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s832493597 | p00011 | u511257811 | 1382168707 | Python | Python | py | Runtime Error | 0 | 0 | 560 | import sys
def entory(fobj=sys.stdin):
swapDirections = []
for lineCnt, line in enumerate(fobj):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = map(str, range(1, w+1))
for direction in swapDirections:
ai, bi = direction[0], direction[1]
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result)
if __name__ == '__main__':
entory() | File "/tmp/tmpt6fy4l3q/tmp0wvvpe1b.py", line 19
print '\n'.join(result)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s809113328 | p00011 | u511257811 | 1382168789 | Python | Python | py | Runtime Error | 0 | 0 | 564 | import sys
def entory(fobj=sys.stdin):
swapDirections = []
for lineCnt, line in enumerate(fobj):
if lineCnt == 0:
w = int(line)
elif lineCount == 1:
n = int(line)
else:
swapDirections.append(map(int, line.split(',')))
result = map(str, range(1, w+1))
for direction in swapDirections:
ai, bi = direction[0]-1, direction[1]-1
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result)
if __name__ == '__main__':
entory() | File "/tmp/tmpf8o1a39l/tmpzaihmins.py", line 19
print '\n'.join(result)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s436054220 | p00011 | u511257811 | 1382202841 | Python | Python | py | Runtime Error | 0 | 0 | 447 | import sys
def entory(fobj=sys.stdin)
for lineCnt, line in enumerate(fobj):
if lineCnt == 0:
w = int(line)
result = range(1, w+1)
elif lineCount == 1:
n = int(line)
else:
ai, bi = map(lambda x: int(x)-1, line.split(','))
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result)
if __name__ == '__main__':
entory() | File "/tmp/tmp7ufv08dw/tmpyjahvtl1.py", line 3
def entory(fobj=sys.stdin)
^
SyntaxError: expected ':'
| |
s565819469 | p00011 | u511257811 | 1382203337 | Python | Python | py | Runtime Error | 0 | 0 | 335 | import sys
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
result = range(1, w+1)
elif lineCount == 1:
n = int(line)
else:
ai, bi = map(lambda x: int(x)-1, line.split(','))
result[ai], result[bi] = result[bi], result[ai]
print '\n'.join(result) | File "/tmp/tmpie08ijn3/tmp187en3lf.py", line 12
print '\n'.join(result)
^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s890396371 | p00011 | u511257811 | 1382203521 | Python | Python | py | Runtime Error | 0 | 0 | 344 | import sys
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
result = range(1, w+1)
elif lineCount == 1:
n = int(line)
else:
ai, bi = map(lambda x: int(x)-1, line.split(','))
result[ai], result[bi] = result[bi], result[ai]
for num in result:
print num | File "/tmp/tmppi5dixwi/tmpisv_buyv.py", line 13
print num
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s219823172 | p00011 | u511257811 | 1382203677 | Python | Python | py | Runtime Error | 0 | 0 | 356 | import sys
result = []
for lineCnt, line in enumerate(sys.stdin):
if lineCnt == 0:
w = int(line)
result = range(1, w+1)
elif lineCount == 1:
n = int(line)
else:
ai, bi = map(lambda x: int(x)-1, line.split(','))
result[ai], result[bi] = result[bi], result[ai]
for num in result:
print num | File "/tmp/tmptmtobwl6/tmp659ee2uk.py", line 14
print num
^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s572090545 | p00011 | u245286435 | 1384422786 | Python | Python | py | Runtime Error | 0 | 0 | 789 | import math
import sys
def main():
tate = int(raw_input())
result = []
for i in range(1, tate+1):
result.append(i)
print result
yoko = int(raw_input())
for line in sys.stdin.readlines():
x1, x2 = map(int, line.split(","))
x1 -= 1
x2 -= 1
temp = result[x2]
result[x2] = result[x1]
result[x1] = temp
for num in result:
print num
if __name__ == '__main__':
main()
import math
import sys
def main():
tate = int(raw_input())
result = []
for i in range(1, tate+1):
result.append(i)
print result
yoko = int(raw_input())
for line in sys.stdin.readlines():
x1, x2 = map(int, line.split(","))
x1 -= 1
x2 -= 1
temp = result[x2]
result[x2] = result[x1]
result[x1] = temp
for num in result:
print num
if __name__ == '__main__':
main() | File "/tmp/tmp4h3lq_rh/tmpbi4qfptn.py", line 11
print result
^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s378462592 | p00011 | u230836528 | 1392273240 | Python | Python | py | Runtime Error | 0 | 0 | 593 | # -*- coding: utf-8 -*-
import sys
#for line in ["0.0 3.0 -1.0 0.0 -3.0 4.0"]: # expected [-2.000, 2.000, 2.236]
lineNumber = 0
for line in sys.stdin.readlines():
lineNumber += 1
# get data
List = map(float, line.strip().split())
# initial parameter
if lineNumber == 1:
w = List[0]
array = [i for i in xrange(1, w+1)]
contiune
if lineNumber == 2: continue
# set data
[a, b] = List
a -= 1; b -= 1
# exchange
buf = array[a]
array[a] = array[b]
array[b] = buf
for i in xrange(w):
print array[i]
| File "/tmp/tmp7z4mgcpt/tmpe_slrvf2.py", line 31
print array[i]
^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s029970909 | p00011 | u633068244 | 1393356580 | Python | Python | py | Runtime Error | 0 | 0 | 209 | w = int(raw_input())
n = int(raw_input())
s = [i+1 for i in range(w)]
for i in range(n):
a, b = map(int, raw_input().split())
tmp = s[a-1]
s[a-1] = s[b-1]
s[b-1] = tmp
for i in s:
print i | File "/tmp/tmpg2tyben4/tmp24w4jfny.py", line 12
print i
^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
| |
s691908772 | p00011 | u747479790 | 1398134405 | Python | Python | py | Runtime Error | 0 | 0 | 284 | w = int(raw_input())$
2 n = int(raw_input())$
3 a = []$
4 for i in range(n):$
5 a.append(map(int, raw_input().split(',')))$
6 r = range(1,w + 1)$
7 for i in a:$
8 tmp = r[i[0] - 1]$
9 r[i[0] - 1] = r[i[1] - 1]$
10 r[i[1] - 1] = tmp$
11 for i in r:$
12 print i$ | File "/tmp/tmpjtefjx6_/tmptzzgk_cu.py", line 1
w = int(raw_input())$
^
SyntaxError: invalid syntax
| |
s783529237 | p00011 | u747479790 | 1398134484 | Python | Python | py | Runtime Error | 0 | 0 | 233 | w = int(raw_input())
n = int(raw_input())$
a = []
for i in range(n):
a.append(map(int, raw_input().split(',')))
r = range(1,w + 1)
for i in a:
tmp = r[i[0] - 1]
r[i[0] - 1] = r[i[1] - 1]
r[i[1] - 1] = tmp
for i in r:
print i | File "/tmp/tmp27lw1nvv/tmp49kd3f73.py", line 2
n = int(raw_input())$
^
SyntaxError: invalid syntax
| |
s201206477 | p00011 | u747479790 | 1398134939 | Python | Python | py | Runtime Error | 0 | 0 | 246 | w = int(raw_input())
n = int(raw_input())
a = []
for i in range(n):
a.append(map(int, raw_input().split(',')))
r = range(1,w + 1)
for i in a:
tmp = r[i[0] - 1]
r[i[0] - 1] = r[i[1] - 1]
r[i[1] - 1] = tmp
for i in r:
print i | File "/tmp/tmp3zyrs9l8/tmpy_42iqqp.py", line 1
w = int(raw_input())
IndentationError: unexpected indent
| |
s583236833 | p00012 | u244742296 | 1409835042 | Python | Python3 | py | Runtime Error | 0 | 0 | 1384 | # -*- coding: utf-8 -*-
import math
import cmath
class Point(object):
def __init__(self, x, y):
self.point = complex(x, y)
def __str__(self):
return "x = {0}, y = {1}".format(self.point.real, self.point.imag)
class Triangle(Point):
def __init__(self, a, b, c):
self.a = a
self.b = b
self.c = c
# 3辺の長さ
self.edgeA = abs(b.point-c.point)
self.edgeB = abs(c.point-a.point)
self.edgeC = abs(a.point-b.point)
# 3角の大きさ
self.angleA = Triangle.angle(self.edgeA, self.edgeB, self.edgeC)
self.angleB = Triangle.angle(self.edgeB, self.edgeC, self.edgeA)
self.angleC = Triangle.angle(self.edgeC, self.edgeA, self.edgeB)
# 角度を求める
def angle(A, B, C):
return cmath.acos( (B*B+C*C-A*A)/(2*B*C) ).real
eps = 0.0001
while True:
line = input()
if line == "":
break
line = [float(x) for x in line.split()]
p1 = Point(line[0], line[1])
p2 = Point(line[2], line[3])
p3 = Point(line[4], line[5])
P = Point(line[6], line[7])
t1 = Triangle(p1, p2, P)
t2 = Triangle(p2, p3, P)
t3 = Triangle(p3, p1, P)
if (math.degrees(t1.angleC + t2.angleC + t3.angleC) <= 360+eps) and (math.degrees(t1.angleC + t2.angleC + t3.angleC) >= 360-eps):
print("YES")
else:
print("NO") | Traceback (most recent call last):
File "/tmp/tmpfw3ra6qi/tmp7p2hb5_5.py", line 36, in <module>
line = input()
^^^^^^^
EOFError: EOF when reading a line
| |
s707529613 | p00012 | u912237403 | 1415708563 | Python | Python | py | Runtime Error | 0 | 0 | 310 | import sys
def side(p1, p2, p3): return (p3[1]-p1[1])*(p2[0]-p1[0])-(p2[1]-p1[1])*(p3[0]-p1[0])>0
for s in sys.stdin:
x = map(float, raw_input().split())
p1 = x[0:2]
p2 = x[2:4]
p3 = x[4:6]
p0 = x[6:]
print ["NO","YES"][(side(p1, p2, p0)==side(p2, p3, p0) and side(p2, p3, p0)==side(p3, p1, p0))] | ||
s729218401 | p00012 | u018967850 | 1464272894 | Python | Python | py | Runtime Error | 0 | 0 | 374 | # coding: utf-8
# Here your code !
# coding: utf-8
import numpy as np
l = map(float, raw_input().split())
x1 = l[2]-l[0]
x2 = l[3]-l[1]
y1 = l[4]-l[0]
y2 = l[5]-l[1]
p1 = l[6]-l[0]
p2 = l[7]-l[1]
matrix_A = np.array([[x1,y1],[x2,y2]])
vector_p = np.array([p1,p2])
x = np.linalg.solve(matrix_A, vector_p)
if 0<abs(x[0])+abs(x[1])<1:
print "Yes"
else:
print "No" | File "/tmp/tmp5gnjawdr/tmpqskk5ped.py", line 22
print "Yes"
^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.