結果

問題 No.41 貯金箱の溜息(EASY)
ユーザー pessimist
提出日時 2025-06-15 15:24:30
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 15 ms / 5,000 ms
コード長 398 bytes
コンパイル時間 15,125 ms
コンパイル使用メモリ 400,984 KB
実行使用メモリ 7,840 KB
最終ジャッジ日時 2025-06-15 15:24:46
合計ジャッジ時間 13,379 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::*;
fn main(){
    input!{
        t: usize,
        l: [usize; t]
    }

    const MOD: usize = 1_000_000_009;
    const PARAM: usize = 111_111;
    let mx = *l.iter().max().unwrap() / PARAM;
    let mut dp = vec![1; mx+1];
    for i in 1..10{
        for j in i..=mx{
            dp[j]=(dp[j]+dp[j-i])%MOD;
        }
    }
    for i in l{
        println!("{}", dp[i/PARAM]);
    }
}
0