s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
int64
0
100
memory
stringlengths
4
6
code_size
int64
15
14.7k
code
stringlengths
15
14.7k
problem_id
stringlengths
6
6
problem_description
stringlengths
358
9.83k
input
stringlengths
2
4.87k
output
stringclasses
807 values
__index_level_0__
int64
1.1k
1.22M
s655711077
p00010
u150984829
1525319480
Python
Python3
py
Accepted
20
5676
268
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}')
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,202
s514957818
p00010
u724548524
1525742872
Python
Python3
py
Accepted
20
5692
526
import math for _ in range(int(input())): x1, y1, x2, y2, x3, y3 = map(float, input().split()) p = ((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)-(y1-y2)*(x1-x3)) q = ((x1-x3)*(x1**2 -x2**2 +y1**2 -y2**2) -(x1-x2)*(x1**2 -x3**2 +y1**2 -y3**2)) / 2/ ((x1-x3...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,203
s441020577
p00010
u724548524
1525742882
Python
Python3
py
Accepted
20
5676
446
import math for _ in range(int(input())): x1, y1, x2, y2, x3, y3 = map(float, input().split()) p = ((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)-(y1-y2)*(x1-x3)) q = ((x1-x3)*(x1**2 -x2**2 +y1**2 -y2**2) -(x1-x2)*(x1**2 -x3**2 +y1**2 -y3**2)) / 2/ ((x1-x3...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,204
s642943574
p00010
u326929999
1527147886
Python
Python3
py
Accepted
20
5708
1,196
# -*- coding: utf-8 -*- from math import sqrt # import numpy as np n = int(input()) for i in range(n): tmp = input().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...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,205
s975589080
p00010
u467175809
1528378439
Python
Python3
py
Accepted
20
5700
679
#!/usr/bin/env python from math import * def g(x): y = (int((1000 * abs(x)) * 2 + 1) // 2) / 1000 if x < 0: y *= -1 return y def func(x): x1, y1, x2, y2, x3, y3 = x a = x1 - x2 b = y1 - y2 c = (x1 * x1 + y1 * y1 - x2 * x2 - y2 * y2) / 2 d = x1 - x3 e = y1 - y3 f = (x1 * x1 + y1 * y1 - x3 * x3 - y3 * y3) /...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,206
s051503729
p00010
u467175809
1528379662
Python
Python3
py
Accepted
20
5692
647
#!/usr/bin/env python from math import * def g(x): y = (int((1000 * abs(x)) * 2 + 1) // 2) / 1000 if x < 0: y *= -1 return y def func(x): x1, y1, x2, y2, x3, y3 = x vx1 = x2 - x1 vy1 = y2 - y1 vx2 = x3 - x1 vy2 = y3 - y1 k = (vx2 ** 2 + vy2 ** 2 - vx1 * vx2 - vy1 * vy2) / (vy1 * vx2 - vx1 * vy2) / 2 x = vx...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,207
s478922477
p00010
u458530128
1528379879
Python
Python3
py
Accepted
20
5704
1,042
from math import * def g(x): y = (int((1000 * abs(x)) * 2 + 1) // 2) / 1000 if x < 0: y *= -1 return y ''' def f(x): a = (x[2] - x[4]) * (x[1] - x[3]) - (x[0] - x[2]) * (x[3] - x[5]) b = (x[0] - x[2]) * (x[4] - x[0]) - (x[5] - x[1]) * (x[1] - x[3]) l = 0.5 * b / a X = 0.5 * x[2] + 0....
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,208
s609033297
p00010
u467175809
1528380125
Python
Python3
py
Accepted
30
5680
546
#!/usr/bin/env python from math import * def g(x): y = (int((1000 * abs(x)) * 2 + 1) // 2) / 1000 if x < 0: y *= -1 return y def func(x): x1, y1, x2, y2, x3, y3 = x vx1 = x2 - x1 vy1 = y2 - y1 vx2 = x3 - x1 vy2 = y3 - y1 k = (vx2 ** 2 + vy2 ** 2 - vx1 * vx2 - vy1 * vy2) / (vy1 * vx2 - vx1 * vy2) / 2 x = vx...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,209
s759661770
p00010
u136916346
1528899810
Python
Python3
py
Accepted
30
6484
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,210
s534621106
p00010
u136916346
1528899823
Python
Python3
py
Accepted
30
6480
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,211
s698981463
p00010
u136916346
1528899828
Python
Python3
py
Accepted
30
6480
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,212
s538044268
p00010
u136916346
1528899829
Python
Python3
py
Accepted
40
6480
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,213
s311413797
p00010
u136916346
1528899829
Python
Python3
py
Accepted
30
6484
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,214
s692554708
p00010
u136916346
1528899829
Python
Python3
py
Accepted
30
6480
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,215
s496620189
p00010
u136916346
1528899833
Python
Python3
py
Accepted
30
6484
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,216
s250104826
p00010
u136916346
1528899833
Python
Python3
py
Accepted
30
6480
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,217
s456613937
p00010
u136916346
1528899833
Python
Python3
py
Accepted
30
6480
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,218
s120419056
p00010
u136916346
1528899833
Python
Python3
py
Accepted
40
6484
436
from decimal import Decimal import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=list(map(Decimal,input().split())) a=x1-x3 b=y2-y3 c=x2-x3 d=y1-y3 e=y1-y2 f=x1+x3 g=x2+x3 X=(b*d*e+a*b*f-c*d*g)/2/(a*b-c*d) try: Y=-(a/d)*(X-f/2)+(y1+y3)/2 except: Y=-(c/b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,219
s959923226
p00010
u847467233
1529634902
Python
Python3
py
Accepted
20
5692
945
# AOJ 0010 Circumscribed Circle of a Triangle # Python3 2018.6.22 bal4u import math EPS = 1e-8 def cross(a, b): return a.real*b.imag - a.imag*b.real def dist(a, b): return math.hypot(a.real-b.real, a.imag-b.imag) # 両直線の交点 def crossPointLL(ln1, ln2): u = ln1[1]-ln1[0] v = ln2[1]-ln2[0] return ln1[0] + u*(cross(...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,220
s259787433
p00010
u650035614
1530633618
Python
Python3
py
Accepted
20
5836
2,681
import math PI = math.pi EPS = 10**-10 def edge(a, b): return ((a[0]-b[0])**2+(a[1]-b[1])**2)**.5 def area(a, b, c): s = (a+b+c)/2 return (s*(s-a)*(s-b)*(s-c))**.5 def LawOfCosines(a, b, c): #余弦定理 return math.acos( (b*b+c*c-a*a) / (2.0*b*c) ); def is_same(x, y): return abs(x-y) < EPS class T...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,221
s684388383
p00010
u719737030
1350999617
Python
Python
py
Accepted
10
5012
738
import math def calc(x, y): s = math.fabs((x[1]-x[0])*(y[2]-y[0]) - (x[2]-x[0])*(y[1]-y[0]))/2 a = ((x[2]-x[1])**2 + (y[2]-y[1])**2)**0.5 b = ((x[0]-x[2])**2 + (y[0]-y[2])**2)**0.5 c = ((x[1]-x[0])**2 + (y[1]-y[0])**2)**0.5 r = a*b*c/(4*s) a = [2*(x[1]-x[0]), 2*(x[2]-x[0])] b = [2*(y[1]-y[...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,222
s639938597
p00010
u647766105
1351000052
Python
Python
py
Accepted
10
5012
450
import sys n=input() for line in sys.stdin: x=map(float,line.split())[0::2]; y=map(float,line.split())[1::2]; #guilty... A=x[0]-x[1] B=y[0]-y[1] C=x[1]-x[2] D=y[1]-y[2] E=-(x[0]**2+y[0]**2)+(x[1]**2+y[1]**2) F=-(x[1]**2+y[1]**2)+(x[2]**2+y[2]**2) l=(D*E-B*F)/(A*D-B*C) m=(-C*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,223
s199572648
p00010
u779627195
1352473054
Python
Python
py
Accepted
10
52000
1,322
#coding: utf-8 def solve(a, b, c, d, e, f): agn = a*e - b*d x = (e*c - b*f)/float(agn) y = (-d*c + a*f)/float(agn) if x == 0.: x = 0. if y == 0.: y = 0. return (x, y) while 1: try: n = input() for i in xrange(n): x = [0 for i in xrange(3)] y = [0 f...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,224
s354229444
p00010
u504990413
1353585518
Python
Python
py
Accepted
20
4368
635
def heron(a,b,c): s = 0.5*(a+b+c) return (s*(s-a)*(s-b)*(s-c))**0.5 def gaishin(a,b,c,z1,z2,z3,s): p = (a**2*(b**2 + c**2 - a**2)*z1 + \ b**2*(c**2 + a**2 - b**2)*z2 + \ c**2*(a**2 + b**2 - c**2)*z3)/(16*s**2) return p n = input() for i in range(n): x1,y1,x2,y2,x3,y3 = map(float...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,225
s455473437
p00010
u419407022
1355379547
Python
Python
py
Accepted
20
5068
502
import math from math import * for i in range(int(raw_input())): (x1, y1, x2, y2, x3, y3) = map(float, raw_input().split()) a1 = 2 * (x2 - x1) b1 = 2 * (y2 - y1) c1 = x1 ** 2 - x2 ** 2 + y1 ** 2 - y2 ** 2 a2 = 2 * (x3 - x1) b2 = 2 * (y3 - y1) c2 = x1 ** 2 - x3 ** 2 + y1 ** 2 - y3 ** 2 xp...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,226
s009430967
p00010
u560838141
1356696972
Python
Python
py
Accepted
10
4588
744
import math def calc(x, y): s = math.fabs((x[1]-x[0])*(y[2]-y[0]) - (x[2]-x[0])*(y[1]-y[0]))/2 a = ((x[2]-x[1])**2 + (y[2]-y[1])**2)**0.5 b = ((x[0]-x[2])**2 + (y[0]-y[2])**2)**0.5 c = ((x[1]-x[0])**2 + (y[1]-y[0])**2)**0.5 r = a*b*c/(4*s) a = [2*(x[1]-x[0]), 2*(x[2]-x[0])] b = [2*(y[1]-...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,227
s390661659
p00010
u560838141
1356697593
Python
Python
py
Accepted
20
4584
744
import math def calc(x, y): s = math.fabs((x[1]-x[0])*(y[2]-y[0]) - (x[2]-x[0])*(y[1]-y[0]))/2 a = ((x[2]-x[1])**2 + (y[2]-y[1])**2)**0.5 b = ((x[0]-x[2])**2 + (y[0]-y[2])**2)**0.5 c = ((x[1]-x[0])**2 + (y[1]-y[0])**2)**0.5 r = a*b*c/(4*s) a = [2*(x[1]-x[0]), 2*(x[2]-x[0])] b = [2*(y[1]-...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,228
s582779443
p00010
u560838141
1356697682
Python
Python
py
Accepted
10
4584
744
import math def calc(x, y): s = math.fabs((x[1]-x[0])*(y[2]-y[0]) - (x[2]-x[0])*(y[1]-y[0]))/2 a = ((x[2]-x[1])**2 + (y[2]-y[1])**2)**0.5 b = ((x[0]-x[2])**2 + (y[0]-y[2])**2)**0.5 c = ((x[1]-x[0])**2 + (y[1]-y[0])**2)**0.5 r = a*b*c/(4*s) a = [2*(x[1]-x[0]), 2*(x[2]-x[0])] b = [2*(y[1]-...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,229
s192876141
p00010
u560838141
1356699621
Python
Python
py
Accepted
10
4584
744
import math def calc(x, y): s = math.fabs((x[1]-x[0])*(y[2]-y[0]) - (x[2]-x[0])*(y[1]-y[0]))/2 a = ((x[2]-x[1])**2 + (y[2]-y[1])**2)**0.5 b = ((x[0]-x[2])**2 + (y[0]-y[2])**2)**0.5 c = ((x[1]-x[0])**2 + (y[1]-y[0])**2)**0.5 r = a*b*c/(4*s) a = [2*(x[1]-x[0]), 2*(x[2]-x[0])] b = [2*(y[1]-...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,230
s725673573
p00010
u782850731
1361937074
Python
Python
py
Accepted
10
4472
707
from __future__ import (division, absolute_import, print_function, unicode_literals) from sys import stdin from math import sqrt N = int(stdin.readline()) for i in xrange(N): x1, y1, x2, y2, x3, y3 = (float(n) for n in stdin.readline().split()) det = x1*y2 + x2*y3 + x3*y1 - x1*y3 - x2*y1...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,231
s574348966
p00010
u575065019
1362255903
Python
Python
py
Accepted
20
4440
431
from math import sqrt ans=[] n=input() for i in xrange(n): x1,y1,x2,y2,x3,y3=map(float,raw_input().split()) A1=2*(x2-x1) A2=2*(x3-x1) B1=2*(y2-y1) B2=2*(y3-y1) C1=x1**2-x2**2+y1**2-y2**2 C2=x1**2-x3**2+y1**2-y3**2 x=(B1*C2-B2*C1)/(A1*B2-A2*B1) y=(C1*A2-C2*A1)/(A1*B2-A2*B1) r=sqr...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,232
s526999589
p00010
u585414111
1365788031
Python
Python
py
Accepted
10
4452
546
import sys from math import sqrt n = input() for line in sys.stdin: [x1,y1,x2,y2,x3,y3] = [float(x) for x in line.split()] a1 = 2*(x2-x1) b1 = 2*(y2-y1) c1 = x1**2-x2**2+y1**2-y2**2 a2 = 2*(x3-x1) b2 = 2*(y3-y1) c2 = x1**2-x3**2+y1**2-y3**2 x = (b1*c2-b2*c1)/(a1*b2-a2*b1) y = (c1*a2-...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,233
s911748786
p00010
u350508326
1368049459
Python
Python
py
Accepted
10
4416
464
import math a = int(raw_input()) while a > 0: a -= 1 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*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,234
s904662742
p00010
u454358619
1377381157
Python
Python
py
Accepted
20
4412
415
import math a = int(raw_input()) while a > 0: a -= 1 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*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,235
s241429082
p00010
u912237403
1377393344
Python
Python
py
Accepted
10
4484
686
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): ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,236
s336615626
p00010
u813384600
1379493227
Python
Python
py
Accepted
20
4432
466
import math n = int(raw_input()) for _ in range(n): (x1, y1, x2, y2, x3, y3) = map(float, raw_input().split()) a1 = (x2 - x1) * 2 a2 = (x3 - x1) * 2 b1 = (y2 - y1) * 2 b2 = (y3 - y1) * 2 c1 = x1**2 - x2**2 + y1**2 - y2**2 c2 = x1**2 - x3**2 + y1**2 - y3**2 x = (b1*c2 - b2*c1) / (a1*b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,237
s831575306
p00010
u492005863
1381406358
Python
Python
py
Accepted
10
4420
570
# -*- coding: utf-8 -*- import sys import math n = 0 datas = [] for (i, line) in enumerate(sys.stdin): if i == 0: n = int(line) else: datas.append(map(float, line.split())) for data in datas: x1, y1, x2, y2, x3, y3 = data a1 = x2 - x1 b1 = y2 - y1 a2 = x3 - x1 b2 = y3 - y1 px = (b2 * (a1 * a1 + b1 * b1...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,238
s678331748
p00010
u492005863
1381406942
Python
Python
py
Accepted
20
4416
583
# Circumscribed Circle of a Triangle import sys import math n = 0 datas = [] for (i, line) in enumerate(sys.stdin): if i == 0: n = int(line) else: datas.append(map(float, line.split())) for data in datas: x1, y1, x2, y2, x3, y3 = data a1 = x2 - x1 b1 = y2 - y1 a2 = x3 - x1 b2 = y3 - y1 px = (b2 * (a1 *...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,239
s001056118
p00010
u621997536
1388943330
Python
Python
py
Accepted
10
4412
496
import math n = input() for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, raw_input().split()) d1 = x1 * x1 + y1 * y1; d2 = x2 * x2 + y2 * y2; d3 = x3 * x3 + y3 * y3; u = 0.5 / ( x1 * y2 - x2 * y1 + x2 * y3 - x3 * y2 + x3 * y1 - x1 * y3) xp = u* (d1 * y2 - d2 * y1 + d2 * y3 - d3 * y2 + d3 * y1 - d1 * ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,240
s148157877
p00010
u912237403
1390145097
Python
Python
py
Accepted
10
4500
534
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 n=input() for i in range(n): A=[] seq=ma...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,241
s460236051
p00010
u230836528
1392272869
Python
Python
py
Accepted
10
4464
1,731
# -*- coding: utf-8 -*- import sys def prod_mat_vec(A, vec): ret = [0 for i in xrange(3)] for i in xrange(3): for j in xrange(3): ret[i] += A[i][j] * vec[j] return ret def changerow(A, i1, i2): for j in xrange(3): buf = A[i1][j] A[i1][j] = A[i2][j] A[i2][j...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,242
s813095975
p00010
u300645821
1392570850
Python
Python
py
Accepted
10
4408
382
import sys,math if sys.version_info[0]>=3: raw_input=input N=int(raw_input()) for i in range(N): x1,y1,x2,y2,x3,y3=[float(e) for e in raw_input().split()] a1=2*x2-2*x1 b1=2*y2-2*y1 c1=x1*x1-x2*x2+y1*y1-y2*y2 a2=2*x3-2*x1 b2=2*y3-2*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*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,243
s612749846
p00010
u633068244
1393356107
Python
Python
py
Accepted
10
4444
676
import math n = int(raw_input()) while True: try: 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)) ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,244
s380242787
p00010
u633068244
1393356248
Python
Python
py
Accepted
10
4444
532
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 ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,245
s243207823
p00010
u708217907
1398121408
Python
Python
py
Accepted
20
4392
467
import sys import math n = int(raw_input()) for data in sys.stdin: x1, y1, x2, y2, x3, y3 = map(float, data.split()) a1 = x2 - x1 b1 = y2 - y1 a2 = x3 - x1 b2 = y3 - y1 px = (b2 * (a1 * a1 + b1 * b1) - b1 * (a2 * a2 + b2 * b2)) / (2 * (a1 * b2 - a2 * b1)) py = (a1 * (a2 * a2 + b2 * b2) - a2 * (a1 * a1 +...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,246
s591258207
p00010
u491763171
1400539773
Python
Python
py
Accepted
10
4432
560
from math import hypot T = input() for t in xrange(1, T + 1): x1, y1, x2, y2, x3, y3 = map(float, raw_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 = ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,247
s954505556
p00010
u300645821
1400580204
Python
Python3
py
Accepted
30
6828
400
#!/usr/bin/python import sys,math if sys.version_info[0]>=3: raw_input=input N=int(raw_input()) for i in range(N): x1,y1,x2,y2,x3,y3=[float(e) for e in raw_input().split()] a1=2*x2-2*x1 b1=2*y2-2*y1 c1=x1*x1-x2*x2+y1*y1-y2*y2 a2=2*x3-2*x1 b2=2*y3-2*y1 c2=x1*x1-x3*x3+y1*y1-y3*y3 x=(b1*c2-b2*c1)/(a1*b2-a2*b1) y=...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,248
s479244965
p00010
u300645821
1400580241
Python
Python3
py
Accepted
30
6828
382
import sys,math if sys.version_info[0]>=3: raw_input=input N=int(raw_input()) for i in range(N): x1,y1,x2,y2,x3,y3=[float(e) for e in raw_input().split()] a1=2*x2-2*x1 b1=2*y2-2*y1 c1=x1*x1-x2*x2+y1*y1-y2*y2 a2=2*x3-2*x1 b2=2*y3-2*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*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,249
s532964118
p00010
u436634575
1401130872
Python
Python3
py
Accepted
30
6836
451
from math import hypot n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().strip().split()) d = lambda x, y: x*x + y*y t21 = [2*(x2-x1), 2*(y2-y1), d(x2,y2) - d(x1,y1)] t31 = [2*(x3-x1), 2*(y3-y1), d(x3,y3) - d(x1,y1)] det = lambda i, j: t21[i]*t31[j] - t21[j]*t31[i] ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,250
s240476404
p00010
u813197825
1596184640
Python
Python3
py
Accepted
20
5696
911
def f1(a, b, c, d): # 2点の中心を通り垂直な線の傾きと切片 k = (a - c) / (d - b) h = ((b + d) - k * (a + c)) / 2 return k, h def f2(a, b, c, d): # 2直線との交点 x = (d - b) / (a - c) y = a * x + b return x, y def f3(a, b, c, d): return ((c - a) ** 2 + (d - b) ** 2) ** 0.5 def main(): N = int(input()) ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,251
s353335724
p00010
u187074069
1592413271
Python
Python3
py
Accepted
20
5672
504
n = int(input()) for i in range(n): lst = list(map(float, input().split())) a, b = lst[0], lst[1] c, d = lst[2], lst[3] e, f = lst[4], lst[5] px = ((a+c)*(a-c)*(b-f)-(a+e)*(a-e)*(b-d)+(b-d)*(b-f)*(d-f))/(2*((a-c)*(b-f)-(a-e)*(b-d))) py = ((a-c)*(a-e)*(c-e)+(b+d)*(b-d)*(a-e)-(b+f)*(b-f)*(a-c...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,252
s120875423
p00010
u814278309
1592268993
Python
Python3
py
Accepted
20
5696
432
import math for i in range(int(input())): x1,y1,x2,y2,x3,y3 = map(float,input().split()) a = 2*(x2 - x1) b = 2*(y2 - y1) c = x1**2 - x2**2 + y1**2 - y2**2 aa = 2*(x3 - x1) bb = 2*(y3 - y1) cc = x1**2 - x3**2 + y1**2 - y3**2 x = (b*cc - bb*c) / (a*bb - aa*b) y = (c*aa - cc*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,253
s378328852
p00010
u245861861
1592051350
Python
Python3
py
Accepted
20
5688
328
import math N=int(input()) for i in range(N): x1,y1,x2,y2,x3,y3=[float(e) for e in input().split()] a1=2*x2-2*x1 b1=2*y2-2*y1 c1=x1*x1-x2*x2+y1*y1-y2*y2 a2=2*x3-2*x1 b2=2*y3-2*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) print('%.3f %.3f %.3f'%(x,y,math.hypot(x1-x,...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,254
s097941839
p00010
u240091169
1589154162
Python
Python3
py
Accepted
20
5688
546
import math n = int(input()) for i in range(n) : x1, y1, x2, y2, x3, y3 = map(float, input().split()) py = ((x3-x1)*(x1**2 + y1**2 - x2**2 - y2**2) - (x2-x1)*(x1**2 + y1**2 - x3**2 - y3**2)) / (2*(x3-x1)*(y1-y2) - 2*(x2-x1)*(y1-y3)) if x1 == x2 : px = (2*(y1-y3)*py - x1**2 - y1**2 + x3**2 + y3*...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,255
s311774112
p00010
u260980560
1588729240
Python
Python3
py
Accepted
20
5656
448
N = int(input()) for i in range(N): x1, y1, x2, y2, x3, y3 = map(float, input().split()) a = 2*(x1 - x2); b = 2*(y1 - y2); p = x1**2 - x2**2 + y1**2 - y2**2 c = 2*(x1 - x3); d = 2*(y1 - y3); q = x1**2 - x3**2 + y1**2 - y3**2 det = a*d - b*c x = d*p - b*q; y = a*q - c*p if det < 0: x = -x...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,256
s713460365
p00010
u630911389
1576894361
Python
Python3
py
Accepted
20
5692
917
import math class Circle: def __init__(self,x,y,r): self.x = x self.y = y self.r = r def getCircle(x1, y1, x2, y2, x3, y3): d = 2 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) px = ((x1**2 + y1**2) * (y2 - y3) + (x2**2 + y2**2) * (y3 - y1) + (x3**2 + y3**2) * (y1 - y2) ) / d...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,257
s518087770
p00010
u942532706
1575467363
Python
Python3
py
Accepted
20
5628
419
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = list(map(float, input().split())) a = complex(x1, y1) b = complex(x2, y2) c = complex(x3, y3) a -= c b -= c z0 = abs(a)**2 * b - abs(b)**2 * a z0 /= a.conjugate() * b - a * b.conjugate() z = z0 + c zx = "{0:.3f}".format...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,258
s590285760
p00010
u350155409
1574869000
Python
Python3
py
Accepted
20
5700
701
import math n = int(input()) round = lambda x:(x*1000*2+1)//2/1000 for i in range(n): x1,y1,x2,y2,x3,y3 = [ float(s) for s in input().split() ] r1 = x1*x1 + y1*y1 r2 = x2*x2 + y2*y2 r3 = x3*x3 + y3*y3 x1_x2 = x1 - x2 y1_y2 = y1 - y2 x1_x3 = x1 - x3 y1_y3 = y1 - y3 r1_r2 = r1 - r2 ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,259
s810921843
p00010
u072053884
1573481484
Python
Python3
py
Accepted
20
5644
616
def solve(): from sys import stdin f_i = stdin n = int(f_i.readline()) for i in range(n): x1, y1, x2, y2, x3, y3 = map(float, f_i.readline().split()) A = x1 + y1 * 1j B = x2 + y2 * 1j C = x3 + y3 * 1j a = abs(C - B) b = abs(A - C) c = abs(B - ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,260
s983247562
p00010
u128808587
1571110045
Python
Python3
py
Accepted
20
5672
541
n = int(input()) for i in range(n): x1, y1, x2, y2, x3, y3 = list(map(float, input().split())) a = 2*(x1-x2) b = 2*(y1-y2) c = x1**2 - x2**2 + y1**2 - y2**2 d = 2*(x1-x3) e = 2*(y1-y3) f = x1**2 - x3**2 + y1**2 - y3**2 y = (c*d - a*f) / (b*d - a*e) if a==0: x = (f - e*y) / d...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,261
s253801764
p00010
u586792237
1564930121
Python
Python3
py
Accepted
20
5688
684
import math n = int(input()) positions = [] for i in range(n): positions.append(list(map(float, input().split()))) for i in range(n): ra = [positions[i][0],positions[i][1]] rb = [positions[i][2],positions[i][3]] rc = [positions[i][4],positions[i][5]] A = (rb[0]-rc[0])**2+(rb[1]-rc[1])**2 B = (rc[0]-r...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,262
s063542268
p00010
u821561321
1564924113
Python
Python3
py
Accepted
20
5680
304
import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=map(float,input().split()) a,b,c=2*(x2-x1),2*(y2-y1),x1**2-x2**2+y1**2-y2**2 aa,bb,cc=2*(x3-x1),2*(y3-y1),x1**2-x3**2+y1**2-y3**2 x,y=(b*cc-bb*c)/(a*bb-aa*b),(c*aa-cc*a)/(a*bb-aa*b) print('%.3f %.3f %.3f'%(x,y,math.hypot(x1-x,y1-y)))
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,263
s083090877
p00010
u427219397
1564893135
Python
Python3
py
Accepted
20
5684
447
import math for _ in range(int(input())): x1, y1, x2, y2, x3, y3 = map(float, input().split()) p = ((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)-(y1-y2)*(x1-x3)) q = ((x1-x3)*(x1**2 -x2**2 +y1**2 -y2**2) -(x1-x2)*(x1**2 -x3**2 +y1**2 -y3**2)) / 2/ ((x1-x3...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,264
s610729218
p00010
u678843586
1564643799
Python
Python3
py
Accepted
20
5680
314
import math for _ in range(int(input())): x1,y1,x2,y2,x3,y3=map(float,input().split()) a,b,c=2*(x2-x1),2*(y2-y1),x1**2-x2**2+y1**2-y2**2 aa,bb,cc=2*(x3-x1),2*(y3-y1),x1**2-x3**2+y1**2-y3**2 x,y=(b*cc-bb*c)/(a*bb-aa*b),(c*aa-cc*a)/(a*bb-aa*b) print('%.3f %.3f %.3f'%(x,y,math.hypot(x1-x,y1-y)))
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,265
s024363287
p00010
u647694976
1564453627
Python
Python3
py
Accepted
20
5680
413
import sys,math if sys.version_info[0]>=3: raw_input=input N=int(raw_input()) for i in range(N): x1,y1,x2,y2,x3,y3=[float(e) for e in raw_input().split()] a1=2*x2-2*x1 b1=2*y2-2*y1 c1=x1*x1-x2*x2+y1*y1-y2*y2 a2=2*x3-2*x1 b2=2*y3-2*y1 c2=x1*x1-x3*x3+y1*y1-y3*y3 x=(b1*c2-b2*c1)/(a1*b2-a2*b...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,266
s655021020
p00010
u264450287
1561506812
Python
Python3
py
Accepted
20
5704
434
import math n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=map(float,input().split()) a=(x3-x1)*(x1**2+y1**2-x2**2-y2**2)-(x2-x1)*(x1**2+y1**2-x3**2-y3**2) b=2*(x3-x1)*(y1-y2)-2*(x2-x1)*(y1-y3) py=a/b if x2-x1!=0: px=(2*(y1-y2)*py-x1**2-y1**2+x2**2+y2**2)/(2*(x2-x1)) else: px=(2*(y1-y3)*py-x1**...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,267
s064594237
p00010
u625806423
1553686965
Python
Python3
py
Accepted
20
5692
677
import math n = int(input()) positions = [] for i in range(n): positions.append(list(map(float, input().split()))) for i in range(n): ra = [positions[i][0],positions[i][1]] rb = [positions[i][2],positions[i][3]] rc = [positions[i][4],positions[i][5]] A = (rb[0]-rc[0])**2+(rb[1]-rc[1])**2 B = (rc[0]-ra[0]...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,268
s405716502
p00010
u990228206
1553159380
Python
Python3
py
Accepted
30
6452
555
from decimal import Decimal, ROUND_HALF_UP n=int(input()) for i in range(n): x1,y1,x2,y2,x3,y3=map(float,input().split()) a=2*(x1-x2) b=2*(y1-y2) c=x1**2+y1**2-x2**2-y2**2 d=2*(x1-x3) e=2*(y1-y3) f=x1**2+y1**2-x3**2-y3**2 x=(c*e-b*f)/(a*e-b*d)+0.0 y=(c*d-a*f)/(b*d-a*e)+0.0 r=((x-...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,269
s214732147
p00010
u563075864
1542255049
Python
Python3
py
Accepted
20
5716
846
n = int(input()) import math for _ in range(n): ax,ay,bx,by,cx,cy = [float(i) for i in input().split()] ab = math.sqrt((ax-bx)**2+(ay-by)**2) bc = math.sqrt((bx-cx)**2+(by-cy)**2) ca = math.sqrt((cx-ax)**2+(cy-ay)**2) cos_a = (ab**2+ca**2-bc**2)/(2*ab*ca) sin_a = math.sqrt(1-cos_a**2) r = bc...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,270
s460477095
p00010
u717526540
1541638764
Python
Python3
py
Accepted
30
6504
793
import math from decimal import Decimal, ROUND_HALF_EVEN, ROUND_HALF_UP n = int(input()) for _ in range(n): x1, y1, x2, y2, x3, y3 = map(float, input().split()) a2 = (x2-x3)**2 + (y2-y3)**2 b2 = (x1-x3)**2 + (y1-y3)**2 c2 = (x1-x2)**2 + (y1-y2)**2 area = ((x2-x1) * (y3-y1) - (x3-x1) * (y2-y1)) / ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,271
s889700742
p00010
u509278866
1536567358
Python
Python3
py
Accepted
70
9056
1,944
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**13 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin....
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,272
s685092580
p00010
u319725914
1534213490
Python
Python3
py
Accepted
20
5660
446
n = int(input()) for _ in range(n): x1,y1,x2,y2,x3,y3 = map(float, input().split()) gx = (x1+x2+x3)/3 gy = (y1+y2+y3)/3 G=( y2*x1-y1*x2 +y3*x2-y2*x3 +y1*x3-y3*x1 ) Xc= ((x1*x1+y1*y1)*(y2-y3)+(x2*x2+y2*y2)*(y3-y1)+(x3*x3+y3*y3)*(y1-y2))/(2*G) Yc=-((x1*x1+y1*y1)*(x2-x3)+(x2*x2+y2*y2)*(x3-x1)+(x3*x...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,273
s492145493
p00010
u252700163
1532751394
Python
Python3
py
Accepted
20
5688
789
def circumcenter(vert1, vert2, vert3): # H/T: wikipedia.org/wiki/Circumscribed_circle # refer from https://gist.github.com/dhermes/9ce057da49df63345c33 Ax, Ay = vert1 Bx, By = vert2 Cx, Cy = vert3 D = 2 * (Ax * (By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)) norm_A = Ax**2 + Ay**2 norm_B =...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,274
s545516481
p00010
u853158149
1521969543
Python
Python3
py
Accepted
20
5676
552
n = int(input()) ans = [] for i in range(n): ax,ay,bx,by,cx,cy = map(float, input().split(" ")) a,b,c = 2*(ax-bx),2*(ay-by),(ax+bx)*(ax-bx)+(ay+by)*(ay-by) d,e,f = 2*(ax-cx),2*(ay-cy),(ax+cx)*(ax-cx)+(ay+cy)*(ay-cy) det = a*e-b*d px = (c*e-b*f)/det py = (a*f-c*d)/det if abs(px) < 1e-4: ...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,275
s412598109
p00010
u079141094
1467343394
Python
Python3
py
Accepted
30
7748
967
# Circumscribed Circle of a Triangle import math def simul_eq(a,b,c,d,e,f): # A = [[a,b],[d,e]] C = [c,f] detA = a*e - b*d # if detA == 0: raise # det(A) == 0. At = [[e,-b],[-d,a]] x = sum(map((lambda x,y: x*y), At[0], C)) / detA y = sum(map((lambda x,y: x*y), At[1], C)) / detA fx,fy = '...
p00010
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>Circumscribed Circle of A Triangle.</H1> <p...
1 0.0 0.0 2.0 0.0 2.0 2.0
1.000 1.000 1.414
5,276
s665570502
p00011
u995990363
1530849871
Python
Python3
py
Accepted
20
5604
280
def run(): w = [i + 1 for i in range(int(input()))] n = int(input()) for _ in range(n): s1, s2 = list(map(int, input().split(','))) w[s1-1], w[s2-1] = w[s2-1], w[s1-1] print('\n'.join([str(_w) for _w in w])) if __name__ == '__main__': run()
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,277
s003690790
p00011
u733620181
1408923815
Python
Python
py
Accepted
10
4208
203
import sys n = int(sys.stdin.readline()) sys.stdin.readline() l = range(1, n+1) for line in sys.stdin: a,b = map(int, line.strip().split(',')) l[a-1], l[b-1] = l[b-1], l[a-1] for x in l: print x
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,278
s064140726
p00011
u506132575
1416115425
Python
Python
py
Accepted
20
4204
236
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys num_v = input() num_h = input() lis = range(num_v+1) for s in sys.stdin: d = map(int , s.split(",") ) lis[d[0]], lis[d[1]] = lis[d[1]], lis[d[0]] for e in lis[1:]: print e
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,279
s813196864
p00011
u342537066
1420705243
Python
Python3
py
Accepted
40
6720
219
w=int(input()) n=int(input()) lis=[i+1 for i in range(w)] for _ in range(n): a,b=map(int,input().split(",")) a-=1 b-=1 x=lis[a] lis[a]=lis[b] lis[b]=x for i in range(w): print(lis[i])
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,280
s334682831
p00011
u567380442
1422616474
Python
Python3
py
Accepted
30
6724
252
import sys f = sys.stdin w = int(f.readline()) lots = [i + 1for i in range(w)] n = int(f.readline()) for _ in range(n): a, b = map(int , f.readline().split(',')) lots[a - 1], lots[b - 1] = lots[b - 1], lots[a - 1] for i in lots: print(i)
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,281
s289426333
p00011
u879226672
1423675636
Python
Python
py
Accepted
10
4220
330
while True: try: w = int(raw_input()) n = int(raw_input()) 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 except EOFError: ...
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,282
s715890618
p00011
u744114948
1425202024
Python
Python3
py
Accepted
30
6720
295
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright : @Huki_Hara # Created : 2015-03-01 s=[] W=int(input()) n=int(input()) for i in range(W): s.append(i+1) for _ in range(n): a , b = map(int, input().split(",")) s[a-1], s[b-1] = s[b-1], s[a-1] for i in s: print(i)
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,283
s049657401
p00011
u744114948
1425202265
Python
Python3
py
Accepted
30
6720
178
s = [i + 1 for i in range(int(input()))] n = int(input()) for _ in range(n): a , b = map(int, input().split(",")) s[a-1], s[b-1] = s[b-1], s[a-1] for i in s: print(i)
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,284
s238303604
p00011
u540744789
1425660999
Python
Python
py
Accepted
10
4212
208
w=int(raw_input()) number = range(1,w+1) for i in xrange(input()): a,b=map(int,raw_input().split(",")) tmp=number[a-1] number[a-1]=number[b-1] number[b-1]=tmp print '\n'.join(map(str,number))
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,285
s057086523
p00011
u009961299
1431069745
Python
Python3
py
Accepted
30
6720
269
# -*- coding: utf-8 -*- w = int ( input ( ) ) n = int ( input ( ) ) lis = list ( range ( 1, w + 1 ) ) for i in range ( n ): ( a, b ) = map ( int, input ( ).split ( "," ) ) ( lis[ a - 1 ], lis[ b - 1 ] ) = ( lis[ b - 1 ], lis[ a - 1 ] ) for x in lis: print ( x )
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,286
s388861957
p00011
u067299340
1432874527
Python
Python
py
Accepted
10
4208
145
l=[i+1 for i in range(input())] for a,b in[map(int,raw_input().split(","))for i in range(input())]:l[a-1],l[b-1]=l[b-1],l[a-1] for i in l:print i
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,287
s476977566
p00011
u067299340
1432874601
Python
Python
py
Accepted
10
4200
134
l=range(1,input()+1) for a,b in[map(int,raw_input().split(","))for i in range(input())]:l[a-1],l[b-1]=l[b-1],l[a-1] for i in l:print i
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,288
s551812272
p00011
u067299340
1432874712
Python
Python
py
Accepted
20
4204
134
l=range(1,input()+1) for a,b in[map(int,raw_input().split(","))for i in range(input())]:l[a-1],l[b-1]=l[b-1],l[a-1] for i in l:print i
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,289
s909284868
p00011
u067299340
1432874770
Python
Python
py
Accepted
20
4200
135
l=range(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
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,290
s878015530
p00011
u067299340
1432874836
Python
Python
py
Accepted
10
4200
134
l=range(1,input()+1) for a,b in[map(int,raw_input().split(","))for i in range(input())]:l[a-1],l[b-1]=l[b-1],l[a-1] for i in l:print i
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,291
s784448983
p00011
u067299340
1432874955
Python
Python
py
Accepted
10
4200
141
l=range(1,input()+1) for x in[raw_input().split(",")for i in range(input())]: a,b=map(int,x) l[a-1],l[b-1]=l[b-1],l[a-1] for i in l:print i
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,292
s531529181
p00011
u067299340
1432874978
Python
Python
py
Accepted
10
4200
134
l=range(1,input()+1) for a,b in[map(int,raw_input().split(","))for i in range(input())]:l[a-1],l[b-1]=l[b-1],l[a-1] for i in l:print i
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,293
s563667379
p00011
u379956761
1434727827
Python
Python3
py
Accepted
30
6784
333
#!/usr/bin/env python #-*- coding:utf-8 -*- import sys import math w = int(input()) n = int(input()) s = [] for _ in range(n): x = input().split(',') s.append((int(x[0]), int(x[1]))) result = [i for i in range(1, w+1)] for x, y in s: result[x-1], result[y-1] = result[y-1], result[x-1] for x in result:...
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,294
s179096825
p00011
u749493116
1436406358
Python
Python
py
Accepted
10
4232
352
#!/usr/bin/env python # -*- coding: utf-8 -*- n = input() m = input() line = [] for i in range(0, n): line.append(i) for i in range(0, m): change = map(int, raw_input().split(',')) change[0] -= 1 change[1] -= 1 line[change[0]], line[change[1]] = line[change[1]], line[change[0]] for i in range(0, n):...
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,295
s869094245
p00011
u873482706
1437290751
Python
Python
py
Accepted
10
4212
206
ans = [i+1 for i in range(int(raw_input()))] for i in range(int(raw_input())): a, b = map(int, raw_input().split(',')) ans[b-1], ans[a-1] = ans[a-1], ans[b-1] else: for a in ans: print a
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,296
s142371054
p00011
u883062308
1438517996
Python
Python3
py
Accepted
30
6720
254
w = int(input()) n = int(input()) nums = list(range(1, w + 1)) for i in range(n): ab = input().split(",") a = int(ab[0]) - 1 b = int(ab[1]) - 1 _a = nums[a] nums[a] = nums[b] nums[b] = _a print("\n".join([str(n) for n in nums]))
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,297
s415285912
p00011
u722431421
1439560708
Python
Python
py
Accepted
20
4212
326
# coding: utf-8 #Problem Name: Drawing Lots #ID: tabris #Mail: t123037@kaiyodai.ac.jp w = int(raw_input()) n = int(raw_input()) change = [0 for _ in xrange(n)] for i in xrange(n): change[i] = eval(raw_input()) List = range(1,w+1) for i,j in change: List[i-1],List[j-1] = List[j-1],List[i-1] for i in List: p...
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,298
s133164859
p00011
u271261336
1442977081
Python
Python
py
Accepted
10
6324
209
w=int(raw_input()) number = range(1,w+1) for i in xrange(input()): a,b=map(int,raw_input().split(",")) tmp=number[a-1] number[a-1]=number[b-1] number[b-1]=tmp print '\n'.join(map(str,number))
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,299
s273769318
p00011
u140201022
1443016480
Python
Python
py
Accepted
10
6244
171
w=int(raw_input()) l=range(w+1) n=int(raw_input()) for i in range(n): x,y=map(int,raw_input().split(',')) l[x],l[y]=l[y],l[x] for i in range(1,w+1): print l[i]
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,300
s131693188
p00011
u071010747
1445228227
Python
Python3
py
Accepted
20
7720
303
def main(): LIST=[] for i in range(int(input())): LIST.append(i+1) for j in range(int(input())): a,b=map(int,input().split(",")) LIST[a-1],LIST[b-1]=LIST[b-1],LIST[a-1] for i in LIST: print(str(i)) if __name__ == '__main__': main()
p00011
<H1>Drawing Lots</H1> <p> Let's play Amidakuji. </p> <p> In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines. </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1"> </center> <br> <p>...
5 4 2,4 3,5 1,2 3,4
4 1 2 5 3
5,301