結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー 👑 H20H20
提出日時 2021-01-22 21:49:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 77,360 KB
最終ジャッジ日時 2023-08-27 18:37:42
合計ジャッジ時間 12,943 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,152 KB
testcase_01 AC 70 ms
70,952 KB
testcase_02 AC 71 ms
71,100 KB
testcase_03 AC 71 ms
71,104 KB
testcase_04 AC 70 ms
71,336 KB
testcase_05 AC 69 ms
71,336 KB
testcase_06 AC 73 ms
71,116 KB
testcase_07 AC 71 ms
71,168 KB
testcase_08 AC 70 ms
71,400 KB
testcase_09 AC 71 ms
71,104 KB
testcase_10 AC 73 ms
70,992 KB
testcase_11 AC 71 ms
71,448 KB
testcase_12 AC 71 ms
70,996 KB
testcase_13 AC 69 ms
71,404 KB
testcase_14 AC 80 ms
76,216 KB
testcase_15 AC 79 ms
76,324 KB
testcase_16 AC 72 ms
71,388 KB
testcase_17 AC 77 ms
76,264 KB
testcase_18 AC 69 ms
71,296 KB
testcase_19 AC 85 ms
76,404 KB
testcase_20 AC 77 ms
76,236 KB
testcase_21 AC 70 ms
71,344 KB
testcase_22 AC 87 ms
76,464 KB
testcase_23 AC 105 ms
77,168 KB
testcase_24 AC 121 ms
76,900 KB
testcase_25 AC 283 ms
77,192 KB
testcase_26 AC 92 ms
76,708 KB
testcase_27 AC 92 ms
76,696 KB
testcase_28 AC 284 ms
77,068 KB
testcase_29 AC 98 ms
77,156 KB
testcase_30 AC 104 ms
76,896 KB
testcase_31 AC 104 ms
76,908 KB
testcase_32 AC 90 ms
76,408 KB
testcase_33 AC 284 ms
77,360 KB
testcase_34 AC 284 ms
76,820 KB
testcase_35 AC 283 ms
77,148 KB
testcase_36 AC 287 ms
76,944 KB
testcase_37 AC 285 ms
76,840 KB
testcase_38 AC 287 ms
77,060 KB
testcase_39 AC 284 ms
77,288 KB
testcase_40 AC 282 ms
77,000 KB
testcase_41 AC 285 ms
77,088 KB
testcase_42 AC 285 ms
77,088 KB
testcase_43 AC 69 ms
70,980 KB
testcase_44 AC 272 ms
77,148 KB
testcase_45 AC 69 ms
71,136 KB
testcase_46 AC 285 ms
77,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split())) 
B=[]
ans = -10**9
ansL = []
for i in range(N):
    B.append(list(map(int, input().split())))
for i in range(1,2 ** N):
    CALL = []
    point = 0
    for j in range(N):
        if ((i >> j) & 1):
            CALL.append(j)
    for c in CALL:
        point+=A[c]
    for j in range(len(CALL)):
        for k in range(j+1,len(CALL)):
            point+=B[CALL[j]][CALL[k]]
    if ans < point:
        ans = point
        ansL = CALL.copy()
print(ans)
for i in range(len(ansL)):
    ansL[i]+=1
print(*ansL)
0