結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー GER_chenGER_chen
提出日時 2021-01-22 21:30:17
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 131 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 12,536 KB
最終ジャッジ日時 2023-08-27 17:34:16
合計ジャッジ時間 7,905 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 15 ms
7,872 KB
testcase_02 AC 16 ms
7,836 KB
testcase_03 AC 14 ms
7,768 KB
testcase_04 AC 14 ms
7,764 KB
testcase_05 WA -
testcase_06 AC 14 ms
7,808 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 15 ms
7,812 KB
testcase_10 WA -
testcase_11 AC 14 ms
7,776 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 16 ms
7,820 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 TLE -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
権限があれば一括ダウンロードができます

ソースコード

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<<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[x][y]
    #print(i, point)
    if point > prepoint:
        prepoint = point
        ans = [o+1 for o in on]
print(prepoint)
print(*ans)
0