結果
問題 |
No.519 アイドルユニット
|
ユーザー |
|
提出日時 | 2022-03-08 16:58:43 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 454 bytes |
コンパイル時間 | 618 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 220,532 KB |
最終ジャッジ日時 | 2024-07-23 16:57:18 |
合計ジャッジ時間 | 5,076 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | TLE * 1 -- * 33 |
ソースコード
n = int(input()) F = [list(map(int,input().split())) for _ in range(n)] dp = [1] * (1 << n) dp[0] = 0 for bit in range(1 << n): if dp[bit] < 0:continue for i in range(n): if bit & (1 << i):continue b = bit | (1 <<i) for j in range(i+1,n): if bit & (1 << j):continue bj = b | (1 << j) if dp[bj] < dp[bit] + F[i][j]: dp[bj] = dp[bit] + F[i][j] break print(dp[-1])