結果

問題 No.2138 Add Bacon
ユーザー chocopuu
提出日時 2022-12-17 04:00:02
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 382 bytes
コンパイル時間 13,565 ms
コンパイル使用メモリ 378,752 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-16 09:25:43
合計ジャッジ時間 14,240 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused imports: `input`, `marker::Bytes`
 --> src/main.rs:1:16
  |
1 | use proconio::{input, marker::Bytes};
  |                ^^^^^  ^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

ソースコード

diff #

use proconio::{input, marker::Bytes};
fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    let a = line
        .split_whitespace()
        .map(|x| x.parse::<i32>().unwrap())
        .collect::<Vec<_>>();
    let (a, b, c, d, e) = (a[0], a[1], a[2], a[3], a[4]);
    let ans = a - b + c * (d - e).max(0);
    println!("{}", ans);
}
0