結果

問題 No.1944 ∞
ユーザー gew1fw
提出日時 2025-06-12 19:13:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 625 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 101,504 KB
最終ジャッジ日時 2025-06-12 19:13:56
合計ジャッジ時間 2,736 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

def main():
    import sys
    input = sys.stdin.read().split()
    ptr = 0
    N = int(input[ptr])
    ptr += 1
    X = int(input[ptr])
    ptr += 1
    Y = int(input[ptr])
    ptr += 1
    R = list(map(int, input[ptr:ptr+N]))
    ptr += N

    if N == 1:
        d = math.hypot(X, Y)
        if abs(d - R[0]) < 1e-9:
            print("Yes")
        else:
            print("No")
        return

    S = 0
    for i in range(N-1):
        S += R[i] + R[i+1]

    d = math.hypot(X, Y)
    R_N = R[-1]
    if d <= S + R_N:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
0