結果

問題 No.32 貯金箱の憂鬱
ユーザー mottodoramottodora
提出日時 2016-10-15 12:25:24
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 502 bytes
コンパイル時間 1,852 ms
コンパイル使用メモリ 125,260 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-30 08:15:51
合計ジャッジ時間 2,638 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,384 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

fn getline() -> String{
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    return ret;
}

fn count(l:i32, m:i32, n:i32) -> i32 {
    let m_2 = n / 25;
    let l_2 = (m + m_2) / 4;
    return n%25+(m+m_2)%4+(l+l_2)%10

}

fn main() {
    let s = getline();
    let l:i32 = s.trim().parse().unwrap();
    let s = getline();
    let m:i32 = s.trim().parse().unwrap();
    let s = getline();
    let n:i32 = s.trim().parse().unwrap();

    println!("{}", count(l, m, n));
}
0