結果
| 問題 |
No.1944 ∞
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 22:04:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,212 bytes |
| コンパイル時間 | 206 ms |
| コンパイル使用メモリ | 81,908 KB |
| 実行使用メモリ | 104,548 KB |
| 最終ジャッジ日時 | 2025-04-15 22:06:40 |
| 合計ジャッジ時間 | 2,978 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 WA * 13 |
ソースコード
import math
def main():
import sys
input = sys.stdin.read
data = input().split()
N = int(data[0])
X = int(data[1])
Y = int(data[2])
R = list(map(int, data[3:3+N]))
if N == 0:
print("No")
return
R_max = max(R)
sum_rest = sum(R) - R_max
max_dist = R_max + sum_rest
min_dist = abs(R_max - sum_rest)
S = math.sqrt(X**2 + Y**2)
found = False
for r_last in R:
# Check condition 1: S - r_last is between min_dist and max_dist
cond1 = (S - r_last >= min_dist - 1e-9) and (S - r_last <= max_dist + 1e-9)
# Check condition 2: S + r_last is between min_dist and max_dist
cond2 = (S + r_last >= min_dist - 1e-9) and (S + r_last <= max_dist + 1e-9)
# Check condition 3: r_last >= S and (r_last - S) is between min_dist and max_dist
cond3 = False
if r_last >= S - 1e-9:
diff = r_last - S
if (diff >= min_dist - 1e-9) and (diff <= max_dist + 1e-9):
cond3 = True
if cond1 or cond2 or cond3:
found = True
break
print("Yes" if found else "No")
if __name__ == "__main__":
main()
lam6er