結果

問題 No.393 2本の竹
ユーザー hiyokko2hiyokko2
提出日時 2016-07-30 18:18:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 225 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 29,848 KB
最終ジャッジ日時 2024-04-24 13:12:49
合計ジャッジ時間 2,950 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 43 ms
10,880 KB
testcase_04 WA -
testcase_05 AC 29 ms
10,752 KB
testcase_06 WA -
testcase_07 AC 41 ms
10,752 KB
testcase_08 AC 72 ms
11,008 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

d = int(input())
for _ in range(d):
	n1, n2 = map(int, input().split())
	input()
	A = sorted(map(int, input().split()))

	ans = 0
	syugo = {(n1, n2)}
	for a in A:
		#print("a = {}".format(a))
		if syugo == set():
			break
		new_syugo = set()
		for x, y in syugo:
			if x - a >= 0:
				new_syugo.add((x - a, y))

			if y - a >= 0:
				new_syugo.add((x, y - a))
		syugo = new_syugo
		#print(syugo)
		ans += 1
	print(ans - 1)
0