結果

問題 No.2621 Fee Schedule
ユーザー ktmtr005
提出日時 2024-02-12 23:38:35
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 456 bytes
コンパイル時間 28,524 ms
コンパイル使用メモリ 402,256 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-09-28 18:14:22
合計ジャッジ時間 13,186 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::stdin;
fn main() {
    let inp = input();
    let (a, b, c) = (inp[0], inp[1], inp[2]);
    println!("{}", solve(a, b, c));
}

fn input() -> Vec<i32> {
    let mut a = String::new();
    stdin().read_line(&mut a).unwrap();
    return a.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect::<Vec<i32>>();
}

fn solve(a: i32, b: i32, c: i32) -> i32 {
    let plan_a = a * c;
    let plan_b = b;
    std::cmp::min(plan_a, plan_b)
}
0