結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー gorugo30gorugo30
提出日時 2021-01-22 21:35:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 571 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 77,396 KB
最終ジャッジ日時 2023-08-27 17:50:15
合計ジャッジ時間 14,091 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,200 KB
testcase_01 AC 81 ms
71,204 KB
testcase_02 AC 76 ms
71,336 KB
testcase_03 AC 76 ms
71,444 KB
testcase_04 AC 75 ms
71,496 KB
testcase_05 AC 74 ms
71,560 KB
testcase_06 AC 74 ms
71,600 KB
testcase_07 AC 75 ms
71,340 KB
testcase_08 AC 74 ms
71,500 KB
testcase_09 AC 74 ms
71,344 KB
testcase_10 AC 75 ms
71,460 KB
testcase_11 AC 75 ms
71,420 KB
testcase_12 AC 75 ms
71,332 KB
testcase_13 AC 73 ms
71,636 KB
testcase_14 AC 87 ms
76,516 KB
testcase_15 AC 86 ms
76,216 KB
testcase_16 AC 77 ms
71,324 KB
testcase_17 AC 90 ms
76,464 KB
testcase_18 AC 75 ms
71,584 KB
testcase_19 AC 90 ms
76,740 KB
testcase_20 AC 85 ms
76,476 KB
testcase_21 AC 77 ms
71,396 KB
testcase_22 AC 90 ms
76,716 KB
testcase_23 AC 109 ms
77,164 KB
testcase_24 AC 134 ms
77,044 KB
testcase_25 AC 302 ms
77,172 KB
testcase_26 AC 96 ms
76,720 KB
testcase_27 AC 90 ms
76,668 KB
testcase_28 AC 301 ms
76,852 KB
testcase_29 AC 100 ms
76,628 KB
testcase_30 AC 107 ms
76,844 KB
testcase_31 AC 108 ms
77,308 KB
testcase_32 AC 92 ms
76,524 KB
testcase_33 AC 303 ms
76,992 KB
testcase_34 AC 302 ms
77,108 KB
testcase_35 AC 302 ms
77,200 KB
testcase_36 AC 304 ms
77,160 KB
testcase_37 AC 302 ms
77,104 KB
testcase_38 AC 306 ms
77,148 KB
testcase_39 AC 302 ms
77,204 KB
testcase_40 AC 304 ms
77,368 KB
testcase_41 AC 310 ms
76,952 KB
testcase_42 AC 304 ms
77,356 KB
testcase_43 AC 73 ms
71,508 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)]
ans = -10000000000000000000000000000000000000000000000000000000000000000000000
bestids = []
for S in range(1 << N):
    ids = []
    for i in range(N):
        if S >> i & 1:
            ids.append(i)
    point = 0
    for i in range(len(ids)):
        point += A[ids[i]]
        for j in range(i + 1, len(ids)):
            point += B[ids[i]][ids[j]]
    if point > ans:
        ans = point
        bestids = ids
print(ans)
print(*map(lambda x: x + 1, bestids))
0