結果

問題 No.1944 ∞
ユーザー ixTL255
提出日時 2023-01-30 21:45:03
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 826 bytes
コンパイル時間 12,847 ms
コンパイル使用メモリ 387,060 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-06-30 06:06:20
合計ジャッジ時間 14,584 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 WA * 10
権限があれば一括ダウンロードができます

ソースコード

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: isize = itr.next().unwrap().parse().unwrap();
    let y: isize = itr.next().unwrap().parse().unwrap();
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut r: Vec<isize> = s.trim().split_whitespace().map(|x| x.parse().unwrap()).collect();  
    r.sort();

    if n == 0 {
        if x * x + y * y == r[0] * r[0] { println!("Yes"); }
        else {println!("No"); }
        return;
    }
    else {
        let mut a: isize = 0;
        for i in 1..r.len() { a += r[i]; }
        if 4 * (a - r[0]) * (a - r[0]) >= x * x + y * y { println!("Yes"); }
        else { println!("No"); }
    }
}
0