結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー lloyzlloyz
提出日時 2022-04-11 00:35:25
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 471 bytes
コンパイル時間 668 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 82,404 KB
最終ジャッジ日時 2023-08-21 06:18:44
合計ジャッジ時間 13,658 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,184 KB
testcase_01 AC 71 ms
71,492 KB
testcase_02 AC 70 ms
71,436 KB
testcase_03 AC 68 ms
71,596 KB
testcase_04 AC 69 ms
71,660 KB
testcase_05 AC 68 ms
71,460 KB
testcase_06 AC 70 ms
71,384 KB
testcase_07 AC 69 ms
71,484 KB
testcase_08 AC 71 ms
71,496 KB
testcase_09 AC 71 ms
71,720 KB
testcase_10 AC 70 ms
71,384 KB
testcase_11 AC 68 ms
71,616 KB
testcase_12 AC 70 ms
71,412 KB
testcase_13 AC 71 ms
71,380 KB
testcase_14 AC 75 ms
76,548 KB
testcase_15 AC 76 ms
76,232 KB
testcase_16 AC 69 ms
71,688 KB
testcase_17 AC 76 ms
76,664 KB
testcase_18 AC 71 ms
71,212 KB
testcase_19 AC 79 ms
76,576 KB
testcase_20 AC 74 ms
76,504 KB
testcase_21 AC 69 ms
71,588 KB
testcase_22 AC 79 ms
76,644 KB
testcase_23 AC 100 ms
77,252 KB
testcase_24 AC 114 ms
76,996 KB
testcase_25 AC 230 ms
77,200 KB
testcase_26 AC 83 ms
76,792 KB
testcase_27 AC 82 ms
76,704 KB
testcase_28 AC 231 ms
77,196 KB
testcase_29 AC 89 ms
76,516 KB
testcase_30 AC 97 ms
76,940 KB
testcase_31 AC 101 ms
77,172 KB
testcase_32 AC 82 ms
76,964 KB
testcase_33 AC 231 ms
77,124 KB
testcase_34 AC 230 ms
77,048 KB
testcase_35 AC 231 ms
77,180 KB
testcase_36 AC 230 ms
76,872 KB
testcase_37 AC 230 ms
77,008 KB
testcase_38 AC 231 ms
77,192 KB
testcase_39 AC 232 ms
77,184 KB
testcase_40 AC 231 ms
77,092 KB
testcase_41 AC 230 ms
77,096 KB
testcase_42 AC 233 ms
77,252 KB
testcase_43 AC 69 ms
71,496 KB
testcase_44 RE -
testcase_45 RE -
testcase_46 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import combinations

n = int(input())
A = list(map(int, input().split()))
B = [list(map(int, input().split())) for _ in range(n)]

ans = 0
for r in range(1, n + 1):
    for C in combinations(range(1, n + 1), r):
        res = 0
        for i in range(r):
            res += A[C[i] - 1]
            for j in range(i + 1, r):
                res += B[C[i] - 1][C[j] - 1]
        if res > ans:
            ans = res
            ANS = C
print(ans)
print(*ANS)
0