結果

問題 No.1940 Escape through + -
ユーザー ixTL255
提出日時 2023-02-16 23:39:38
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 618 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,103 ms
コンパイル使用メモリ 202,368 KB
実行使用メモリ 202,952 KB
最終ジャッジ日時 2026-04-02 12:48:37
合計ジャッジ時間 7,598 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

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