結果

問題 No.669 対決!!! 飲み比べ
ユーザー phspls
提出日時 2022-12-31 15:26:09
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 575 bytes
コンパイル時間 11,972 ms
コンパイル使用メモリ 406,680 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-26 12:57:04
合計ジャッジ時間 13,281 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `n`
 --> src/main.rs:6:9
  |
6 |     let n = nk[0];
  |         ^ help: if this is intentional, prefix it with an underscore: `_n`
  |
  = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #

fn main() {
    let mut nk = String::new();
    std::io::stdin().read_line(&mut nk).ok();
    let nk: Vec<usize> = nk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();
    let n = nk[0];
    let k = nk[1];
    let mut a = String::new();
    std::io::stdin().read_line(&mut a).ok();
    let a: Vec<usize> = a.trim().split_whitespace().map(|s| s.parse().unwrap()).collect();

    let start_win_cnt = a.iter()
        .filter(|&&v| v % (k+1) > 0)
        .count();
    if start_win_cnt == 0 {
        println!("NO");
    } else {
        println!("YES");
    }
}
0