結果
問題 |
No.943 取り調べ
|
ユーザー |
![]() |
提出日時 | 2019-12-05 22:17:08 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 325 bytes |
コンパイル時間 | 176 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 27,556 KB |
最終ジャッジ日時 | 2024-12-23 01:37:37 |
合計ジャッジ時間 | 17,125 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 19 TLE * 5 |
ソースコード
n = int(input()) b = [ int(''.join(list(reversed(input().replace(" ", "")))), 2) for i in range(n) ] a = list(map(int, input().split())) dp = [1 << 28] * (1 << n) dp[0] = 0 for i in range(1 << n): for j in range(n): dp[i | 1 << j] = min(dp[i | 1 << j], dp[i] + (0 if (i & b[j]) == b[j] else a[j])) print(dp[-1])