結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー GER_chenGER_chen
提出日時 2021-01-22 21:45:14
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 541 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 81,788 KB
最終ジャッジ日時 2023-08-27 18:29:03
合計ジャッジ時間 13,824 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,200 KB
testcase_01 AC 74 ms
71,236 KB
testcase_02 AC 75 ms
71,188 KB
testcase_03 AC 75 ms
71,300 KB
testcase_04 AC 76 ms
71,384 KB
testcase_05 AC 76 ms
71,056 KB
testcase_06 AC 76 ms
71,388 KB
testcase_07 AC 77 ms
71,188 KB
testcase_08 AC 77 ms
71,084 KB
testcase_09 AC 75 ms
71,300 KB
testcase_10 AC 76 ms
71,292 KB
testcase_11 AC 75 ms
71,336 KB
testcase_12 AC 76 ms
71,364 KB
testcase_13 AC 76 ms
71,332 KB
testcase_14 AC 93 ms
76,528 KB
testcase_15 AC 86 ms
76,368 KB
testcase_16 AC 76 ms
71,352 KB
testcase_17 AC 88 ms
76,680 KB
testcase_18 AC 77 ms
71,304 KB
testcase_19 AC 90 ms
76,580 KB
testcase_20 AC 87 ms
76,600 KB
testcase_21 AC 76 ms
71,292 KB
testcase_22 AC 88 ms
76,776 KB
testcase_23 AC 105 ms
76,884 KB
testcase_24 AC 136 ms
76,876 KB
testcase_25 AC 289 ms
77,160 KB
testcase_26 AC 91 ms
76,612 KB
testcase_27 AC 88 ms
76,376 KB
testcase_28 AC 286 ms
77,028 KB
testcase_29 AC 98 ms
76,348 KB
testcase_30 AC 107 ms
77,076 KB
testcase_31 AC 107 ms
76,948 KB
testcase_32 AC 94 ms
76,440 KB
testcase_33 AC 285 ms
77,028 KB
testcase_34 AC 283 ms
77,108 KB
testcase_35 AC 285 ms
77,180 KB
testcase_36 AC 285 ms
77,100 KB
testcase_37 AC 285 ms
76,940 KB
testcase_38 AC 284 ms
77,020 KB
testcase_39 AC 283 ms
77,132 KB
testcase_40 AC 283 ms
77,132 KB
testcase_41 AC 279 ms
76,988 KB
testcase_42 AC 285 ms
77,108 KB
testcase_43 AC 75 ms
71,388 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki-1360
N = int(input())
A = list(map(int, input().split()))
B = [list(map(int, input().split())) for _ in range(N)]
prepoint = 0
for i in range(1, 1<<N):
    on, point = [], 0
    for j in range(N):
        if (i>>j)&1:
            on.append(j)
            point += A[j]
    l = len(on)
    if l > 1:
        for x in range(l-1):
            for y in range(x+1, l):
                point += B[on[x]][on[y]]
    #print(i, point)
    if point > prepoint:
        prepoint = point
        ans = [o+1 for o in on]
print(prepoint)
print(*ans)
0