結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー convexineqconvexineq
提出日時 2021-01-23 10:31:36
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 425 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 86,928 KB
実行使用メモリ 77,204 KB
最終ジャッジ日時 2023-08-28 19:21:11
合計ジャッジ時間 14,908 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
70,796 KB
testcase_01 AC 69 ms
71,284 KB
testcase_02 AC 69 ms
71,144 KB
testcase_03 AC 68 ms
71,268 KB
testcase_04 AC 69 ms
71,176 KB
testcase_05 AC 68 ms
70,976 KB
testcase_06 AC 68 ms
71,176 KB
testcase_07 AC 69 ms
71,164 KB
testcase_08 AC 69 ms
71,180 KB
testcase_09 AC 68 ms
70,992 KB
testcase_10 AC 68 ms
71,340 KB
testcase_11 AC 70 ms
71,392 KB
testcase_12 AC 68 ms
71,348 KB
testcase_13 AC 69 ms
71,100 KB
testcase_14 AC 79 ms
76,436 KB
testcase_15 AC 77 ms
76,116 KB
testcase_16 AC 71 ms
75,404 KB
testcase_17 AC 77 ms
76,492 KB
testcase_18 AC 67 ms
71,232 KB
testcase_19 AC 87 ms
76,360 KB
testcase_20 AC 85 ms
76,268 KB
testcase_21 AC 70 ms
71,340 KB
testcase_22 AC 79 ms
76,432 KB
testcase_23 AC 105 ms
76,936 KB
testcase_24 AC 128 ms
76,708 KB
testcase_25 AC 438 ms
76,804 KB
testcase_26 AC 82 ms
76,340 KB
testcase_27 AC 84 ms
76,560 KB
testcase_28 AC 433 ms
76,988 KB
testcase_29 AC 89 ms
76,456 KB
testcase_30 AC 103 ms
76,852 KB
testcase_31 AC 102 ms
76,844 KB
testcase_32 AC 84 ms
76,300 KB
testcase_33 AC 432 ms
76,848 KB
testcase_34 AC 433 ms
76,940 KB
testcase_35 AC 432 ms
76,840 KB
testcase_36 AC 433 ms
76,892 KB
testcase_37 AC 434 ms
76,804 KB
testcase_38 AC 433 ms
76,932 KB
testcase_39 AC 435 ms
76,848 KB
testcase_40 AC 434 ms
76,624 KB
testcase_41 AC 434 ms
76,756 KB
testcase_42 AC 433 ms
76,948 KB
testcase_43 AC 69 ms
71,096 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
*a, = map(int,input().split())
b = [list(map(int,input().split())) for _ in range(n)]

ans = val = 0
N = 1<<n
for mask in range(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