結果

問題 No.2555 Intriguing Triangle
ユーザー navel_tosnavel_tos
提出日時 2023-12-01 21:29:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 56 ms / 2,000 ms
コード長 443 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 64,552 KB
最終ジャッジ日時 2023-12-01 21:30:00
合計ジャッジ時間 2,644 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,588 KB
testcase_01 AC 38 ms
53,588 KB
testcase_02 AC 38 ms
53,588 KB
testcase_03 AC 37 ms
53,588 KB
testcase_04 AC 42 ms
59,984 KB
testcase_05 AC 41 ms
53,588 KB
testcase_06 AC 37 ms
53,588 KB
testcase_07 AC 36 ms
53,588 KB
testcase_08 AC 37 ms
53,588 KB
testcase_09 AC 38 ms
53,588 KB
testcase_10 AC 46 ms
62,468 KB
testcase_11 AC 37 ms
53,588 KB
testcase_12 AC 56 ms
62,500 KB
testcase_13 AC 47 ms
62,424 KB
testcase_14 AC 45 ms
62,468 KB
testcase_15 AC 43 ms
60,376 KB
testcase_16 AC 41 ms
59,608 KB
testcase_17 AC 35 ms
53,588 KB
testcase_18 AC 38 ms
53,588 KB
testcase_19 AC 36 ms
53,588 KB
testcase_20 AC 36 ms
53,588 KB
testcase_21 AC 49 ms
64,552 KB
testcase_22 AC 37 ms
53,588 KB
testcase_23 AC 37 ms
53,588 KB
testcase_24 AC 37 ms
53,588 KB
testcase_25 AC 42 ms
59,600 KB
testcase_26 AC 40 ms
59,648 KB
testcase_27 AC 40 ms
59,652 KB
testcase_28 AC 37 ms
53,588 KB
testcase_29 AC 43 ms
60,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
a,b,c = [int(input()) for _ in range(3)]
for z in range(2+a,b+c):
  for x in range(1,z+1):
    y = z-a-x
    if y < 1: continue
    sqR = b**2 + x**2 - (b**2 + z**2 - c**2) * x / z
    sqS = c**2 + y**2 - (c**2 + z**2 - b**2) * y / z
    R,S = math.sqrt(sqR), math.sqrt(sqS)
    if abs((b**2 + sqR - x**2) * 2 * c * S - (c**2 + sqS - y**2) * 2 * b * R ) < 1e-7:
      if b+z > c and c+z > b: print('Yes'); exit()
      
print('No')
0