結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー convexineqconvexineq
提出日時 2021-01-23 10:33:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 437 ms / 2,000 ms
コード長 433 bytes
コンパイル時間 565 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 77,180 KB
最終ジャッジ日時 2023-08-28 19:24:31
合計ジャッジ時間 14,629 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
71,144 KB
testcase_01 AC 68 ms
71,344 KB
testcase_02 AC 68 ms
71,036 KB
testcase_03 AC 68 ms
71,276 KB
testcase_04 AC 67 ms
71,008 KB
testcase_05 AC 69 ms
71,204 KB
testcase_06 AC 66 ms
70,980 KB
testcase_07 AC 68 ms
71,236 KB
testcase_08 AC 68 ms
71,208 KB
testcase_09 AC 67 ms
71,344 KB
testcase_10 AC 68 ms
71,104 KB
testcase_11 AC 70 ms
71,360 KB
testcase_12 AC 69 ms
71,160 KB
testcase_13 AC 69 ms
71,320 KB
testcase_14 AC 78 ms
76,444 KB
testcase_15 AC 77 ms
76,292 KB
testcase_16 AC 71 ms
75,740 KB
testcase_17 AC 77 ms
76,004 KB
testcase_18 AC 68 ms
71,240 KB
testcase_19 AC 80 ms
76,008 KB
testcase_20 AC 77 ms
76,348 KB
testcase_21 AC 68 ms
71,168 KB
testcase_22 AC 79 ms
76,296 KB
testcase_23 AC 112 ms
76,680 KB
testcase_24 AC 128 ms
76,880 KB
testcase_25 AC 433 ms
76,860 KB
testcase_26 AC 84 ms
76,404 KB
testcase_27 AC 86 ms
76,532 KB
testcase_28 AC 433 ms
76,856 KB
testcase_29 AC 90 ms
76,448 KB
testcase_30 AC 102 ms
76,904 KB
testcase_31 AC 101 ms
76,956 KB
testcase_32 AC 87 ms
76,488 KB
testcase_33 AC 437 ms
76,908 KB
testcase_34 AC 435 ms
76,896 KB
testcase_35 AC 432 ms
76,844 KB
testcase_36 AC 435 ms
77,180 KB
testcase_37 AC 434 ms
76,868 KB
testcase_38 AC 435 ms
76,944 KB
testcase_39 AC 435 ms
76,780 KB
testcase_40 AC 432 ms
77,008 KB
testcase_41 AC 434 ms
76,880 KB
testcase_42 AC 433 ms
76,940 KB
testcase_43 AC 67 ms
71,104 KB
testcase_44 AC 426 ms
76,996 KB
testcase_45 AC 67 ms
71,132 KB
testcase_46 AC 431 ms
76,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
b = [list(map(int,input().split())) for _ in range(n)]
ans = 0
val = -1<<50
N = 1<<n
for mask in range(1,N):
    v = 0
    for i in range(n):
        if mask>>i&1==0: continue
        v += a[i]
        for j in range(i+1,n):
            if mask>>j&1:
                v += b[i][j]
    if v > val:
        val = v
        ans = mask
print(val)
print(*(i+1 for i in range(n) if ans>>i&1))
0