結果
問題 | No.393 2本の竹 |
ユーザー | nebukuro09 |
提出日時 | 2016-10-29 17:20:05 |
言語 | PyPy2 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 575 bytes |
コンパイル時間 | 1,293 ms |
コンパイル使用メモリ | 76,836 KB |
実行使用メモリ | 90,708 KB |
最終ジャッジ日時 | 2024-05-03 15:53:10 |
合計ジャッジ時間 | 3,237 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 87 ms
84,404 KB |
testcase_01 | AC | 72 ms
75,392 KB |
testcase_02 | TLE | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
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 | -- | - |
ソースコード
d = input() def rec(p, m, A, L): if p > m-1: return True if A[p] <= L[0]: L[0] -= A[p] if rec(p+1, m, A, L): return True L[0] += A[p] if A[p] <= L[1]: L[1] -= A[p] if rec(p+1, m, A, L): return True L[1] += A[p] return False def solve(A, L): for i in xrange(len(A), -1, -1): if rec(0, i, A, L): print i break for i in xrange(d): L = map(int, raw_input().split()) input() A = sorted(map(int, raw_input().split())) solve(A, L)