結果

問題 No.5 数字のブロック
ユーザー Haniwa
提出日時 2025-09-22 20:41:42
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 332 bytes
コンパイル時間 11,866 ms
コンパイル使用メモリ 400,364 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2025-09-22 20:41:55
合計ジャッジ時間 11,934 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20 WA * 7 RE * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn rec(count: usize, rest: usize, w: Vec<usize>) -> usize {
    if rest <= w[count] {
        count
    } else {
        rec(count+1, rest - w[count], w)
    }
}

fn main() {
    input! {
        l: usize,
        n: usize,
        mut w: [usize; n],
    }


    w.sort();

    println!("{}", rec(0, l, w));
}
0