結果
問題 |
No.733 分身並列コーディング
|
ユーザー |
![]() |
提出日時 | 2024-04-06 04:34:23 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 376 bytes |
コンパイル時間 | 174 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 18,048 KB |
最終ジャッジ日時 | 2024-10-01 03:42:23 |
合計ジャッジ時間 | 3,379 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | TLE * 1 -- * 45 |
ソースコード
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)