結果

問題 No.2555 Intriguing Triangle
ユーザー mkawa2mkawa2
提出日時 2023-12-02 18:18:57
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 2,657 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 81,828 KB
実行使用メモリ 78,256 KB
最終ジャッジ日時 2023-12-02 18:19:09
合計ジャッジ時間 10,666 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,588 KB
testcase_01 AC 77 ms
75,356 KB
testcase_02 AC 67 ms
73,580 KB
testcase_03 AC 89 ms
75,380 KB
testcase_04 AC 132 ms
76,020 KB
testcase_05 AC 47 ms
61,188 KB
testcase_06 AC 41 ms
59,084 KB
testcase_07 AC 54 ms
66,096 KB
testcase_08 AC 65 ms
72,796 KB
testcase_09 AC 150 ms
76,008 KB
testcase_10 AC 605 ms
78,184 KB
testcase_11 AC 737 ms
75,872 KB
testcase_12 AC 1,362 ms
78,020 KB
testcase_13 AC 1,012 ms
78,256 KB
testcase_14 AC 670 ms
78,120 KB
testcase_15 AC 366 ms
76,896 KB
testcase_16 AC 473 ms
76,012 KB
testcase_17 AC 38 ms
53,460 KB
testcase_18 AC 106 ms
75,616 KB
testcase_19 AC 53 ms
65,968 KB
testcase_20 AC 38 ms
53,460 KB
testcase_21 TLE -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

# sys.setrecursionlimit(1000005)
# sys.set_int_max_str_digits(200005)
int1 = lambda x: int(x)-1
pDB = lambda *x: print(*x, end="\n", file=sys.stderr)
p2D = lambda x: print(*x, sep="\n", end="\n\n", file=sys.stderr)
def II(): return int(sys.stdin.readline())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def SI(): return sys.stdin.readline().rstrip()

dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = -1-(-1 << 31)
# inf = -1-(-1 << 63)
# md = 10**9+7
md = 998244353

# 実数 a√b/c
class Real:
    def gcd(self,a,b):
        while b:a,b=b,a%b
        return a

    def __init__(self,a,b=1,c=1):
        assert b>0 and c>0
        while b&3==0:
            b>>=2
            a<<=1
        p=3
        while 1:
            q=p**2
            while b%q==0:
                b//=q
                a*=p
            if q>b:break
            p+=2
        g=self.gcd(a,c)
        a//=g
        c//=g
        self.a,self.b,self.c=a,b,c

    def __add__(self, other):
        assert self.b==other.b
        g=self.gcd(self.c,other.c)
        c=self.c*other.c//g
        a=self.a*other.c//g+self.c*other.a//g
        return Real(a,self.b,c)

    def __sub__(self, other):
        assert self.b==other.b
        g=self.gcd(self.c,other.c)
        c=self.c*other.c//g
        a=self.a*other.c//g-self.c*other.a//g
        return Real(a,self.b,c)

    def __mul__(self, other):
        return Real(self.a*other.a,self.b*other.b,self.c*other.c)

    def __truediv__(self, other):
        return self*Real(other.c,other.b,other.a*other.b)

    def __eq__(self, other):
        return self.a==other.a and self.b==other.b and self.c==other.c

    def sqrt(self):
        assert self.b==1
        return Real(1,self.a*self.c,self.c)

    def __repr__(self):
        return str(self.a)+"√"+str(self.b)+"/"+str(self.c)

def yog(b,c,cosA):
    return (b*b+c*c-Real(2)*b*c*cosA).sqrt()

def inv_yog(a,b,c):
    return (b*b+c*c-a*a)/(Real(2)*b*c)

def f(a,b,c,x,y):
    a=Real(a)
    b=Real(b)
    c=Real(c)
    x=Real(x)
    y=Real(y)
    cosB=inv_yog(c,b,x+a+y)
    AD=yog(b,x,cosB)
    res=inv_yog(x,b,AD)
    return res

a=II()
b=II()
c=II()
if b<c:b,c=c,b

for x in range(1,b+c-a-1):
    for y in range(max(1,b+1-x-a-c),b+c-x-a):
        # print(x,y,f(a,b,c,x,y),f(a,c,b,y,x))
        if f(a,b,c,x,y)==f(a,c,b,y,x):
            print("Yes")
            exit()

print("No")
0