結果

問題 No.998 Four Integers
ユーザー ixTL255
提出日時 2023-03-04 23:40:51
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 439 bytes
コンパイル時間 11,900 ms
コンパイル使用メモリ 389,288 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-18 01:26:33
合計ジャッジ時間 13,163 ms
ジャッジサーバーID
(参考情報)
judge3 / judge6
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    abcd.sort();

    let mut ans = false;
    for x in abcd.windows(2) {
        if x[0] + 1 == x[1] { ans = true }
        else { ans = false }               
    };

    println!("{}",
        if ans { "Yes" }
        else { "No" }
    );
}
0