結果

問題 No.733 分身並列コーディング
ユーザー りあんりあん
提出日時 2018-09-07 07:47:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 450 ms / 1,500 ms
コード長 525 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 105,544 KB
最終ジャッジ日時 2023-08-16 15:09:33
合計ジャッジ時間 11,025 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,004 KB
testcase_01 AC 72 ms
71,004 KB
testcase_02 AC 71 ms
71,068 KB
testcase_03 AC 450 ms
105,068 KB
testcase_04 AC 429 ms
105,036 KB
testcase_05 AC 218 ms
105,004 KB
testcase_06 AC 69 ms
70,948 KB
testcase_07 AC 240 ms
105,132 KB
testcase_08 AC 232 ms
104,932 KB
testcase_09 AC 238 ms
90,636 KB
testcase_10 AC 104 ms
78,344 KB
testcase_11 AC 105 ms
78,280 KB
testcase_12 AC 72 ms
71,184 KB
testcase_13 AC 71 ms
71,172 KB
testcase_14 AC 152 ms
83,820 KB
testcase_15 AC 94 ms
76,568 KB
testcase_16 AC 71 ms
71,096 KB
testcase_17 AC 77 ms
75,652 KB
testcase_18 AC 103 ms
78,580 KB
testcase_19 AC 211 ms
90,540 KB
testcase_20 AC 215 ms
90,828 KB
testcase_21 AC 155 ms
83,448 KB
testcase_22 AC 345 ms
105,020 KB
testcase_23 AC 146 ms
83,724 KB
testcase_24 AC 136 ms
83,784 KB
testcase_25 AC 88 ms
76,268 KB
testcase_26 AC 69 ms
71,268 KB
testcase_27 AC 95 ms
75,896 KB
testcase_28 AC 244 ms
105,188 KB
testcase_29 AC 276 ms
105,260 KB
testcase_30 AC 282 ms
104,800 KB
testcase_31 AC 285 ms
104,940 KB
testcase_32 AC 113 ms
80,200 KB
testcase_33 AC 113 ms
80,032 KB
testcase_34 AC 111 ms
79,724 KB
testcase_35 AC 109 ms
80,084 KB
testcase_36 AC 111 ms
80,228 KB
testcase_37 AC 111 ms
79,724 KB
testcase_38 AC 256 ms
105,024 KB
testcase_39 AC 257 ms
104,816 KB
testcase_40 AC 263 ms
105,180 KB
testcase_41 AC 110 ms
80,116 KB
testcase_42 AC 110 ms
80,276 KB
testcase_43 AC 112 ms
79,904 KB
testcase_44 AC 257 ms
104,964 KB
testcase_45 AC 266 ms
105,544 KB
testcase_46 AC 286 ms
105,384 KB
testcase_47 AC 260 ms
104,836 KB
testcase_48 AC 266 ms
105,152 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 + 1):
        if j > 0 and dp[i][j - 1] <= T:
            dp[i][j] = 0
            continue
        for k in range(n):
            if ((i >> k) & 1) == 1:
                dp[i][j] = min(dp[i][j], dp[i ^ (1 << k)][j] + t[k])
for i in range(n + 1):
    if dp[-1][i] == 0:
        print(i)
        break
0