結果

問題 No.1944 ∞
ユーザー ixTL255
提出日時 2023-01-30 22:31:29
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 796 bytes
コンパイル時間 13,082 ms
コンパイル使用メモリ 405,664 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 06:40:01
合計ジャッジ時間 14,520 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 35 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let x: i64 = itr.next().unwrap().parse().unwrap();
    let y: i64 = itr.next().unwrap().parse().unwrap();
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut r: Vec<i64> = s.trim().split_whitespace().map(|e| e.parse().unwrap()).collect();

    if n == 1 {
        if x * x + y * y == r[0] * r[0] { println!("Yes"); }
        else {println!("No"); }
        return;
    }
    else {
        r.sort();
        let a = r.iter().sum::<i64>();
        let b = 2 * a - r[0];
        if x * x + y * y <= b * b { println!("Yes"); }
        else { println!("No"); }
    }
}
0