結果

問題 No.733 分身並列コーディング
ユーザー りあんりあん
提出日時 2017-08-26 20:43:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 516 ms / 1,500 ms
コード長 506 bytes
コンパイル時間 337 ms
コンパイル使用メモリ 87,320 KB
実行使用メモリ 105,664 KB
最終ジャッジ日時 2023-08-16 14:15:25
合計ジャッジ時間 15,104 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,464 KB
testcase_01 AC 74 ms
71,460 KB
testcase_02 AC 77 ms
76,220 KB
testcase_03 AC 516 ms
105,452 KB
testcase_04 AC 499 ms
105,484 KB
testcase_05 AC 439 ms
105,392 KB
testcase_06 AC 72 ms
71,308 KB
testcase_07 AC 445 ms
105,640 KB
testcase_08 AC 449 ms
105,372 KB
testcase_09 AC 346 ms
90,956 KB
testcase_10 AC 111 ms
78,776 KB
testcase_11 AC 113 ms
78,748 KB
testcase_12 AC 76 ms
76,068 KB
testcase_13 AC 74 ms
71,236 KB
testcase_14 AC 178 ms
83,788 KB
testcase_15 AC 108 ms
78,200 KB
testcase_16 AC 72 ms
71,548 KB
testcase_17 AC 79 ms
76,540 KB
testcase_18 AC 114 ms
78,552 KB
testcase_19 AC 344 ms
90,964 KB
testcase_20 AC 348 ms
91,064 KB
testcase_21 AC 178 ms
84,012 KB
testcase_22 AC 485 ms
105,312 KB
testcase_23 AC 175 ms
84,104 KB
testcase_24 AC 171 ms
83,980 KB
testcase_25 AC 91 ms
76,760 KB
testcase_26 AC 72 ms
71,424 KB
testcase_27 AC 107 ms
78,120 KB
testcase_28 AC 449 ms
105,472 KB
testcase_29 AC 464 ms
105,532 KB
testcase_30 AC 464 ms
105,664 KB
testcase_31 AC 469 ms
105,468 KB
testcase_32 AC 129 ms
80,580 KB
testcase_33 AC 130 ms
80,412 KB
testcase_34 AC 130 ms
80,684 KB
testcase_35 AC 129 ms
80,316 KB
testcase_36 AC 130 ms
80,596 KB
testcase_37 AC 130 ms
80,540 KB
testcase_38 AC 468 ms
105,460 KB
testcase_39 AC 469 ms
105,460 KB
testcase_40 AC 470 ms
105,636 KB
testcase_41 AC 130 ms
80,532 KB
testcase_42 AC 130 ms
80,592 KB
testcase_43 AC 130 ms
80,316 KB
testcase_44 AC 463 ms
105,624 KB
testcase_45 AC 464 ms
105,496 KB
testcase_46 AC 461 ms
105,616 KB
testcase_47 AC 464 ms
105,364 KB
testcase_48 AC 465 ms
105,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

M = 1000000007
T = int(input())
n = int(input())
t = [int(input()) for i in range(n)]
dp = [[M for j in range(n + 1)] for i in range(1 << n)]
dp[0] = [0 for i in range(n + 1)]
for i in range(1, 1 << n):
    for j in range(n):
        if ((i >> j) & 1) == 1:
            for k in range(n):
                dp[i][k] = min(dp[i][k], dp[i ^ (1 << j)][k] + t[j])
                if dp[i][k] <= T:
                    dp[i][k + 1] = 0
for i in range(n + 1):
    if dp[-1][i] == 0:
        print(i)
        break
0