結果
問題 |
No.1381 Simple Geometry 1
|
ユーザー |
|
提出日時 | 2021-02-07 20:51:27 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 711 bytes |
コンパイル時間 | 133 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,392 KB |
最終ジャッジ日時 | 2024-07-04 13:56:27 |
合計ジャッジ時間 | 2,249 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 2 WA * 27 |
ソースコード
from decimal import Decimal def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] x, y, z, w = map(int, input().split()) d = make_divisors(x) for i in d: oth = x // i if i < z or oth < y: continue try: if Decimal(str(y ** 2 + i ** 2)) ** Decimal("0.5") - Decimal(str(z ** 2 + oth ** 2)) ** Decimal("0.5") == Decimal(str(w)): print(x - y * i / 2 - z * oth / 2 - (i - z) * (oth - y) / 2) break except: continue