結果

問題 No.1360 [Zelkova 4th Tune] 協和音
ユーザー zyxwzyxw
提出日時 2021-02-02 20:13:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 522 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 77,100 KB
最終ジャッジ日時 2023-09-12 11:21:53
合計ジャッジ時間 13,055 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,016 KB
testcase_01 AC 71 ms
70,964 KB
testcase_02 AC 71 ms
71,120 KB
testcase_03 AC 72 ms
71,332 KB
testcase_04 AC 73 ms
71,104 KB
testcase_05 AC 72 ms
70,972 KB
testcase_06 AC 70 ms
70,956 KB
testcase_07 AC 72 ms
71,144 KB
testcase_08 AC 71 ms
70,980 KB
testcase_09 AC 73 ms
71,072 KB
testcase_10 AC 74 ms
70,836 KB
testcase_11 AC 73 ms
71,012 KB
testcase_12 AC 73 ms
71,048 KB
testcase_13 AC 73 ms
71,172 KB
testcase_14 AC 79 ms
76,500 KB
testcase_15 AC 82 ms
76,112 KB
testcase_16 AC 73 ms
71,148 KB
testcase_17 AC 79 ms
76,388 KB
testcase_18 AC 72 ms
71,184 KB
testcase_19 AC 83 ms
76,576 KB
testcase_20 AC 81 ms
76,120 KB
testcase_21 AC 72 ms
71,100 KB
testcase_22 AC 84 ms
76,364 KB
testcase_23 AC 105 ms
76,828 KB
testcase_24 AC 133 ms
76,636 KB
testcase_25 AC 287 ms
76,784 KB
testcase_26 AC 88 ms
76,348 KB
testcase_27 AC 86 ms
76,236 KB
testcase_28 AC 283 ms
76,888 KB
testcase_29 AC 96 ms
76,248 KB
testcase_30 AC 103 ms
77,100 KB
testcase_31 AC 104 ms
76,792 KB
testcase_32 AC 89 ms
76,372 KB
testcase_33 AC 285 ms
76,696 KB
testcase_34 AC 283 ms
76,604 KB
testcase_35 AC 283 ms
76,736 KB
testcase_36 AC 285 ms
76,664 KB
testcase_37 AC 282 ms
76,724 KB
testcase_38 AC 286 ms
76,724 KB
testcase_39 AC 283 ms
76,724 KB
testcase_40 AC 285 ms
76,996 KB
testcase_41 AC 282 ms
76,716 KB
testcase_42 AC 285 ms
76,760 KB
testcase_43 AC 71 ms
70,968 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=-10**12
ans_li=[]
for i in range(2**N):
    ans_pre=0
    ans_li_pre=[]
    for j in range(N):
        if (i>>j)&1:
            ans_li_pre.append(j+1)
            ans_pre+=A[j]
    for j in range(len(ans_li_pre)-1):
        for k in range(j+1,len(ans_li_pre)):
            ans_pre+=B[ans_li_pre[j]-1][ans_li_pre[k]-1]
    if ans_pre>ans:
        ans=ans_pre
        ans_li=ans_li_pre
print(ans)
print(*sorted(ans_li))
0