結果

問題 No.143 豆
ユーザー natu7925s
提出日時 2025-06-12 15:20:38
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 341 bytes
コンパイル時間 28,253 ms
コンパイル使用メモリ 397,832 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-06-12 15:21:08
合計ジャッジ時間 27,622 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

// yukicoder Lv.1 No.143 豆
use proconio::input;

fn main() {
    input! {
        k: i32,
        n: i32,
        f: usize,
        a: [i32; f],
    }

    let totalmame = k * n;
    let asum: i32 = a.iter().sum();
    let ans: i32 = if totalmame >= asum {
        totalmame - asum
    } else {
        -1
    };
    println!("{}", ans);
}
0