結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー pluto77pluto77
提出日時 2022-02-09 14:39:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,447 ms / 2,000 ms
コード長 413 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 21,016 KB
最終ジャッジ日時 2023-09-06 22:49:11
合計ジャッジ時間 26,613 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,720 KB
testcase_01 AC 16 ms
7,752 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 15 ms
7,804 KB
testcase_04 AC 16 ms
7,800 KB
testcase_05 AC 15 ms
7,728 KB
testcase_06 AC 15 ms
7,896 KB
testcase_07 AC 15 ms
7,800 KB
testcase_08 AC 16 ms
7,892 KB
testcase_09 AC 15 ms
7,768 KB
testcase_10 AC 16 ms
7,796 KB
testcase_11 AC 15 ms
7,780 KB
testcase_12 AC 15 ms
7,804 KB
testcase_13 AC 16 ms
7,804 KB
testcase_14 AC 16 ms
7,728 KB
testcase_15 AC 17 ms
7,772 KB
testcase_16 AC 16 ms
7,916 KB
testcase_17 AC 16 ms
7,892 KB
testcase_18 AC 16 ms
7,916 KB
testcase_19 AC 17 ms
7,916 KB
testcase_20 AC 17 ms
7,908 KB
testcase_21 AC 16 ms
7,800 KB
testcase_22 AC 17 ms
7,744 KB
testcase_23 AC 156 ms
9,340 KB
testcase_24 AC 312 ms
10,612 KB
testcase_25 AC 1,369 ms
18,204 KB
testcase_26 AC 30 ms
8,236 KB
testcase_27 AC 22 ms
7,900 KB
testcase_28 AC 1,400 ms
18,188 KB
testcase_29 AC 83 ms
8,880 KB
testcase_30 AC 155 ms
9,228 KB
testcase_31 AC 154 ms
9,312 KB
testcase_32 AC 48 ms
8,596 KB
testcase_33 AC 1,381 ms
20,376 KB
testcase_34 AC 1,405 ms
19,592 KB
testcase_35 AC 1,403 ms
19,420 KB
testcase_36 AC 1,447 ms
20,380 KB
testcase_37 AC 1,378 ms
19,424 KB
testcase_38 AC 1,387 ms
19,216 KB
testcase_39 AC 1,379 ms
21,016 KB
testcase_40 AC 1,373 ms
20,356 KB
testcase_41 AC 1,421 ms
19,348 KB
testcase_42 AC 1,391 ms
20,864 KB
testcase_43 AC 16 ms
7,768 KB
testcase_44 AC 1,294 ms
10,104 KB
testcase_45 AC 15 ms
7,804 KB
testcase_46 AC 1,340 ms
18,268 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