結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー 👑 rin204rin204
提出日時 2021-08-23 06:03:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 481 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 76,416 KB
最終ジャッジ日時 2024-04-24 21:09:47
合計ジャッジ時間 9,133 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,096 KB
testcase_01 AC 37 ms
51,968 KB
testcase_02 AC 35 ms
51,968 KB
testcase_03 AC 41 ms
51,712 KB
testcase_04 AC 34 ms
52,096 KB
testcase_05 AC 36 ms
52,096 KB
testcase_06 AC 36 ms
51,712 KB
testcase_07 AC 36 ms
52,096 KB
testcase_08 AC 36 ms
51,968 KB
testcase_09 AC 36 ms
51,840 KB
testcase_10 AC 36 ms
52,480 KB
testcase_11 AC 37 ms
51,840 KB
testcase_12 AC 35 ms
52,096 KB
testcase_13 AC 35 ms
52,096 KB
testcase_14 AC 48 ms
61,184 KB
testcase_15 AC 50 ms
61,568 KB
testcase_16 AC 39 ms
52,608 KB
testcase_17 AC 49 ms
61,184 KB
testcase_18 AC 37 ms
52,096 KB
testcase_19 AC 52 ms
64,000 KB
testcase_20 AC 48 ms
61,312 KB
testcase_21 AC 38 ms
52,352 KB
testcase_22 AC 52 ms
63,744 KB
testcase_23 AC 77 ms
76,032 KB
testcase_24 AC 100 ms
76,160 KB
testcase_25 AC 258 ms
76,032 KB
testcase_26 AC 58 ms
66,304 KB
testcase_27 AC 54 ms
65,024 KB
testcase_28 AC 257 ms
76,032 KB
testcase_29 AC 70 ms
71,296 KB
testcase_30 AC 79 ms
75,904 KB
testcase_31 AC 78 ms
75,904 KB
testcase_32 AC 59 ms
68,608 KB
testcase_33 AC 252 ms
76,288 KB
testcase_34 AC 258 ms
76,032 KB
testcase_35 AC 255 ms
76,032 KB
testcase_36 AC 257 ms
76,032 KB
testcase_37 AC 256 ms
76,032 KB
testcase_38 AC 254 ms
76,160 KB
testcase_39 AC 255 ms
76,032 KB
testcase_40 AC 253 ms
76,416 KB
testcase_41 AC 254 ms
76,032 KB
testcase_42 AC 265 ms
76,288 KB
testcase_43 AC 37 ms
52,096 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 _ in range(n)]
ans = -1
ind = -1
for bit in range(1 << n):
    lst = []
    for i in range(n):
        if bit >> i & 1:
            lst.append(i)
    l = len(lst)
    tmp = 0
    for i in range(l):
        tmp += A[lst[i]]
        for j in range(i + 1, l):
            tmp += B[lst[i]][lst[j]]
    if tmp > ans:
        ans = tmp
        ind = lst
print(ans)
print(*[i + 1 for i in ind])
0