結果

問題 No.1944 ∞
コンテスト
ユーザー ixTL255
提出日時 2023-01-30 22:31:29
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
WA  
実行時間 -
コード長 796 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,004 ms
コンパイル使用メモリ 188,672 KB
実行使用メモリ 6,144 KB
最終ジャッジ日時 2026-03-20 01:37:59
合計ジャッジ時間 2,020 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 36 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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