結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー だれだれ
提出日時 2021-01-22 21:31:11
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 1,655 ms
コンパイル使用メモリ 86,424 KB
実行使用メモリ 77,060 KB
最終ジャッジ日時 2023-08-27 17:37:38
合計ジャッジ時間 16,940 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
70,984 KB
testcase_01 AC 69 ms
71,040 KB
testcase_02 AC 69 ms
71,048 KB
testcase_03 AC 70 ms
70,852 KB
testcase_04 AC 68 ms
71,360 KB
testcase_05 AC 70 ms
70,964 KB
testcase_06 AC 68 ms
71,296 KB
testcase_07 AC 69 ms
70,924 KB
testcase_08 AC 68 ms
71,100 KB
testcase_09 AC 67 ms
70,968 KB
testcase_10 AC 66 ms
70,856 KB
testcase_11 AC 67 ms
71,244 KB
testcase_12 AC 68 ms
71,028 KB
testcase_13 AC 67 ms
71,036 KB
testcase_14 AC 83 ms
76,352 KB
testcase_15 AC 80 ms
76,308 KB
testcase_16 AC 75 ms
76,204 KB
testcase_17 AC 81 ms
76,388 KB
testcase_18 AC 67 ms
71,288 KB
testcase_19 AC 80 ms
76,468 KB
testcase_20 AC 78 ms
76,264 KB
testcase_21 AC 68 ms
71,360 KB
testcase_22 AC 81 ms
76,476 KB
testcase_23 AC 134 ms
76,320 KB
testcase_24 AC 160 ms
77,060 KB
testcase_25 AC 479 ms
76,952 KB
testcase_26 AC 85 ms
76,476 KB
testcase_27 AC 81 ms
76,236 KB
testcase_28 AC 486 ms
76,756 KB
testcase_29 AC 98 ms
76,692 KB
testcase_30 AC 132 ms
76,484 KB
testcase_31 AC 131 ms
76,384 KB
testcase_32 AC 85 ms
76,244 KB
testcase_33 AC 471 ms
76,944 KB
testcase_34 AC 471 ms
76,688 KB
testcase_35 AC 467 ms
76,732 KB
testcase_36 AC 478 ms
76,692 KB
testcase_37 AC 468 ms
76,744 KB
testcase_38 AC 465 ms
76,728 KB
testcase_39 AC 466 ms
76,704 KB
testcase_40 AC 479 ms
76,648 KB
testcase_41 AC 483 ms
76,900 KB
testcase_42 AC 481 ms
76,744 KB
testcase_43 AC 68 ms
71,056 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
for i in range(1 << n):
    t = 0
    for j in range(n):
        if i >> j & 1:
            t += a[j]
    for j in range(n-1):
        for k in range(j+1, n):
            if i>>j & 1 and i>>k & 1:
                t += b[j][k]
    if ans < t:
        ans = t
        anss = i
print(ans)
u = []
for i in range(n):
    if anss >> i & 1:
        u.append(i+1)
if u:
    print(*u)
0