結果
| 問題 | No.1360 [Zelkova 4th Tune] 協和音 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-21 14:06:29 |
| 言語 | Python3 (3.14.2 + numpy 2.4.0 + scipy 1.16.3) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 572 bytes |
| 記録 | |
| コンパイル時間 | 95 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 16,128 KB |
| 最終ジャッジ日時 | 2024-10-10 07:28:43 |
| 合計ジャッジ時間 | 7,267 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 TLE * 1 -- * 21 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
B = []
for _ in range(N):
B.append(list(map(int, input().split())))
Max = -float('inf')
Max_comb = -1
for i in range(1 << N):
point = 0
prev = []
for j in range(N):
if (i & (1 << j)) != 0:
point += A[j]
for p in prev:
point += B[p][j]
prev.append(j)
if Max < point:
Max = point
Max_comb = i
J = []
for j in range(N):
if (Max_comb & (1 << j)) != 0:
J.append(str(j+1))
print(Max)
print(' '.join(J))