結果

問題 No.998 Four Integers
コンテスト
ユーザー ixTL255
提出日時 2023-03-04 23:40:51
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 1,000 ms
+ 841µs
コード長 439 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,499 ms
コンパイル使用メモリ 183,136 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-29 22:42:50
合計ジャッジ時間 11,195 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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