結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,076 KB
testcase_01 AC 74 ms
71,132 KB
testcase_02 AC 72 ms
71,236 KB
testcase_03 AC 74 ms
71,236 KB
testcase_04 AC 74 ms
71,112 KB
testcase_05 AC 75 ms
70,880 KB
testcase_06 AC 74 ms
71,116 KB
testcase_07 AC 74 ms
71,312 KB
testcase_08 AC 75 ms
71,036 KB
testcase_09 AC 74 ms
71,236 KB
testcase_10 AC 75 ms
71,300 KB
testcase_11 AC 74 ms
71,308 KB
testcase_12 AC 75 ms
70,972 KB
testcase_13 AC 74 ms
71,232 KB
testcase_14 AC 83 ms
76,016 KB
testcase_15 AC 82 ms
75,896 KB
testcase_16 AC 76 ms
71,072 KB
testcase_17 AC 84 ms
76,256 KB
testcase_18 AC 76 ms
71,076 KB
testcase_19 AC 90 ms
76,352 KB
testcase_20 AC 81 ms
76,032 KB
testcase_21 AC 75 ms
71,048 KB
testcase_22 AC 90 ms
76,500 KB
testcase_23 AC 109 ms
76,756 KB
testcase_24 AC 136 ms
76,748 KB
testcase_25 AC 298 ms
76,780 KB
testcase_26 AC 96 ms
76,168 KB
testcase_27 AC 92 ms
76,200 KB
testcase_28 AC 298 ms
76,972 KB
testcase_29 AC 106 ms
77,032 KB
testcase_30 AC 111 ms
76,824 KB
testcase_31 AC 112 ms
76,584 KB
testcase_32 AC 96 ms
76,288 KB
testcase_33 AC 296 ms
76,908 KB
testcase_34 AC 296 ms
77,080 KB
testcase_35 AC 300 ms
77,208 KB
testcase_36 AC 298 ms
76,792 KB
testcase_37 AC 296 ms
76,844 KB
testcase_38 AC 299 ms
76,820 KB
testcase_39 AC 299 ms
76,964 KB
testcase_40 AC 299 ms
77,080 KB
testcase_41 AC 297 ms
76,888 KB
testcase_42 AC 298 ms
77,108 KB
testcase_43 AC 74 ms
71,076 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
b = [list(map(int, input().split())) for i in range(n)]
cur = -(10 ** 18)
for bit in range(1 << n):
    l = []
    for i in range(n):
        if 1 << i & bit:
            l.append(i)
    leng = len(l)
    cnt = 0
    for i in l:
        cnt += a[i]
    for i in range(leng):
        for j in range(i + 1, leng):
            cnt += b[l[i]][l[j]]
    if cur < cnt:
        ans = l[:]
        cur = cnt
print(cur)
for i in range(len(ans)):
    ans[i] += 1
print(*ans)
0