結果

問題 No.1940 Escape through + -
ユーザー ixTL255
提出日時 2023-02-16 23:39:38
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 618 bytes
コンパイル時間 11,329 ms
コンパイル使用メモリ 393,448 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-18 22:32:56
合計ジャッジ時間 13,184 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `n`
 --> src/main.rs:5:9
  |
5 |     let n: isize = itr.next().unwrap().parse().unwrap();
  |         ^ help: if this is intentional, prefix it with an underscore: `_n`
  |
  = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: isize = itr.next().unwrap().parse().unwrap();
    let m: isize = itr.next().unwrap().parse().unwrap();
    let s: isize = itr.next().unwrap().parse().unwrap();
    let mut t = String::new();
    std::io::stdin().read_line(&mut t).ok();
    let itr = t.trim().split_whitespace();
    let a: Vec<isize> = itr.map(|x| x.parse().unwrap()).collect();

    let t: isize = a.iter().sum();

    println!("{}",
        if (t % m) == (s % m) { "Yes" }
        else { "No" }
    );
}
0