結果

問題 No.50 おもちゃ箱
ユーザー ytftytft
提出日時 2022-11-06 01:20:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 77,852 KB
最終ジャッジ日時 2023-09-27 00:26:34
合計ジャッジ時間 32,063 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 69 ms
71,464 KB
testcase_04 AC 69 ms
71,180 KB
testcase_05 AC 987 ms
77,152 KB
testcase_06 WA -
testcase_07 AC 72 ms
71,564 KB
testcase_08 AC 72 ms
71,508 KB
testcase_09 AC 71 ms
71,564 KB
testcase_10 AC 71 ms
71,520 KB
testcase_11 AC 75 ms
75,792 KB
testcase_12 AC 73 ms
71,704 KB
testcase_13 AC 73 ms
71,528 KB
testcase_14 AC 89 ms
76,652 KB
testcase_15 AC 73 ms
71,316 KB
testcase_16 WA -
testcase_17 AC 1,057 ms
77,132 KB
testcase_18 AC 171 ms
77,048 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 211 ms
77,096 KB
testcase_22 AC 1,350 ms
77,068 KB
testcase_23 AC 134 ms
77,168 KB
testcase_24 AC 70 ms
71,320 KB
testcase_25 AC 70 ms
71,412 KB
testcase_26 AC 90 ms
76,772 KB
testcase_27 AC 229 ms
77,196 KB
testcase_28 AC 1,398 ms
77,496 KB
testcase_29 AC 1,398 ms
76,768 KB
testcase_30 AC 1,273 ms
77,104 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 1,404 ms
77,092 KB
testcase_39 AC 1,273 ms
77,308 KB
testcase_40 WA -
testcase_41 AC 1,495 ms
76,980 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,itertools
input=lambda:sys.stdin.readline().rstrip()
N=int(input())
A=list(map(int,input().split()))
M=int(input())
B=sorted(list(map(int,input().split())))[::-1]
A=itertools.permutations(A)
ans=-1
for i in A:
	temp=[0 for i in range(M)]
	for j in i:
		for k in range(M):
			if temp[k]+j<=B[k]:
				temp[k]+=j
				break
		else:
			break
	else:
		ans=max(ans,M-temp.count(0))
print(ans)
0