結果

問題 No.733 分身並列コーディング
ユーザー vwxyzvwxyz
提出日時 2024-04-06 04:34:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,334 ms / 1,500 ms
コード長 376 bytes
コンパイル時間 412 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 78,008 KB
最終ジャッジ日時 2024-04-06 04:35:00
合計ジャッジ時間 27,680 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,460 KB
testcase_01 AC 36 ms
53,460 KB
testcase_02 AC 38 ms
53,460 KB
testcase_03 AC 1,270 ms
77,880 KB
testcase_04 AC 1,334 ms
77,880 KB
testcase_05 AC 746 ms
77,880 KB
testcase_06 AC 37 ms
53,460 KB
testcase_07 AC 864 ms
78,008 KB
testcase_08 AC 773 ms
78,008 KB
testcase_09 AC 502 ms
76,860 KB
testcase_10 AC 102 ms
76,076 KB
testcase_11 AC 100 ms
76,076 KB
testcase_12 AC 38 ms
53,460 KB
testcase_13 AC 37 ms
53,460 KB
testcase_14 AC 228 ms
76,332 KB
testcase_15 AC 89 ms
76,064 KB
testcase_16 AC 38 ms
53,460 KB
testcase_17 AC 44 ms
59,592 KB
testcase_18 AC 104 ms
76,076 KB
testcase_19 AC 487 ms
76,988 KB
testcase_20 AC 503 ms
76,988 KB
testcase_21 AC 230 ms
76,332 KB
testcase_22 AC 1,294 ms
78,008 KB
testcase_23 AC 239 ms
76,332 KB
testcase_24 AC 245 ms
76,332 KB
testcase_25 AC 57 ms
66,284 KB
testcase_26 AC 38 ms
53,460 KB
testcase_27 AC 90 ms
76,064 KB
testcase_28 AC 892 ms
78,008 KB
testcase_29 AC 1,293 ms
78,008 KB
testcase_30 AC 1,285 ms
78,008 KB
testcase_31 AC 1,300 ms
78,008 KB
testcase_32 AC 136 ms
76,188 KB
testcase_33 AC 132 ms
76,188 KB
testcase_34 AC 133 ms
76,188 KB
testcase_35 AC 132 ms
76,188 KB
testcase_36 AC 134 ms
76,188 KB
testcase_37 AC 134 ms
76,188 KB
testcase_38 AC 1,242 ms
78,008 KB
testcase_39 AC 1,252 ms
78,008 KB
testcase_40 AC 1,168 ms
78,008 KB
testcase_41 AC 135 ms
76,188 KB
testcase_42 AC 139 ms
76,188 KB
testcase_43 AC 134 ms
76,188 KB
testcase_44 AC 1,259 ms
78,008 KB
testcase_45 AC 1,259 ms
78,008 KB
testcase_46 AC 1,263 ms
78,008 KB
testcase_47 AC 1,285 ms
78,008 KB
testcase_48 AC 1,255 ms
78,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
N=int(input())
time=[int(input()) for i in range(N)]
inf=1<<30
dp=[inf]*(1<<N)
dp[0]=0
sum_time=[sum(time[i] for i in range(N)if bit&1<<i) for bit in range(1<<N)]
for bit in range(1<<N):
    subset=bit
    while subset:
        if sum_time[subset]<=T:
            dp[bit]=min(dp[bit],dp[bit^subset]+1)
        subset-=1
        subset&=bit
ans=dp[-1]
print(ans)
0