結果
| 問題 | 
                            No.1360 [Zelkova 4th Tune] 協和音
                             | 
                    
| コンテスト | |
| ユーザー | 
                             yuusanlondon
                         | 
                    
| 提出日時 | 2021-01-22 21:37:21 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 473 bytes | 
| コンパイル時間 | 468 ms | 
| コンパイル使用メモリ | 81,920 KB | 
| 実行使用メモリ | 76,160 KB | 
| 最終ジャッジ日時 | 2024-12-27 22:19:05 | 
| 合計ジャッジ時間 | 9,787 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 3 WA * 44 | 
ソースコード
n=int(input())
a=list(map(int,input().split()))
b=[]
for _ in range(n):
  b.append(list(map(int,input().split())))
maxscore=0
bestans=0
for i in range(2**n):
  bells=[]
  for j in range(n):
    if 1<<j&i:
      bells.append(j)
  ans=0
  for j in range(len(bells)):
    ans+=a[bells[j]]
    for k in range(j+1,len(bells)):
      ans+=b[bells[j]][bells[k]]
  if ans>maxscore:
    maxscore=ans
    bestans=i
print(maxscore)
for i in range(n):
  if 1<<i&bestans:
    print(i+1)
            
            
            
        
            
yuusanlondon