結果

問題 No.617 Nafmo、買い出しに行く
ユーザー 👑 hos.lyrichos.lyric
提出日時 2020-03-31 10:24:58
言語 Ruby
(3.3.0)
結果
AC  
実行時間 302 ms / 2,000 ms
コード長 134 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 11,220 KB
実行使用メモリ 31,612 KB
最終ジャッジ日時 2023-09-06 06:04:48
合計ジャッジ時間 5,751 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
15,052 KB
testcase_01 AC 82 ms
15,260 KB
testcase_02 AC 83 ms
15,252 KB
testcase_03 AC 97 ms
16,196 KB
testcase_04 AC 82 ms
15,096 KB
testcase_05 AC 110 ms
17,316 KB
testcase_06 AC 302 ms
31,432 KB
testcase_07 AC 300 ms
31,420 KB
testcase_08 AC 82 ms
15,160 KB
testcase_09 AC 82 ms
15,336 KB
testcase_10 AC 300 ms
31,612 KB
testcase_11 AC 298 ms
31,608 KB
testcase_12 AC 300 ms
31,408 KB
testcase_13 AC 296 ms
29,856 KB
testcase_14 AC 301 ms
31,520 KB
testcase_15 AC 275 ms
23,412 KB
testcase_16 AC 278 ms
23,264 KB
testcase_17 AC 277 ms
23,452 KB
testcase_18 AC 82 ms
15,256 KB
testcase_19 AC 81 ms
15,212 KB
testcase_20 AC 81 ms
15,232 KB
testcase_21 AC 82 ms
15,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n,k=gets.split.map &:to_i
s=Array.new(1<<n,0)
n.times{|i|
  a=gets.to_i
  (1<<i).times{|h|s[h|1<<i]=s[h]+a}
}
p s.select{|x|x<=k}.max
0