結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー yuusanlondonyuusanlondon
提出日時 2021-01-22 21:39:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 511 bytes
コンパイル時間 1,092 ms
コンパイル使用メモリ 86,996 KB
実行使用メモリ 77,300 KB
最終ジャッジ日時 2023-08-27 18:02:44
合計ジャッジ時間 13,533 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,280 KB
testcase_01 AC 75 ms
71,532 KB
testcase_02 AC 75 ms
71,256 KB
testcase_03 AC 73 ms
71,496 KB
testcase_04 AC 73 ms
71,500 KB
testcase_05 AC 74 ms
71,352 KB
testcase_06 AC 74 ms
71,300 KB
testcase_07 AC 73 ms
71,276 KB
testcase_08 AC 73 ms
71,284 KB
testcase_09 AC 75 ms
71,308 KB
testcase_10 AC 78 ms
71,268 KB
testcase_11 AC 76 ms
71,140 KB
testcase_12 AC 77 ms
71,352 KB
testcase_13 AC 77 ms
71,180 KB
testcase_14 AC 85 ms
76,224 KB
testcase_15 AC 84 ms
76,040 KB
testcase_16 AC 76 ms
71,044 KB
testcase_17 AC 84 ms
76,344 KB
testcase_18 AC 76 ms
71,452 KB
testcase_19 AC 90 ms
76,588 KB
testcase_20 AC 83 ms
76,264 KB
testcase_21 AC 75 ms
71,040 KB
testcase_22 AC 89 ms
76,360 KB
testcase_23 AC 109 ms
77,004 KB
testcase_24 AC 136 ms
77,144 KB
testcase_25 AC 308 ms
77,036 KB
testcase_26 AC 96 ms
76,648 KB
testcase_27 AC 92 ms
76,608 KB
testcase_28 AC 309 ms
77,224 KB
testcase_29 AC 101 ms
76,688 KB
testcase_30 AC 110 ms
77,096 KB
testcase_31 AC 110 ms
77,004 KB
testcase_32 AC 96 ms
76,660 KB
testcase_33 AC 309 ms
77,168 KB
testcase_34 AC 310 ms
77,300 KB
testcase_35 AC 309 ms
76,868 KB
testcase_36 AC 307 ms
77,180 KB
testcase_37 AC 309 ms
76,856 KB
testcase_38 AC 308 ms
76,864 KB
testcase_39 AC 309 ms
77,188 KB
testcase_40 AC 307 ms
76,868 KB
testcase_41 AC 309 ms
76,976 KB
testcase_42 AC 310 ms
77,008 KB
testcase_43 AC 73 ms
71,424 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
ans=[]
for i in range(n):
  if 1<<i&bestans:
    ans.append(str(i+1))
print(' '.join(ans))
0