結果

問題 No.2155 みちらcolor
ユーザー tonyu0
提出日時 2022-12-09 21:49:29
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 747 bytes
コンパイル時間 16,713 ms
コンパイル使用メモリ 387,444 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-14 21:32:17
合計ジャッジ時間 16,539 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 60 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;
fn main() {
    let mut input: String = String::new();
    std::io::stdin().read_to_string(&mut input).ok();
    let mut itr = input.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let m: usize = itr.next().unwrap().parse().unwrap();
    let l: usize = itr.next().unwrap().parse().unwrap();
    let a: Vec<usize> = (0..n)
        .map(|_| itr.next().unwrap().parse().unwrap())
        .collect();

    let mut used = vec![false; 1001];
    used[l] = true;
    for i in 0..n {
        for j in 0..=1000 {
            if used[j] {
                let nv = (j + a[i]) / 2;
                used[nv] = true;
            }
        }
    }
    println!("{}", if used[m] { "Yes" } else { "No" });
}
0