提出 #65043290


ソースコード 拡げる

(N,X),*SCP = $<.map{|ln| ln.split.map(&:to_i) }
S = [0]
SCP.map!.with_index{|(s,c,p),q|
	S.concat S.map{_1+s}
	[c,p*0.01,1<<q]
}
M = (1<<N)-1
MM = [nil]*((X+1)<<N)
F = lambda{|x,qs|
	MM[x<<N|qs] ||= SCP.filter_map{|c,p,q|
		F[x-c,qs|q]*p+F[x-c,qs]*(1-p) if qs&q<1 && c<=x
	}.max||S[qs&M]
}
p F[X,0]

提出情報

提出日時
問題 E - Payment Required
ユーザ ds14050
言語 Ruby (ruby 3.2.2)
得点 450
コード長 313 Byte
結果 AC
実行時間 1806 ms
メモリ 43112 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 450 / 450
結果
AC × 4
AC × 43
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 02_random_20.txt, 02_random_21.txt, 02_random_22.txt, 02_random_23.txt, 02_random_24.txt, 02_random_25.txt, 02_random_26.txt, 02_random_27.txt, 02_random_28.txt, 02_random_29.txt, 02_random_30.txt, 02_random_31.txt, 02_random_32.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 44 ms 17292 KiB
00_sample_01.txt AC 44 ms 17368 KiB
00_sample_02.txt AC 44 ms 17464 KiB
00_sample_03.txt AC 54 ms 17924 KiB
01_handmade_00.txt AC 43 ms 17084 KiB
01_handmade_01.txt AC 43 ms 17224 KiB
01_handmade_02.txt AC 54 ms 29028 KiB
01_handmade_03.txt AC 53 ms 29280 KiB
01_handmade_04.txt AC 1800 ms 43112 KiB
01_handmade_05.txt AC 1806 ms 42372 KiB
02_random_00.txt AC 45 ms 17744 KiB
02_random_01.txt AC 43 ms 17236 KiB
02_random_02.txt AC 45 ms 18020 KiB
02_random_03.txt AC 42 ms 17112 KiB
02_random_04.txt AC 43 ms 17456 KiB
02_random_05.txt AC 130 ms 30856 KiB
02_random_06.txt AC 84 ms 30092 KiB
02_random_07.txt AC 56 ms 25716 KiB
02_random_08.txt AC 193 ms 29952 KiB
02_random_09.txt AC 44 ms 17516 KiB
02_random_10.txt AC 49 ms 27560 KiB
02_random_11.txt AC 45 ms 18876 KiB
02_random_12.txt AC 206 ms 29440 KiB
02_random_13.txt AC 45 ms 17524 KiB
02_random_14.txt AC 49 ms 27484 KiB
02_random_15.txt AC 43 ms 17132 KiB
02_random_16.txt AC 48 ms 27480 KiB
02_random_17.txt AC 43 ms 17372 KiB
02_random_18.txt AC 48 ms 27396 KiB
02_random_19.txt AC 51 ms 23264 KiB
02_random_20.txt AC 897 ms 36144 KiB
02_random_21.txt AC 44 ms 17372 KiB
02_random_22.txt AC 50 ms 27540 KiB
02_random_23.txt AC 45 ms 17644 KiB
02_random_24.txt AC 49 ms 27556 KiB
02_random_25.txt AC 58 ms 23440 KiB
02_random_26.txt AC 1763 ms 42424 KiB
02_random_27.txt AC 63 ms 29448 KiB
02_random_28.txt AC 1785 ms 43052 KiB
02_random_29.txt AC 52 ms 23396 KiB
02_random_30.txt AC 1691 ms 42976 KiB
02_random_31.txt AC 58 ms 23436 KiB
02_random_32.txt AC 1722 ms 42876 KiB