結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー pluto77pluto77
提出日時 2022-02-09 14:39:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 172 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 86,820 KB
実行使用メモリ 79,380 KB
最終ジャッジ日時 2023-09-06 22:48:42
合計ジャッジ時間 12,049 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,348 KB
testcase_01 AC 71 ms
71,488 KB
testcase_02 AC 73 ms
71,408 KB
testcase_03 AC 70 ms
71,680 KB
testcase_04 AC 74 ms
71,472 KB
testcase_05 AC 73 ms
71,344 KB
testcase_06 AC 72 ms
71,428 KB
testcase_07 AC 72 ms
71,392 KB
testcase_08 AC 68 ms
71,408 KB
testcase_09 AC 71 ms
71,468 KB
testcase_10 AC 69 ms
71,400 KB
testcase_11 AC 70 ms
71,444 KB
testcase_12 AC 70 ms
71,108 KB
testcase_13 AC 71 ms
71,320 KB
testcase_14 AC 76 ms
76,808 KB
testcase_15 AC 80 ms
76,744 KB
testcase_16 AC 75 ms
71,344 KB
testcase_17 AC 79 ms
76,708 KB
testcase_18 AC 73 ms
71,632 KB
testcase_19 AC 78 ms
76,756 KB
testcase_20 AC 78 ms
76,388 KB
testcase_21 AC 69 ms
71,472 KB
testcase_22 AC 78 ms
76,868 KB
testcase_23 AC 88 ms
76,784 KB
testcase_24 AC 105 ms
77,232 KB
testcase_25 AC 166 ms
79,380 KB
testcase_26 AC 78 ms
76,784 KB
testcase_27 AC 78 ms
76,700 KB
testcase_28 AC 169 ms
79,208 KB
testcase_29 AC 80 ms
76,820 KB
testcase_30 AC 87 ms
77,048 KB
testcase_31 AC 87 ms
77,040 KB
testcase_32 AC 79 ms
76,732 KB
testcase_33 AC 169 ms
79,112 KB
testcase_34 AC 169 ms
79,224 KB
testcase_35 AC 165 ms
79,224 KB
testcase_36 AC 167 ms
79,208 KB
testcase_37 AC 167 ms
79,224 KB
testcase_38 AC 170 ms
78,948 KB
testcase_39 AC 172 ms
79,316 KB
testcase_40 AC 169 ms
79,064 KB
testcase_41 AC 168 ms
78,968 KB
testcase_42 AC 168 ms
79,272 KB
testcase_43 AC 71 ms
71,320 KB
testcase_44 AC 167 ms
78,924 KB
testcase_45 AC 73 ms
71,584 KB
testcase_46 AC 169 ms
79,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1360
n=int(input())
a=list(map(int,input().split()))
b=[list(map(int,input().split())) for i in range(n)]
res=[0]*(2**n)
for i in range(1,2**n):
 x=i.bit_length()-1
 y=2**x
 j=y^i
 z=res[j]+a[x]
 for k in range(n):
  if j&(2**k)>0:
   z+=b[k][x]
 res[i]=z
inx=1
for i in range(1,2**n):
 if res[inx]<res[i]:
  inx=i
print(res[inx])
res2=[]
for i in range(n):
 if 2**i & inx>0:
  res2.append(i+1)
print(*res2)
0