結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー gorugo30gorugo30
提出日時 2021-01-22 21:38:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 604 bytes
コンパイル時間 687 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 77,244 KB
最終ジャッジ日時 2023-08-27 17:58:28
合計ジャッジ時間 12,843 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,844 KB
testcase_01 AC 70 ms
70,776 KB
testcase_02 AC 69 ms
70,964 KB
testcase_03 AC 69 ms
70,928 KB
testcase_04 AC 71 ms
70,884 KB
testcase_05 AC 70 ms
71,188 KB
testcase_06 AC 69 ms
70,840 KB
testcase_07 AC 68 ms
70,928 KB
testcase_08 AC 70 ms
70,968 KB
testcase_09 AC 69 ms
70,972 KB
testcase_10 AC 70 ms
70,824 KB
testcase_11 AC 71 ms
71,000 KB
testcase_12 AC 72 ms
71,188 KB
testcase_13 AC 70 ms
70,840 KB
testcase_14 AC 84 ms
75,648 KB
testcase_15 AC 82 ms
76,192 KB
testcase_16 AC 72 ms
71,100 KB
testcase_17 AC 78 ms
76,188 KB
testcase_18 AC 69 ms
71,092 KB
testcase_19 AC 84 ms
76,448 KB
testcase_20 AC 81 ms
76,072 KB
testcase_21 AC 69 ms
70,984 KB
testcase_22 AC 85 ms
76,472 KB
testcase_23 AC 103 ms
76,756 KB
testcase_24 AC 131 ms
76,932 KB
testcase_25 AC 298 ms
76,724 KB
testcase_26 AC 89 ms
76,364 KB
testcase_27 AC 86 ms
75,948 KB
testcase_28 AC 295 ms
76,708 KB
testcase_29 AC 93 ms
76,196 KB
testcase_30 AC 101 ms
76,544 KB
testcase_31 AC 103 ms
76,600 KB
testcase_32 AC 90 ms
76,156 KB
testcase_33 AC 299 ms
76,584 KB
testcase_34 AC 294 ms
76,636 KB
testcase_35 AC 295 ms
76,796 KB
testcase_36 AC 297 ms
76,796 KB
testcase_37 AC 303 ms
76,792 KB
testcase_38 AC 297 ms
76,840 KB
testcase_39 AC 299 ms
76,980 KB
testcase_40 AC 296 ms
76,504 KB
testcase_41 AC 295 ms
76,996 KB
testcase_42 AC 295 ms
76,496 KB
testcase_43 AC 71 ms
70,972 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 = -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
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